TikTok Ads API Tutorial - Creating Ads | (2024)

Create campaigns, ad groups and ads via the TikTok Ads API without ever needing to open with the TikTok Ads Manager.

In this TikTok Ads API tutorial, you will learn how to:

  • Upload Video and Image Creatives to TikTok
  • Create a TikTok Campaign
  • Create an Ad Group via the TikTok Ads API
  • Create a TikTok Ad via the API

This tutorial targets marketers working with TikTok Ads who are comfortable in a somewhat technical environment. You should already have an existing TikTok App and an access token. If not, check out our first part of the series here.

If you want to work with the TikTok Ads API but do NOT want to go through technical documentation or handle authentication yourself, check out Kitchn.io.

Upload Video and Image Creatives

To make API requests, we need to use Insomnia or Postman. Or use your programming language of choice.

To start with, we will use our previously created sandbox account instead of a “real” ad account. That way, there is no way we can mess up any real data. Follow this Youtube tutorial to create your own if you don’t want to use your real ad account.

Here’s the request we need to make. First, use business-api.tiktok.com instead of sandbox-ads.tiktok.com if using a live account.

POST https://sandbox-ads.tiktok.com/open_api/1.2/file/video/ad/upload/
{ "advertiser_id":"{{Your Account ID}}", "upload_type": "UPLOAD_BY_URL", "file_name": "{{Your Video Name}}", "video_url": "{{Your Video URL}}"}

Make sure to use a unique file name, as the TikTok Ads API will throw an error otherwise.

If successful, the response should look as follows:

{ [...] "data": [ { "id": "v10033g50000c5tv9s3c77ufd1ob29g0" [...] } ]}

Now let’s use the video_id to get more information about the video, particularly the thumbnail image we’ll need later to create our ad.

GET https://sandbox-ads.tiktok.com/open_api/1.2/file/video/ad/info/?advertiser_id=7106541027904733185&video_ids=["v10033g50000c5tv9s3c77ufd1ob29g0"]

TikTok responds with a bunch of information about the video, like height, width, etc.

{ [...] "data": { "list": [ { "id": "v10033g50000c5tv9s3c77ufd1ob29g0", "height": 1920, "width": 1080, [...] "file_name": "{{Your Video Name}}", "format": "mp4", "poster_url": "{{Link to thumbnail image}}" } ] }}

We will need to use the image from the poster_url field to create an Image Creative through the TikTok Ads API.

 POST https://sandbox-ads.tiktok.com/open_api/1.2/file/image/ad/upload/
{ "advertiser_id":"{{Your Account ID}}", "upload_type": "UPLOAD_BY_URL", "file_name": "{{Your Image Name}}", "image_url": "{{Link to thumbnail image}}"}

If successful, this should return the image ID we will need lateron.

{ [...] "data": { [...] "id": "ad-site-i18n-sg/202208095d0d1d72383f815646c5b090" }}

Make sure to store the video id ("v10033g50000c5tv9s3c77ufd1ob29g0") and image id ("ad-site-i18n-sg/202208095d0d1d72383f815646c5b090") for later use.

Create a TikTok Campaign

Next up, let’s create a campaign. Again, we’ll use the minimum number of fields to create our campaign. For full reference, check out TikTok’s official documentation.

TikTok Ads API Tutorial - Creating Ads | (1)

The TikTok Ads API supports many different use cases and has extensive documentation.

 POST https://sandbox-ads.tiktok.com/open_api/1.2/campaign/create/
{ "advertiser_id": "{{Your Account ID}}", "budget_mode": "BUDGET_MODE_DAY", "budget": {{Your Campaign Name}}, "objective_type": "REACH", "campaign_name": "{{Your Campaign Name}}"}

As you can see above, we’re optimizing for reach with this campaign objective. Therefore, you may want to use “CONVERSIONS” or “APP_INSTALLS” instead.

Make sure to use a unique campaign name. If successful, the TikTok Ads API will respond with the newly created campaign’s id:

{ [...] "data": { "campaign_id":1740687531023393 }}

Note that the campaign id is an integer, not a string.

Create an Ad Group via the TikTok Ads API

Next, use the campaign_id from above to create an ad group.

 POST https://sandbox-ads.tiktok.com/open_api/1.2/adgroup/create/
{ "advertiser_id": "{{Your Account ID}}", "campaign_id": "1740687531023393", "adgroup_name": "{{Your Ad Group Name}}", "placement_type": "PLACEMENT_TYPE_NORMAL", "placement": ["PLACEMENT_TIKTOK"], "location": [ 6252001 ], "budget_mode": "BUDGET_MODE_DAY", "budget": 1000, "schedule_type": "SCHEDULE_START_END", "schedule_end_time": "2023-01-01 00:00:00", "schedule_start_time": "2022-08-01 00:00:00", "optimize_goal": "REACH", "pacing": "PACING_MODE_SMOOTH", "billing_event": "CPM", "bid_type": "BID_TYPE_NO_BID", "frequency": 2, "frequency_schedule": 3}

If you previously created a CONVERSIONS or APP_INSTALLS campaign, you will not need to pass in the frequency fields, though you may have to specify other fields.

The location id 6252001 refers to the US. Find all location ids here.

Let’s note down the adgroup_id from TikTok’s response:

{ [...] "data": { "adgroup_id":1735011541108770 }}

Create a TikTok Ad via the API

Now that we have uploaded a video, created a thumbnail image, and created a campaign and ad group, we are ready to finally create the ad.

First, we’ll be creating a simple video ad with a custom identity, i.e., we are not using an existing TikTok profile but instead the display_name field.

 POST https://sandbox-ads.tiktok.com/open_api/1.2/ad/create/
{ "advertiser_id":"7106541027904733185", "adgroup_id": "1735011541108770", "creatives": [{ "video_id": "v10033g50000c5tv9s3c77ufd1ob29g0", "ad_name": "{{Your Ad Name}}", "ad_text": "{{Your Ad Copy}}", "ad_format": "SINGLE_VIDEO", "image_ids": [ "ad-site-i18n-sg/202208095d0d1d72383f815646c5b090" ], "display_name": "{{Your Display Name}}" }]}

Et voila, we have created our first ad:

{ [...] "data": { "need_audit": false, "ad_ids": [ 1735012019671058 ] }}

If you made it to the end: Well done!

To conclude, many more nuances to all the different settings can be chosen on each level. Still, hopefully, this tutorial has given you an outlook on the process and some examples to get you started.

You are well on creating all of your TikTok Ads via the API.

TikTok Ads API Tutorial - Creating Ads | (2024)

FAQs

How to get TikTok ads api? ›

Register as a developer

To access the TikTok Ads API, you'll first have to get a TikTok For Business account. Register as a developer here. If you don't have a TikTok account, you must create one. After creating the account or logging in, click on Become a Developer on the top right.

How are TikTok ads generated? ›

How do TikTok ads work? Brands or creators pay for TikTok video ads to appear in user's feeds along with regular content. Advertisers pay using a bidding/auction model, meaning that the advertiser determines what they are willing to pay per optimization goal (likes, impressions or views).

How do you structure TikTok ads? ›

How to set up an ad campaign in TikTok Ads Manager. TikTok Ads Manager structures ads into three parts: campaigns, ad groups, and ads. When you create an ad campaign, you will need to set up the advertising objective, campaign name, and budget.

Does TikTok have a free API? ›

TikTok's public APIs are free to use. This enables creators and businesses to build tools for creators, researchers, and communities.

How much does TikTok charge to run ads? ›

TikTok uses a cost per mile (CPM) metric to charge for ads. This roughly translates into the advertiser paying 10 dollars or 9 pounds for every 1,000 views. If you want to start an advertising campaign, that will cost a minimum budget of 500 dollars or 410 pounds.

How profitable is TikTok ads? ›

TikTok net advertising revenue worldwide 2020-2024

In 2021, TikTok generated 3.88 billion U.S. dollars in advertising revenue worldwide. For 2022, the Chinese social media platform is projected to more than triple this result with 9.89 billion U.S. dollars.

How does the TikTok ads algorithm work? ›

TikTok's algorithm works by analyzing thousands of signals by a user to determine what kind of content they most want to see. These signals — things like likes, comments, follows, and how long they spend on a particular video — determine what videos appear on their 'For You' page and in what order.

What is the hierarchy of TikTok ads? ›

Ads run on TikTok Ads Manager are structured into 3 parts: "Campaigns", "Ad Groups", and "Ads". Understanding how your campaigns are structured will help you better set up target audiences, allocate your budget and design creative.

Are TikTok ads worth it? ›

Well, the short answer is Yes. With all the great potentials of advertising ranging from its huge, diverse, and hyper-engaged audience, and numerous TikTok ad formats, to its authenticity-driven and user-generated content, we believe TikTok advertising is worth a try.

How do I get access to TikTok ads? ›

Go to the Advertising on TikTok signup page. Create a login using an email address or phone number and set a password. These are your login credentials to access your TikTok Ads Manager account. Agree to the TikTok terms and conditions and click Sign Up.

Does TikTok have an upload API? ›

To initiate video upload on TikTok's servers, you must invoke the Content Posting API - Video Upload endpoint.

Top Articles
Latest Posts
Article information

Author: Arline Emard IV

Last Updated:

Views: 6264

Rating: 4.1 / 5 (52 voted)

Reviews: 91% of readers found this page helpful

Author information

Name: Arline Emard IV

Birthday: 1996-07-10

Address: 8912 Hintz Shore, West Louie, AZ 69363-0747

Phone: +13454700762376

Job: Administration Technician

Hobby: Paintball, Horseback riding, Cycling, Running, Macrame, Playing musical instruments, Soapmaking

Introduction: My name is Arline Emard IV, I am a cheerful, gorgeous, colorful, joyous, excited, super, inquisitive person who loves writing and wants to share my knowledge and understanding with you.