Docs
API quickstart
Four steps from sign-up to your first call. The sample below calls /v1/douyin/videos/search.
Quickstart
- 1Create an account. You get $0.5 of trial balance once.
- 2Open the console and create an API key. The full key is shown once.
- 3Call an endpoint with
Authorization: Bearerand that key. - 4Read
meta.billingon the response, or open the console for the balance.
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
| Field | Meaning |
|---|---|
data | The post, comment, account, or trend, in the same shape on every platform. |
meta.request_id | The id to quote in support. |
meta.endpoint | The catalog id of the call. |
meta.normalized | True when the fields were mapped to the shared shape. |
meta.unavailable | Fields the platform did not send. |
meta.billing.charged | True when this response debited the balance. |
meta.billing.amount | The USD charged. |
meta.billing.balance | What remains after the call. |
Error codes
Errors are not billed. Retry the ones marked yes.
| Code | HTTP | Retry | Meaning |
|---|---|---|---|
| unauthorized | 401 | no | API key is missing, invalid, or revoked. |
| rate_limited | 429 | yes | Too many requests. |
| invalid_params | 422 | no | Request parameters are invalid. |
| price_exceeds_max | 402 | no | This call costs more than X-Max-Price. |
| insufficient_balance | 402 | no | Balance is too low for this call. |
| key_limit_reached | 402 | no | This API key has reached its spend limit. |
| idempotency_conflict | 409 | no | This Idempotency-Key was already used with different parameters. |
| idempotency_in_progress | 409 | yes | A request with this Idempotency-Key is still running. |
| response_too_large | 409 | no | The response is too large to store for a safe retry. |
| upstream_error | 502 | yes | The data provider returned an error. You were not charged. |
| upstream_timeout | 504 | yes | The data provider timed out. You were not charged. |
| internal_error | 500 | yes | Something went wrong on our side. You were not charged. |
| not_found | 404 | no | No 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.