ETLMCPData Conveyance Works
Log in Start free
Guides

TikTok rate limits: code 40100, QPM and QPD waits

What TikTok's code 40100 means, how long a per-minute or per-day block lasts, the four app limit levels, and how etlmcp waits it out.

Coming This connector is coming.

When TikTok throttles a developer app, it answers with "code": 40100 in the response body. The block lasts five minutes after a per-minute (QPM) limit, and until the next UTC day after a per-day (QPD) limit, because QPD counts reset at 00:00 UTC. Limits are counted per endpoint, so a block on the reporting endpoint does not stop calls to other endpoints. A higher limit level is something the app's owner applies for, one level at a time.

The three kinds of limit

Every developer app has three counters: queries per second (QPS), per minute (QPM) and per day (QPD). Which one you hit decides how long you wait:

  • QPM: stop calling that endpoint and try again after five minutes. The page gives no separate wait for a QPS limit.
  • QPD: stop until the next day in UTC. The daily count starts again at midnight UTC, whatever the time zone of your ad accounts.

The app-level limits apply to each endpoint on its own. TikTok's example: an app that has used up its limit on /campaign/get/ can still call /ad/get/.

The four levels

Every app starts at Basic. These are the app-level limits for each level, per endpoint:

Level QPS QPM QPD
Basic 10 600 864,000
Advanced 20 1,200 1,728,000
Premium 30 1,800 2,592,000
Ultimate 50 3,000 4,320,000

The app's owner applies for a higher level from the app's page in the developer portal (My Apps, then the app, then Authorization), with a reason for the increase. TikTok raises an app one level per application: Basic to Advanced, Advanced to Premium, Premium to Ultimate. You cannot skip a level. Events API limits are the same at every level, so there is nothing to apply for there.

Some endpoints carry limits of their own on top of these, listed in a separate table on the same page. The reporting endpoint for synchronous reports, /report/integrated/get/, is not in that table, so the app-level figures above are the ones that govern it.

Asynchronous report tasks

Creating an asynchronous report task (/report/task/create/) has a fixed limit at every level. The Reporting FAQs give it as 1 QPS per app and at most 4,500 tasks per app per day; the endpoint table on the rate limits page lists 2 QPS and 60 QPM with the same 4,500 a day. If you run your own asynchronous jobs, plan for the lower figure, 1 task a second, and count your tasks against the daily 4,500.

Where etlmcp fits

When the connector is available, etlmcp reads TikTok figures only through the synchronous report endpoint, /report/integrated/get/, plus /advertiser/info/ for account details. It creates no asynchronous report tasks, so the 4,500-task cap does not apply to its pulls.

Every TikTok connection on one etlmcp server goes through the single TikTok app that server is set up with (its app id and secret). The limit level is that app's, not your ad account's: your agency's other tools, which use their own apps, draw on separate counters.

A sync calls the report endpoint at least once per window of dates and once per page of results for each ad account, so a long backfill across many advertisers makes far more calls than a routine daily sync. If you run many large backfills at once, spread them out over the day.

How etlmcp handles 40100

When the connector is available, etlmcp reads TikTok's return code before the HTTP status and treats three codes as rate limiting: 40016, 40100 and 40133. On any of them, it waits and sends the same request again within the run. Each wait is a random time up to a ceiling that doubles with each try, and for TikTok that ceiling starts higher than etlmcp's default for other platforms. If TikTok sends a Retry-After header, etlmcp waits that long instead.

Without a Retry-After header, those in-run waits add up to about two minutes at most, shorter than the five minutes TikTok asks for after a QPM limit. So a per-minute block that holds can outlast them. The run then fails with tiktok is rate limiting requests and is retried as a whole: a run gets 3 attempts, the second at least 60 seconds after the first fails and the third at least 300 seconds after the second. See retries for the rules.

A QPD block lasts until midnight UTC, longer than any retry, so the run ends as failed. Start the sync again after 00:00 UTC. You lose no days: each routine TikTok sync re-pulls the last 29 days, so a day missed inside that window comes back on the next run.

A header that is not a rate limit

Despite its name, the X-Tt-Ads-Throttle response header has nothing to do with rate limits. TikTok's Reporting FAQs say it marks a synchronous report that hit the 20,000-ad cap: only the 20,000 newest ads by creation time are processed, and of those only ads with cost data come back. etlmcp checks for that header on every report page and handles a cut-short answer on its own path, apart from rate limiting.

For the other codes TikTok returns and what each needs from you, see TikTok connector errors. For when yesterday's TikTok figures stop changing, see when TikTok data is final.

Related

Sources

  1. Rate limits — business-api.tiktok.com, checked
  2. Reporting FAQs — business-api.tiktok.com, checked