Docs

API quickstart

Four steps from sign-up to your first call. The sample below calls /v1/douyin/videos/search.

Quickstart

  1. 1Create an account. You get $0.5 of trial balance once.
  2. 2Open the console and create an API key. The full key is shown once.
  3. 3Call an endpoint with Authorization: Bearer and that key.
  4. 4Read meta.billing on the response, or open the console for the balance.
curl
curl -X POST "https://xtikapi.com/v1/douyin/videos/search" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"keyword":"city"}'

Authentication

Send Authorization: Bearer YOUR_API_KEY. Product keys start with dk_. The console shows the prefix and the last four characters after the first view.

Response

FieldMeaning
dataThe post, comment, account, or trend, in the same shape on every platform.
meta.request_idThe id to quote in support.
meta.endpointThe catalog id of the call.
meta.normalizedTrue when the fields were mapped to the shared shape.
meta.unavailableFields the platform did not send.
meta.billing.chargedTrue when this response debited the balance.
meta.billing.amountThe USD charged.
meta.billing.balanceWhat remains after the call.

Error codes

Errors are not billed. Retry the ones marked yes.

CodeHTTPRetryMeaning
unauthorized401noAPI key is missing, invalid, or revoked.
rate_limited429yesToo many requests.
invalid_params422noRequest parameters are invalid.
price_exceeds_max402noThis call costs more than X-Max-Price.
insufficient_balance402noBalance is too low for this call.
key_limit_reached402noThis API key has reached its spend limit.
idempotency_conflict409noThis Idempotency-Key was already used with different parameters.
idempotency_in_progress409yesA request with this Idempotency-Key is still running.
response_too_large409noThe response is too large to store for a safe retry.
upstream_error502yesThe data provider returned an error. You were not charged.
upstream_timeout504yesThe data provider timed out. You were not charged.
internal_error500yesSomething went wrong on our side. You were not charged.
not_found404noNo such endpoint.

X-Max-Price

Send the most you will pay for this call, in dollars. If the catalog price is higher, the call stops before the provider is contacted and nothing is billed.

Idempotency-Key

Send the same Idempotency-Key with the same parameters. For 24 hours the second call returns the stored response and is not billed again.

Rate limits

10 requests per second per key, and 20 requests per second per account. Over the limit you receive HTTP 429 and a Retry-After header. You are not billed.

Pagination

Search and list calls that accept cursor use that field for the next page. Send the cursor from the previous response. The first page can send cursor 0 when the parameter exists.

Social media API list·Social media API pricing

Questions

Where do I create an API key?

Sign up, open the console, and create a key. The full key is shown once. Later you see the prefix and the last four characters.

What does meta.billing mean?

charged says whether this response debited the balance. amount is the USD charged. balance is what remains after the call.

What are the rate limits?

10 requests per second per key, and 20 requests per second per account. Over the limit you receive HTTP 429 and a Retry-After header.