Skip to content
tiktokapi.io
All endpoints

Search videos by keyword

GET/v1/video/search2 Credits / video (min 10 Credits)($0.20 / 1K videos)

Search public TikTok videos by keyword with filters for region, sort order, and publish time window. Every video item includes direct no-watermark playback links and full engagement statistics. Paginated via cursor and hasMore.

Query Parameters

  • keywordsstringrequired

    Search keywords, e.g. ai tools or skincare routine.

    Example: ai tools

  • countinteger (1 to 30)

    Number of videos to return per page (max 30).

    Example: 20

  • cursorinteger

    Pagination offset cursor (0 for first page, then pass data.cursor from the previous response).

    Example: 0

  • regionstring

    Two-letter ISO country code (US, GB, JP, DE, BR, etc.).

    Example: US

  • sort_typeinteger

    Sort order: 0 = Relevance, 1 = Most Liked, 3 = Newest.

    Example: 0

  • publish_timeinteger

    Publish window filter: 0 = All time, 1 = Yesterday, 7 = Past 7 days, 30 = Past 30 days, 90 = Past 3 months, 180 = Past 6 months.

    Example: 0

Example Request (cURL / Python / JavaScript)

curl "https://api.tiktokapi.io/v1/video/search?keywords=ai+tools" \
  -H "x-api-key: tk_your_api_key"

Live Response Preview

{
  "code": 0,
  "msg": "success",
  "processed_time": 0.15,
  "data": {}
}

Response Fields

Success (code === 0). Charged according to the endpoint credit rate.

FieldTypeSample / Notes
codeintegerExample: 0
msgstringExample: success
processed_timenumberExample: 0.15
dataobject

Status Codes

200
Success (code === 0). Charged according to the endpoint credit rate.
400
Invalid parameters, or API key placed in the URL query string (not charged).
401
Missing or invalid x-api-key header (not charged).
402
Insufficient credit balance (not charged).
403
Account disabled (not charged).
404
Unknown endpoint or disabled unstable endpoint (not charged).
405
Method not allowed — all /v1/* data endpoints use GET (not charged).
429
Rate limit exceeded (not charged). Respect the Retry-After header.
503
Temporary upstream or gateway error (not charged). Retry with exponential backoff.