Quick disclaimer: Using the TikTok API to pull ad data out of the platform can be a lengthy and cumbersome process. This guide provides a step-by-step process for tapping into the TikTok API to extract data for campaign analysis in a third-party tool. However, if you’re a “ain’t nobody got time for that” kind of marketer, we recommend using an ad data connector to do the data dirty work for you. Obviously we’d love it if you used Joinr. Because we’re free, and from a totally biased perspective, the absolute best in the biz.
Step 1: Connect an App to TikTok
- After you login to the TikTok Marketing API Portal and set up your developer account, the first step is to “Create an App”.
From there, you set up your app by giving it a name, adding a description, and selecting all relevant permissions:
After you click “Confirm”, this will create your app and set it to Pending. The approval process takes about 1-2 days; after the app is approved, you will see the app details, which importantly reveal your App ID and Secret.
Step 2: Auth Code + Access Tokens
Once your app has been approved, it will generate an authorization URL, which we’ll use to get your auth code and any relevant access tokens.
- Copy the Advertizer authorization URL, and paste it into a new tab.
This will open a modal screen that will ask you to confirm any permissions that were set on this particular app.
After you click “confirm”, you’ll be redirected to the URL you set in the Advertiser redirect URL (see screenshot above). In this new redirected URL, you’ll see an auth code. Copy and paste that and keep note of it somewhere.
Step 3: Use an API service to capture values
For this step, we’ll use Postman to input our POST method values and grab any relevant data from TikTok.
- In the body, you’ll in put the App ID, auth code and secret. The app ID and secret can be found in the TikTok API portal, while the auth code is found in the URL above.
Next, you’ll create a request for an access token. Once you have that, you can finally get your ad data. The POST request is sent to this address:
https://open-api.tiktok.com/oauth/access_token/
Boom! Now that you have your access token, you can fire GET requests to pull data from the TikTok API. In the key-value pairing, the key is access-token, and the value is the access token you just generated.
You can now use your TikTok API endpoints to grab specific data from TikTok. Postman has a wide select of examples you can use, or you can read the official API documentation to get them yourself.
Fetch data automatically with Joinr
Now that we’ve covered the drudgingly slow step-by-step API process, it’s time to shift gears and talk about how you can save hours of time using an automatic data unification tool like Joinr. Joinr automatically connects to your TikTok ads account, and funnels your data through our ad data pipeline, where your data is cleaned and primed for analysis in Google Data Studio. It all happens in a matter of minutes, not hours–giving you more time for the things that matter. Like actual data analysis.
Get started in seconds with our free TikTok Ads connector. And if you connect more than one platform to Joinr, we’ll automatically blend all your data into a single data set. Giving you better cross-channel campaign insights.