Back

TikTok Ads API Essential Guide

Aug 3, 20246 minute read

What type of API does TikTok Ads provide?

Based on the search results provided, it appears that TikTok Ads uses a REST API. The TikTok Commercial Content API documentation describes endpoints and data structures in a way that is consistent with REST API conventions. There is no mention of TikTok using GraphQL, SOAP, or other API types for their advertising platform. REST APIs are noted to be simple, scalable, and flexible, which aligns with what a large platform like TikTok would likely use.

Does the TikTok Ads API have webhooks?

Yes, the official TikTok Ads API does have webhooks. Here are the key points about TikTok's webhook functionality:

Webhook Availability

TikTok provides webhooks that allow you to subscribe to events and receive notifications when specific events occur.

Event Types

You can subscribe to the following types of events:

  1. video.publish.completed: Fired when a video uploaded from Video Kit has been published by the user on TikTok.

  2. authorization.removed: Fired when a user's account is deauthorized from your application.

  3. video.upload.failed: Fired when a video uploaded from Video Kit fails to upload to TikTok.

  4. portability.download.ready: Fired when data requested via the Data Portability API is in the 'downloading' state.

Webhook Setup

  • By default, you are subscribed to all events when a callback URL is configured in the TikTok Developer Portal.
  • To receive webhook messages, you need to register a callback URL in your client application on the TikTok Developer Portal.

Webhook Payload

The webhook payload includes the following information:

  • client_key: The unique identification key provisioned to the partner
  • event: The name of the event
  • create_time: The time when the event occurred (UTC epoch time in seconds)
  • user_openid: The TikTok user's unique identifier
  • content: A serialized JSON string containing event information

Best Practices

  1. Use HTTPS for your callback URL endpoint.
  2. Respond immediately with a 200 HTTP status code to acknowledge receipt of the event notification.
  3. Make your event processing idempotent, as TikTok may send the same event more than once.
  4. Be prepared to handle retries, as TikTok will attempt to redeliver notifications for up to 72 hours if a 200 HTTP status code is not received.

Summary

TikTok's webhook system allows developers to receive real-time notifications for various events related to video publishing, authorization changes, and data portability. By implementing webhooks, you can create more responsive and efficient applications that react to TikTok platform events in real-time.

Rate Limits and other limitations

Based on the search results provided, here are the key points about the API Rate Limits of the TikTok Ads API:

General Rate Limit Information

  • TikTok API limits the number of requests you can send in a given timeframe.
  • Limits for each API are set and enforced separately.
  • Request rate calculation is based on a one-minute sliding window.

Default Limits

  • For the /v2/video/list/ endpoint, the default limit is 600 requests per minute.

Exceeding Rate Limits

  • If the number of requests exceeds the threshold, new requests will be throttled.
  • A response will be returned with HTTP status 429 and error code rate_limit_exceeded.

Requesting Higher Limits

  • If your application needs higher limits, you can contact TikTok using their Support Page.
  • TikTok will review your request, and if approved, rate limits will be increased.

Research API Limits

While not specifically for the Ads API, the Research API has the following limits which may be relevant:

  • Daily limit of 1000 requests per day, allowing up to 100,000 records per day across their APIs.
  • For Followers and Following lists API, up to 2M records per day by making up to 20,000 calls per day.
  • Virtual Compute Environment (VCE) access allows up to 5,000 records per day in the "Test Stage".

Key Considerations

  • Rate limits are an important aspect of API usage and should be carefully managed to avoid disruptions in service.
  • Different endpoints may have different rate limits, so it's important to check the specific limits for the endpoints you're using.
  • If you need higher limits, be prepared to justify your use case when contacting TikTok support.

It's important to note that the search results don't provide specific information about the TikTok Ads API rate limits. The information provided is mostly about the general TikTok API and the Research API. For the most accurate and up-to-date information on TikTok Ads API rate limits, it would be best to consult the official TikTok Ads API documentation or contact TikTok support directly.

Latest API Version

Based on the search results provided, I could not find a specific mention of the most recent version number for the TikTok Ads API. However, I can provide some relevant information about recent updates and changes to TikTok's APIs:

Recent Updates

  1. The most recent update mentioned is from July 9, 2024, which launched a Playlist Info endpoint for the Research API and added additional fields to existing APIs.

  2. On June 24, 2024, TikTok launched Sandbox mode and updated the app page interface for developers.

  3. In February 2024, TikTok launched five additional APIs that allow querying liked videos, reposted videos, pinned videos, and the followers/following list of a user.

Key Points to Consider

  • TikTok regularly updates its APIs and introduces new features. The changelog provided shows frequent updates throughout 2023 and into 2024.

  • TikTok offers various APIs for different purposes, including the Content Posting API, Research API, Login Kit, Share Kit, and Commercial Content API.

  • The company provides documentation and resources for developers on their developer portal.

Best Practices

  1. Always refer to the official TikTok developer documentation for the most up-to-date information on API versions and features.

  2. Keep an eye on the changelog provided by TikTok to stay informed about new features, updates, and changes to the APIs.

  3. If you're working with the TikTok Ads API specifically, it's recommended to check the TikTok for Business API portal for the most accurate and current information.

While I couldn't provide the exact version number of the most recent TikTok Ads API, this information should give you an overview of recent updates and where to look for the most current information. For the most accurate and up-to-date version information, it's best to consult the official TikTok for Business API documentation directly.

How to get a TikTok Ads developer account and API Keys?

To get a developer account for TikTok Ads and create an API integration, you'll need to follow these steps:

1. Create a TikTok for Business Account

First, you need to create a TikTok for Business account if you don't already have one. This is separate from a regular TikTok account.

2. Apply for TikTok Marketing API Access

Once you have a TikTok for Business account:

  1. Go to the TikTok for Business website
  2. Navigate to the Marketing API section
  3. Click on "Apply for API Access"
  4. Fill out the application form with details about your business and intended API usage

3. Wait for Approval

TikTok will review your application. This process can take several days to weeks.

4. Set Up Your Developer Account

Once approved:

  1. You'll receive credentials for the TikTok Ads Manager API
  2. Log in to the TikTok Ads Manager
  3. Navigate to the "Tools" section and select "TikTok Marketing API"
  4. Here you can find your App ID, App Secret, and other necessary credentials

5. Create an App

  1. In the TikTok Ads Manager, create a new app for your API integration
  2. Provide details about your app, including name, description, and intended use

6. Implement the API

Once your app is set up:

  1. Use the provided documentation to implement the TikTok Marketing API in your application
  2. Test your integration thoroughly in a sandbox environment before going live

What can you do with the TikTok Ads API?

Based on the search results provided, here is a list of data models that can be interacted with using the TikTok Ads API, along with what is possible for each:

Advertiser Data

  • Access information about advertiser accounts
  • Retrieve details like advertiser name, ID, status, etc.

Campaign Data

  • Get information about advertising campaigns
  • Access campaign details like name, objective, budget, status, etc.

Ad Group Data

  • Retrieve data on ad groups within campaigns
  • Access ad group details like name, budget, targeting, placements, etc.

Ad Data

  • Get information about individual ads
  • Access ad details like creative content, format, status, etc.

Report Data

TikTok Ads API allows accessing various performance reports:

  • Ad reports
  • Ad group reports
  • Campaign reports
  • Advertiser reports
  • Audience reports (e.g. age, gender)
  • Placement reports

Reports can include metrics like:

  • Impressions
  • Clicks
  • Conversions
  • Spend
  • CTR
  • CPC
  • etc.

Commercial Content Data

The Commercial Content API provides access to:

  • Paid ads data (publish date, last seen date, targeting info, reach)
  • Advertiser information
  • Other commercial content

User Data (via Data Portability API)

While not part of the Ads API, TikTok also offers a Data Portability API that provides:

  • User profile information
  • Post data
  • Direct messages
  • Follower/following lists
  • Video/image content

Key Points

  • Data can be accessed via API calls with proper authentication
  • Historical data sync is available (e.g. last 1 year of data)
  • Some data models have changed between API v1.2 and v1.3
  • Data is typically available at the advertiser account level

In summary, the TikTok Ads API provides comprehensive access to advertising account data, campaign performance metrics, and commercial content information. The specific data fields and models may vary slightly between API versions.