Requests and responses
Every endpoint is one path under /v1, takes the same parameter names and answers in one envelope of 6 parts: code, request_id, data, page, warnings, meta.
Paths and methods
An endpoint's path is its ID with the dots turned into slashes: tiktok.videos.search is GET /v1/tiktok/videos/search. A read is a GET with its parameters in the query. A request that carries ids or keywords is a POST with a JSON body, so an endpoint that takes one object or a batch accepts both.
curl -G "https://api.dataxapi.com/v1/tiktok/videos/search" \ --data-urlencode "query=space station" \ -H "Authorization: Bearer $DATAXAPI_API_KEY"
Parameters and headers
A name means the same thing on every endpoint, and each endpoint's page lists the ones it takes. A parameter the endpoint does not take is rejected with 400 invalid_params; nothing runs and nothing is charged.
Search terms
ID of the first resource in the path
Link to the object, instead of its ID
Account handle, instead of its ID
Several IDs in one request
Several terms in one request
Sort order: relevance, latest, popular; each endpoint lists the ones it takes
Published at or after
Published at or before
Published within the last period: day, week, month, half_year, year; each endpoint lists the ones it takes
Statistics period: 24h, 7d, 30d, 90d; each endpoint lists the ones it takes
Which board
Content format
Tab as shown on the platform
Language code
Country or region code
Cursor returned by the previous page
Items per page
How much of each item to return: compact, standard, full
Return only these fields
Extra parts to return alongside
Request headers
Bearer and your key: see Authentication.
Makes a call repeatable without a second charge: see Billing.
The most this call may be charged, in US dollars as a decimal string. A call that could cost more is refused before it runs.
A label of yours for where the call comes from (a product, a task).
A label of yours for which of your own users the call is for.
The two labels are 1 to 128 visible ASCII characters without spaces. They are only recorded for the usage figures; do not put an email address or a phone number in them.
The envelope
codetextok on a success; on an error, the error's code.request_idtextThis call's ID, also in the response header X-Request-Id.data.itemobjectOne object, on an endpoint that returns one.data.itemslistThe objects, on a list or a batch. One of item and items, never both.data.missinglistA batch only: the inputs that were not found, each with a reason.page.next_cursortext or nullPass as cursor for the next page; null when there is none.page.cursor_expires_attimeUntil when that cursor can be used.page.has_moreyes/noWhether there is a next page.page.returnedintegerHow many items this page holds.warningslistWhat was left out and why, each with a code: items_dropped, items_not_requested, fields_unparsed, text_truncated.meta.capabilitytextThe endpoint's ID.meta.result_statustextcomplete, partial (a batch with inputs not found) or empty.meta.fetched_attimeWhen the data was fetched from the platform.meta.cachedyes/noThe data is from a shared snapshot (boards and trends).meta.replayedyes/noThis is the saved result of an earlier call: nothing was added to the bill.meta.unavailableobjectThe fields this endpoint cannot give, each with the reason.meta.billingobjectamount, currency and balance_after.An error has a structure of its own, the same on every endpoint: see Error codes.
When a field has no value
null.meta.unavailable with the reason.view.warnings.Views and formats
The most used fields; long links (avatars, covers) left out, long text cut to 500 characters and named in warnings.
The default: every standard field.
Adds the platform's own fields (ext) and media addresses that expire.
All three views cost the same.
- Times are ISO 8601 in UTC.
- Amounts of money are decimal strings in US dollars.
- IDs are always strings.
- The fields of each object are on its page, for example post; the whole interface is in openapi.json.
Read a result again
A result is kept for 24 hours and can be read again by its request ID at no charge, in any view. The route takes only view and fields; the answer is that call's envelope with meta.replayed true and an amount of 0.
curl -G "https://api.dataxapi.com/v1/calls/{request_id}/result" \ --data-urlencode "view=full" \ -H "Authorization: Bearer $DATAXAPI_API_KEY"