Tiktok

Keyword Search

Fetch posts for a given keyword from the Tiktok mobile app search video bar according to filter based on time and sorting. Returns a maximum of 20 posts per call (if match_exactly is true, it returns 10 posts per call). Note: the cost becomes (1 + #returned_posts) when get_author_stats is true. See the `cursor` query parameter below for information on how to fetch more posts.

API Pricing (per request): 1 unit

API usage examples

- Keyword exists:
-> 20 posts returned.
Cost: 1 unit - Keyword exists and does not have any more posts:
-> 14 posts returned.
Cost: 1 unit - Keyword exists and match_exactly parameter is True:
-> 10 posts returned.
Cost: 1 unit - Keyword exists and match_exactly parameter is True and get_author_stats is True:
-> 15 posts returned.
Cost: 16 units - Cursor is too big:
-> 0 posts returned.
Cost: 1 unit
Try the API

get/tt/keyword/search

Request

  • Base URL: https://ensembledata.com/apis
  • URL: https://ensembledata.com/apis/tt/keyword/search
  • Auth: none declared

Query parameters

namestring required

The keyword to search.

cursorinteger

Parameter to manually handle pagination. Each response contains a nextCursor which can be used to retrieve the next page of results by sending it as the next cursor. If the nextCursor is not present in the response, it means that there are no more results to retrieve.

period'0' | '1' | '7' | '30' | '90' | '180' required

An enumeration.

Only return posts more recent than the given period. The value corresponds to the number of days to filter on.

sorting'0' | '1' | '2'

An enumeration.

The posts are sorted by relevance if sorting=0, by most liked if sorting=1, most recent if sorting=2.

countrystring

Retrieve the posts as if in the specified country (US, FR, UK, DE, etc.)

match_exactlyboolean

Fetch only videos where the input keyword has to be exactly present in the video caption. If true, it returns 10 posts per request.

get_author_statsboolean

Whether to include extra statistics about the author of the post such as their following count, follower count, favoriting (likes) count etc.

tokenstring required

Private token assigned to each client to access the APIs.

Response

Successful Response

unknown required

Changes

No recorded changes to this operation across all 1 revision of this API.