{
  "openapi": "3.1.0",
  "info": {
    "title": "TikTok API",
    "version": "1.0.0",
    "description": "A TikTok scraper API for public TikTok data: account profiles with exact follower and like counts, the videos an account has posted, one video in full, keyword search, hashtag listings and video comments — as structured JSON, with cursor paging and a free URL parser."
  },
  "servers": [
    {
      "url": "https://api.fetchlayer.dev/tiktok"
    }
  ],
  "security": [
    {
      "BearerAuth": []
    }
  ],
  "components": {
    "schemas": {
      "Error": {
        "type": "object",
        "description": "Every error, on every route. Branch on code and retryable rather than on the text; on a 5xx the text is generic. MCP tool errors carry the same fields in structuredContent, and as a JSON text block.",
        "properties": {
          "error": {
            "type": "string",
            "description": "What went wrong, in words. For a 400, what to change."
          },
          "status": {
            "type": "integer",
            "description": "The HTTP status, repeated in the body."
          },
          "code": {
            "type": "string",
            "description": "The kind of error, stable: invalid_input, unauthorized, insufficient_credits, forbidden, not_found, expired, quota_exceeded, cancelled, time_limit, temporarily_unavailable, posts_unavailable, store_unreachable, upstream_error, internal_error, tool_error. A platform may add its own; more may be added. Treat a code you do not recognise by its retryable flag."
          },
          "retryable": {
            "type": "boolean",
            "description": "Whether asking again can succeed."
          },
          "requestId": {
            "type": "string",
            "description": "This request’s id, also sent as the X-Request-Id header. Quote it when reporting a problem."
          },
          "missing": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "With invalid_input when the request's parameters are refused before anything is fetched: the parameters that were missing. Always present on those errors, empty when nothing was missing."
          }
        },
        "required": [
          "error",
          "code",
          "retryable",
          "requestId"
        ]
      }
    },
    "securitySchemes": {
      "BearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "API Key",
        "description": "Send your FetchLayer key as Authorization: Bearer ss-your-key."
      }
    }
  },
  "paths": {
    "/user-profile": {
      "post": {
        "operationId": "user-profile",
        "tags": [
          "Accounts"
        ],
        "summary": "Get a TikTok account profile",
        "description": "One public TikTok account’s profile: bio, avatar, verification, creation date, bio link and the exact follower, following, like and video counts. Name the account by username, userId or secUid.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "username": {
                    "type": "string",
                    "description": "A username with or without the leading @, or a profile URL. Send exactly one of username, userId or secUid; none, or more than one, is a 400."
                  },
                  "userId": {
                    "type": "string",
                    "description": "The account’s numeric id, as a string (the `id` a profile returns). An alternative to username that survives a rename."
                  },
                  "secUid": {
                    "type": "string",
                    "description": "The account’s secUid, as a profile returns it. An alternative to username."
                  },
                  "format": {
                    "type": "string",
                    "description": "json or markdown, in any case; any other value is a 400. Over MCP, markdown returns the result rendered as text; the REST API accepts it and returns JSON.",
                    "example": "json"
                  },
                  "timeoutMs": {
                    "type": "integer",
                    "description": "Time limit for the whole request, in milliseconds (1000–120000); a value outside that range is a 400. When it runs out, a paged request returns what it has with nextCursor, billed for the pages it returned; a request with nothing to return yet fails with a 503 you can retry, marked with the response header X-Timeout-Source: caller. Left out, the request runs as long as it needs."
                  }
                },
                "additionalProperties": false
              },
              "examples": {
                "default": {
                  "value": {
                    "username": "@nasa"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "transport": {
                      "type": "string",
                      "description": "The data source: always the platform id, \"tiktok\"."
                    },
                    "notes": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "Caveats you can act on — a private account, comments turned off, a list that ran out early, paging that has gone as deep as it goes. Empty when there are none. An empty result always comes with a note explaining it, never as an unexplained empty array."
                    },
                    "pagesFetched": {
                      "type": "number",
                      "description": "Pages of results fetched, which is what the request costs: one credit per page. resolve-url reports 0 and is not billed."
                    },
                    "profile": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "description": "TikTok’s numeric account id."
                        },
                        "uniqueId": {
                          "type": "string",
                          "description": "The @handle, without the @."
                        },
                        "nickname": {
                          "type": "string",
                          "description": "The display name."
                        },
                        "url": {
                          "type": "string",
                          "description": "Canonical profile URL."
                        },
                        "signature": {
                          "type": "string",
                          "description": "The bio text."
                        },
                        "avatarUrl": {
                          "type": "string",
                          "description": "Avatar image. Pass it to GET /media to re-fetch it after TikTok’s own signed link expires."
                        },
                        "verified": {
                          "type": "boolean",
                          "description": "Whether TikTok shows the verification badge."
                        },
                        "privateAccount": {
                          "type": "boolean",
                          "description": "Whether the account is private. Its profile still comes back; its posts are not, and user-videos answers with the note \"This account is private, so its posts are not public.\""
                        },
                        "createdAt": {
                          "type": "string",
                          "description": "When the account was created, or null."
                        },
                        "region": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "The account’s registered country or region, as a two-letter code such as \"US\" — the same fact accountRegion reports on each video. The first request for an account answers at once with null and the note “`region` is being worked out for this account; ask again shortly.”; later requests carry it, and it is kept for 90 days. It stays null for a private account or one with no public videos, with the note “This account is private or has no public videos, so `region` is null.” To have it at once, read accountRegion off a video with include [\"exactStats\"]. Not postingRegion, which is where the account’s recent videos were posted (the two can differ), and not a video’s createdRegion, where that one post was made."
                        },
                        "isOrganization": {
                          "type": "boolean",
                          "description": "Whether TikTok marks the account as an organization."
                        },
                        "bioLink": {
                          "type": "string",
                          "description": "The link in the bio, or null."
                        },
                        "secUid": {
                          "type": "string",
                          "description": "TikTok’s opaque secondary account id."
                        },
                        "stats": {
                          "type": "object",
                          "properties": {
                            "followerCount": {
                              "type": "number",
                              "description": "Followers — the exact figure, not the rounded one. Counts are as TikTok shows them to US viewers. TikTok keeps two US copies of an account’s counts, which can differ by about one post and a few hundred followers; successive requests can land on either, and neither is newer."
                            },
                            "followingCount": {
                              "type": "number",
                              "description": "Accounts this one follows."
                            },
                            "heartCount": {
                              "type": "number",
                              "description": "Total likes across the account’s videos."
                            },
                            "videoCount": {
                              "type": "number",
                              "description": "Public videos posted."
                            },
                            "friendCount": {
                              "type": "number",
                              "description": "Mutual follows."
                            }
                          },
                          "additionalProperties": false
                        },
                        "roundedStats": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "description": "Which profile counts are rounded. Normally empty: profile counts are the exact figures, not the rounded ones shown on the page (1719888, not 1.7M)."
                        },
                        "postingRegion": {
                          "type": "object",
                          "additionalProperties": true,
                          "description": "Where the account’s recent videos were posted, or null. Not a registered country. It is kept for 30 days per account and worked out again on the first request after that; on that request, and on the very first, it is null with the note \"`postingRegion` is being worked out from where this account's recent videos were posted; ask again shortly.\", and filled about 10–25 seconds later. It is also null, with a note saying why, for a private account, an account with no public videos, or one whose recent videos do not say where they were posted.",
                          "properties": {
                            "code": {
                              "type": "string",
                              "description": "The most common region, such as \"US\", across the videos checked; a tie goes to the region of the newest video."
                            },
                            "basis": {
                              "type": "string",
                              "description": "Always \"recent_videos\": the account’s 10 most recent videos, 20 when those disagree."
                            },
                            "videosSampled": {
                              "type": "number",
                              "description": "How many videos were checked."
                            },
                            "videosWithRegion": {
                              "type": "number",
                              "description": "How many of those say where they were posted."
                            },
                            "share": {
                              "type": "number",
                              "description": "The count for code divided by videosWithRegion, 0 to 1. A low share means the account posts from several regions."
                            },
                            "computedAt": {
                              "type": "string",
                              "description": "When it was worked out (ISO 8601)."
                            }
                          }
                        }
                      },
                      "additionalProperties": false
                    }
                  },
                  "additionalProperties": false
                },
                "examples": {
                  "default": {
                    "value": {
                      "transport": "tiktok",
                      "notes": [],
                      "pagesFetched": 1,
                      "profile": {
                        "id": "7664638705177150477",
                        "uniqueId": "nasa",
                        "nickname": "NASA",
                        "url": "https://www.tiktok.com/@nasa",
                        "signature": "Making the seemingly impossible, possible.✨",
                        "avatarUrl": "https://p19-common-sign.tiktokcdn-us.com/tos-useast5-avt-0068-tx/...",
                        "verified": true,
                        "privateAccount": false,
                        "createdAt": "2026-07-20T15:55:49.000Z",
                        "region": "US",
                        "isOrganization": true,
                        "bioLink": null,
                        "secUid": "MS4wLjABAAAAU9BRVzC8oCaegVnia8IbqWhPb_-dbU7s00Y3wS1_Nx8g5RUaYvyXrpejgjdxTwd6",
                        "stats": {
                          "followerCount": 1719888,
                          "followingCount": 23,
                          "heartCount": 8962614,
                          "videoCount": 45,
                          "friendCount": 17
                        },
                        "roundedStats": [],
                        "postingRegion": {
                          "code": "US",
                          "basis": "recent_videos",
                          "videosSampled": 20,
                          "videosWithRegion": 20,
                          "share": 0.95,
                          "computedAt": "2026-10-14T10:16:54.310Z"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "invalid_input: the request needs fixing; error names the field.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized: the API key is missing or not valid.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "insufficient_credits: no credits, trial or monthly allowance left.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "forbidden: this key or account is not allowed this request.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "quota_exceeded: a request-rate limit was reached.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "temporarily_unavailable, time_limit or (on a store route) store_unreachable: ask again (with time_limit, allow more time). Retryable.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/user-videos": {
      "post": {
        "operationId": "user-videos",
        "tags": [
          "Accounts"
        ],
        "summary": "List an account’s videos",
        "description": "The videos a public TikTok account has posted — latest, most popular or oldest first — with the account’s profile alongside. Name the account by username, userId or secUid. Paged: up to 35 videos a page, 1 credit per page fetched.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "username": {
                    "type": "string",
                    "description": "A username with or without the leading @, or a profile URL. Send exactly one of username, userId or secUid; none, or more than one, is a 400."
                  },
                  "userId": {
                    "type": "string",
                    "description": "The account’s numeric id, as a string (the `id` a profile returns). An alternative to username that survives a rename."
                  },
                  "secUid": {
                    "type": "string",
                    "description": "The account’s secUid, as a profile returns it. An alternative to username."
                  },
                  "limit": {
                    "type": "integer",
                    "description": "Maximum videos returned, up to 500. Use -1 for the maximum. TikTok serves an account’s videos at most 35 to a page, so a limit above 35 needs pages of 2 or more.",
                    "example": "30"
                  },
                  "include": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Pass [\"createdRegion\"] to fill each video’s createdRegion in the same request, which is otherwise null on this route. It adds a few seconds. Without timeoutMs the filling stops about 20 seconds after the request starts; with timeoutMs the response always comes within your limit. A video not filled in time keeps null, and a note gives the count — asking again fills the rest. Pass [\"exactStats\"] (alone or with createdRegion) to fill every video on the page with exactStats, isAdsNative, brandedContentType and accountRegion, as on video-detail; a page of 30 videos adds a few seconds, at no extra cost. With both createdRegion and exactStats, use timeoutMs of 30000 or more. complete and missing say which videos were left without a field asked for, and why."
                  },
                  "sort": {
                    "type": "string",
                    "description": "Order the account's videos: latest, popular, oldest.",
                    "example": "latest"
                  },
                  "pages": {
                    "type": "integer",
                    "description": "Pages of results to return in one request, up to 20. Use -1 for the maximum. Each page fetched is 1 credit, and the response reports how many as pagesFetched. A limit larger than one page needs more pages: with pages: 1 the response holds one page, a nextCursor and a note saying the pages limit was reached. When leaving out videos already returned would bring a response short of limit, it takes one more page to fill it; that page shows in pagesFetched, so a request can cost one credit more than the pages asked for.",
                    "example": "1"
                  },
                  "cursor": {
                    "type": "string",
                    "description": "Continue from a previous response’s nextCursor, passed back unchanged with the same request. A cursor continues only the route, and the account and sort, hashtag, search term or video, it came from; a cursor from anywhere else, or one this service did not return, is a 400. Bare numeric cursors from before still work, except on search-videos, where one is a 400 asking you to repeat the search."
                  },
                  "format": {
                    "type": "string",
                    "description": "json or markdown, in any case; any other value is a 400. Over MCP, markdown returns the result rendered as text; the REST API accepts it and returns JSON.",
                    "example": "json"
                  },
                  "timeoutMs": {
                    "type": "integer",
                    "description": "Time limit for the whole request, in milliseconds (1000–120000); a value outside that range is a 400. When it runs out, a paged request returns what it has with nextCursor, billed for the pages it returned; a request with nothing to return yet fails with a 503 you can retry, marked with the response header X-Timeout-Source: caller. Left out, the request runs as long as it needs."
                  }
                },
                "additionalProperties": false
              },
              "examples": {
                "default": {
                  "value": {
                    "username": "@nasa",
                    "limit": 30,
                    "sort": "latest"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "transport": {
                      "type": "string",
                      "description": "The data source: always the platform id, \"tiktok\"."
                    },
                    "notes": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "Caveats you can act on — a private account, comments turned off, a list that ran out early, paging that has gone as deep as it goes. Empty when there are none. An empty result always comes with a note explaining it, never as an unexplained empty array."
                    },
                    "pagesFetched": {
                      "type": "number",
                      "description": "Pages of results fetched, which is what the request costs: one credit per page. resolve-url reports 0 and is not billed."
                    },
                    "profile": {
                      "type": "object",
                      "additionalProperties": true,
                      "description": "The account’s profile: exactly what user-profile returns for it."
                    },
                    "sort": {
                      "type": "string",
                      "description": "The order the videos came back in."
                    },
                    "videos": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": true,
                        "properties": {
                          "id": {
                            "type": "string",
                            "description": "Numeric video id, which video-detail and comments both accept."
                          },
                          "url": {
                            "type": "string",
                            "description": "Canonical link to the video. This is what you use to open or embed it."
                          },
                          "description": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "The caption, or null when there is none."
                          },
                          "createdAt": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "ISO 8601 timestamp of when it was posted, or null."
                          },
                          "durationSeconds": {
                            "type": [
                              "number",
                              "null"
                            ],
                            "description": "Length in seconds, or null."
                          },
                          "isPhotoPost": {
                            "type": "boolean",
                            "description": "True for a photo carousel rather than a clip."
                          },
                          "coverUrl": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "The cover frame. An image, so it re-fetches through GET /media normally."
                          },
                          "assets": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "additionalProperties": true,
                              "properties": {
                                "downloadUrl": {
                                  "type": [
                                    "string",
                                    "null"
                                  ],
                                  "description": "A https://api.fetchlayer.dev/tiktok/media link that keeps working after TikTok’s own link expires. On a video asset it is ?video=<id> and delivers the video as an MP4 without the TikTok watermark; it is null when the creator has turned off downloads. On an image asset it is ?url=… and delivers the image. Each request to it costs 1 credit."
                                }
                              }
                            },
                            "description": "An ordered list, so a clip and a carousel are handled the same way: a clip yields one asset of kind \"video\", a carousel one of kind \"image\" per frame. Each carries url, width, height and downloadUrl. A video asset’s url is TikTok’s own link, which expires within hours and does not open on its own; use downloadUrl. Every post has a video or images, so an empty list means its media could not be read this time: on a request with include, the video then lists assets in missingFields and the page has complete false with a missing entry {field: \"assets\", reason: \"failed\", count}."
                          },
                          "stats": {
                            "type": "object",
                            "additionalProperties": true,
                            "description": "playCount, diggCount, commentCount, shareCount, collectCount and repostCount. A null counter means TikTok did not publish that figure; a real zero comes back as 0. Views, likes, comments and shares are rounded once they reach 10,000 — roundedStats says which. Counts are as TikTok shows them to US viewers. TikTok keeps a copy of the counts for each region, and the copies differ by a few units, so successive requests can differ slightly."
                          },
                          "roundedStats": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            },
                            "description": "Which counters in stats TikTok publishes only rounded: to the nearest 100 from 10,000, the nearest 100,000 from 1M, the nearest 100M from 1B. Empty means every counter is exact. Saves (collectCount) are always exact."
                          },
                          "author": {
                            "type": "object",
                            "additionalProperties": true,
                            "description": "id, uniqueId, nickname, avatarUrl, signature, verified, privateAccount, profileUrl and secUid."
                          },
                          "music": {
                            "type": [
                              "object",
                              "null"
                            ],
                            "additionalProperties": true,
                            "description": "id, title, authorName, durationSeconds, original, coverUrl, playUrl and url, or null."
                          },
                          "hashtags": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            },
                            "description": "Without the #, as TikTok tags them on the post rather than parsed out of the caption."
                          },
                          "mentions": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            },
                            "description": "Usernames without the @."
                          },
                          "mentionedUsers": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "additionalProperties": true,
                              "properties": {
                                "unresolved": {
                                  "type": [
                                    "string",
                                    "null"
                                  ],
                                  "description": "null when the tag leads to an account. \"account_unavailable\" when TikTok names the account’s userId but no longer publishes its username or secUid — the account was deleted, banned or is otherwise unavailable; userId, text, start and end still come back, for example {\"username\": null, \"userId\": \"6794638798661157893\", \"secUid\": null, \"text\": \"@Weight Watchers\", \"start\": 17, \"end\": 33, \"unresolved\": \"account_unavailable\"}. \"not_published\" when TikTok published no account id for the tag."
                                },
                                "text": {
                                  "type": [
                                    "string",
                                    "null"
                                  ],
                                  "description": "The tag as the caption shows it, including the @. Often the display name rather than the username: \"@E.L.F Cosmetics\" tags eyeslipsfacecosmetics. Use username, userId or secUid to identify the account."
                                },
                                "start": {
                                  "type": [
                                    "number",
                                    "null"
                                  ],
                                  "description": "Where the tag starts in description; end is where it stops, exclusive. Both count UTF-16 code units, so description.slice(start, end) equals text in JavaScript; in Python, slice the UTF-16 encoding."
                                }
                              }
                            },
                            "description": "Every account tagged in the caption, in caption order: username, userId (an exact string), secUid, text, start, end and unresolved, each null when TikTok published no value — so username and secUid can be null."
                          },
                          "hashtagDetails": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "additionalProperties": true
                            },
                            "description": "Every hashtag in the caption, with id (or null), name without the #, text with it, and start and end counted like mentionedUsers."
                          },
                          "isAd": {
                            "type": [
                              "boolean",
                              "null"
                            ],
                            "description": "TikTok’s own isAd value: true when TikTok runs or has run the post as a promoted ad, null when TikTok sends no value. Not the creator’s own #ad disclosure. The three flags combine freely: a post can be an ad and a paid partnership, or a partnership that is also shoppable."
                          },
                          "isPaidPartnership": {
                            "type": "boolean",
                            "description": "True when the post carries TikTok’s paid-partnership label, which is exactly when commercialSignals.adLabelVersion is 2. False when it is unmarked."
                          },
                          "isShoppable": {
                            "type": "boolean",
                            "description": "True for a shop or product video: commercialSignals.isECVideo is above 0, or the post carries TikTok’s e-commerce link type 33. False when it is unmarked."
                          },
                          "commercialSignals": {
                            "type": "object",
                            "additionalProperties": true,
                            "description": "TikTok’s own values behind isPaidPartnership and isShoppable, exactly as TikTok publishes them, for callers who want the numbers. null means TikTok sent no value for the post. TikTok does not publish an ad-type or branded-content code beyond these.",
                            "properties": {
                              "adLabelVersion": {
                                "type": [
                                  "number",
                                  "null"
                                ],
                                "description": "TikTok’s ad-label value, or null. 2 is its paid-partnership label, and isPaidPartnership is true exactly when this is 2."
                              },
                              "brandOrganicType": {
                                "type": [
                                  "number",
                                  "null"
                                ],
                                "description": "TikTok’s own branded/organic code, such as 1001, or null. TikTok does not explain what the codes mean, and 1001 appears on ads, partnership posts and some unmarked posts alike, so treat it as informational, not as a flag."
                              },
                              "isECVideo": {
                                "type": [
                                  "number",
                                  "null"
                                ],
                                "description": "Above 0 (seen: 1) when TikTok marks the post as a shop or product video; null when TikTok sends no value."
                              },
                              "adAuthorization": {
                                "type": [
                                  "boolean",
                                  "null"
                                ],
                                "description": "True when the creator allowed the post to be used in ads, or null. Not a sign that it is running as an ad."
                              },
                              "anchorTypes": {
                                "type": "array",
                                "items": {
                                  "type": "number"
                                },
                                "description": "TikTok’s type codes for the links attached to the post: 35 a product link (always with isECVideo 1), 54 an editing-app link, 28 an effect link. Other codes are passed through as TikTok sends them. Empty when no links are attached."
                              }
                            }
                          },
                          "createdRegion": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "The two-letter region TikTok records this post as created in, such as \"US\". Filled on video-detail; on user-videos, search-videos and hashtag-videos it is null unless the request has include: [\"createdRegion\"]. Not the account’s region."
                          },
                          "language": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "The language TikTok assigned to the caption, or null."
                          },
                          "exactStats": {
                            "type": [
                              "object",
                              "null"
                            ],
                            "additionalProperties": true,
                            "description": "Only with include [\"exactStats\"]: the exact counts — playCount, diggCount, commentCount, shareCount and collectCount — as whole numbers, never rounded, where stats rounds from 10,000 up. null, with a note, when they could not be filled. Exact counts are filled for nearly all posts — about 19 in 20 resolve, most on the first ask. The rest come back null with a note; asking again later can fill them. A miss is a normal 200, not an error: the video comes back in full with its usual stats (six counts, including repostCount) and roundedStats, and exactStats, isAdsNative, brandedContentType and accountRegion are present and null, with a note — so check exactStats === null rather than the HTTP status. exactStats has five counts; it has no repostCount. On a list, a page can be partly filled: a note gives how many videos are null, and video-detail can fill those one at a time. The notes read, verbatim: “The exact counts could not be found for this video, so exactStats and accountRegion are null; ask again shortly.”; when your timeoutMs ran out first, “The exact counts could not be filled in time, so exactStats and accountRegion are null; ask again, or allow more time.”; on a list, “The exact counts could not be filled for N of these M videos in time, so exactStats is null for them; ask again or use video-detail for those videos.”; and when only the region is missing, “The exact counts were filled, but this account’s registered region did not come with them, so accountRegion is null.”",
                            "properties": {
                              "playCount": {
                                "type": "integer",
                                "description": "Exact views."
                              },
                              "diggCount": {
                                "type": "integer",
                                "description": "Exact likes."
                              },
                              "commentCount": {
                                "type": "integer",
                                "description": "Exact comments."
                              },
                              "shareCount": {
                                "type": "integer",
                                "description": "Exact shares."
                              },
                              "collectCount": {
                                "type": "integer",
                                "description": "Exact saves."
                              }
                            }
                          },
                          "isAdsNative": {
                            "type": [
                              "boolean",
                              "null"
                            ],
                            "description": "Only with include [\"exactStats\"]: TikTok’s own ad marker for the post. true is rare; false and null are what nearly every post carries."
                          },
                          "brandedContentType": {
                            "type": [
                              "integer",
                              "null"
                            ],
                            "description": "Only with include [\"exactStats\"]: TikTok’s numeric branded-content type — 0 none, 1 paid partnership, 7 commission; other codes come through as TikTok sends them (4 has been seen). null when not filled."
                          },
                          "accountRegion": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Only with include [\"exactStats\"]: the two-letter region TikTok records the account as registered in, such as \"US\" — the account’s own country. Not where this post was made (createdRegion), and not where the account’s recent videos were posted (postingRegion on user-profile); the three can differ. null, with a note, when no region came with the exact counts, so exactStats can be filled while this is null."
                          },
                          "missingFields": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            },
                            "description": "Only on a request with include: the fields asked for (exactStats, accountRegion, createdRegion) that this video was left without, and assets when its media could not be read (its assets list is then empty); empty when it has them all. A field TikTok does not publish for the post, such as a post with no recorded created-in region, is not listed."
                          }
                        }
                      },
                      "description": "The videos, in the requested order. Empty for a private account, with the note \"This account is private, so its posts are not public.\", and for an account with no public posts, with the note \"This account has no public posts.\" When TikTok is not showing the account’s posts publicly right now, the answer is a 403 with code posts_unavailable and retryable false (\"TikTok is not showing this account’s posts publicly right now.\"): asking again at once returns the same answer, and nothing is charged. A 503 on this route comes only after repeated attempts, so wait before retrying."
                    },
                    "complete": {
                      "type": "boolean",
                      "description": "Only on a request with include: true when every video has every field asked for. A 200 with complete false still carries every video: count it as a delivered response with fields to ask for again, not as a failure."
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": true,
                        "properties": {
                          "field": {
                            "type": "string",
                            "description": "exactStats, accountRegion, createdRegion or assets. assets counts the videos whose media could not be read, so their assets list is empty; ask again for them. exactStats missing means isAdsNative, brandedContentType and accountRegion are null too; accountRegion on its own means the exact counts filled and only the account’s region did not come with them."
                          },
                          "count": {
                            "type": "integer",
                            "description": "How many videos were left without that field, for that reason."
                          },
                          "reason": {
                            "type": "string",
                            "description": "time_limit: the time limit ran out before it was filled (your timeoutMs, or the default when you set none); ask again, or allow more time. not_found: it was looked up and not found this time; ask again later. failed: the lookup failed; ask again. unavailable: not offered on this request. New reasons may be added, so treat an unknown one as “not filled”. createdRegion is only ever time_limit or failed; accountRegion is only ever not_found; assets is only ever failed; exactStats can carry any of the four."
                          }
                        }
                      },
                      "description": "Only on a request with include: one entry per field and reason, as {field, count, reason}, counting the videos left without it; empty when complete."
                    },
                    "videoCount": {
                      "type": "number",
                      "description": "How many videos are in this response."
                    },
                    "hasMore": {
                      "type": "boolean",
                      "description": "Whether more results exist beyond what was returned."
                    },
                    "nextCursor": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "An opaque token (tt1.…) to pass back unchanged as cursor, with the same request, to continue exactly where this response stopped. Continuing never repeats or skips a video: with sort latest on user-videos, every video comes back once, newest first. With sort popular, on search and on hashtags the same holds at each boundary, but TikTok can re-rank between requests, so keep the ids you have if every video exactly once across a long walk matters. null when there is nothing further."
                    }
                  },
                  "additionalProperties": false
                },
                "examples": {
                  "default": {
                    "value": {
                      "transport": "tiktok",
                      "notes": [],
                      "pagesFetched": 1,
                      "profile": {
                        "id": "7664638705177150477",
                        "uniqueId": "nasa",
                        "nickname": "NASA",
                        "url": "https://www.tiktok.com/@nasa",
                        "signature": "Making the seemingly impossible, possible.✨",
                        "avatarUrl": "https://p19-common-sign.tiktokcdn-us.com/tos-useast5-avt-0068-tx/...",
                        "verified": true,
                        "privateAccount": false,
                        "createdAt": "2026-07-20T15:55:49.000Z",
                        "region": "US",
                        "isOrganization": true,
                        "bioLink": null,
                        "secUid": "MS4wLjABAAAAU9BRVzC8oCaegVnia8IbqWhPb_-dbU7s00Y3wS1_Nx8g5RUaYvyXrpejgjdxTwd6",
                        "stats": {
                          "followerCount": 1719888,
                          "followingCount": 23,
                          "heartCount": 8962614,
                          "videoCount": 45,
                          "friendCount": 17
                        },
                        "roundedStats": [],
                        "postingRegion": {
                          "code": "US",
                          "basis": "recent_videos",
                          "videosSampled": 20,
                          "videosWithRegion": 20,
                          "share": 0.95,
                          "computedAt": "2026-10-14T10:16:54.310Z"
                        }
                      },
                      "sort": "latest",
                      "videos": [
                        {
                          "id": "7686148096895569165",
                          "url": "https://www.tiktok.com/@nasa/video/7686148096895569165",
                          "description": "Turns out you can dance in space! 🪩🕺💫🛰️ Microgravity just unlocked some new moves.",
                          "createdAt": "2026-09-16T15:00:41.000Z",
                          "durationSeconds": 58,
                          "isPhotoPost": false,
                          "coverUrl": "https://p19-common-sign.tiktokcdn-us.com/tos-useast5-p-0068-tx/...",
                          "assets": [
                            {
                              "kind": "video",
                              "url": "https://v16-webapp-prime.us.tiktok.com/video/tos/useast5/...",
                              "width": 720,
                              "height": 1280,
                              "downloadUrl": "https://api.fetchlayer.dev/tiktok/media?video=7686148096895569165"
                            }
                          ],
                          "stats": {
                            "playCount": 27600,
                            "diggCount": 4367,
                            "commentCount": 173,
                            "shareCount": 104,
                            "collectCount": 273,
                            "repostCount": 0
                          },
                          "roundedStats": [
                            "playCount"
                          ],
                          "author": {
                            "id": "7664638705177150477",
                            "uniqueId": "nasa",
                            "nickname": "NASA",
                            "verified": true,
                            "privateAccount": false,
                            "profileUrl": "https://www.tiktok.com/@nasa"
                          },
                          "music": {
                            "id": "7686148224364694286",
                            "title": "original sound - NASA",
                            "authorName": "NASA",
                            "durationSeconds": 58,
                            "original": false,
                            "url": "https://www.tiktok.com/music/x-7686148224364694286"
                          },
                          "hashtags": [],
                          "mentions": [],
                          "mentionedUsers": [],
                          "hashtagDetails": [],
                          "isAd": false,
                          "language": "en",
                          "isPaidPartnership": false,
                          "isShoppable": false,
                          "commercialSignals": {
                            "adLabelVersion": null,
                            "brandOrganicType": null,
                            "isECVideo": null,
                            "adAuthorization": null,
                            "anchorTypes": []
                          },
                          "createdRegion": null
                        }
                      ],
                      "videoCount": 30,
                      "hasMore": true,
                      "nextCursor": "tt1.eyJyIjoidXYiLCJrIjoibmFzYSIsImMiOiIxNzg5MzMwMzUwNDQzIn0"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "invalid_input: the request needs fixing; error names the field.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized: the API key is missing or not valid.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "insufficient_credits: no credits, trial or monthly allowance left.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "forbidden: this key or account is not allowed this request.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "quota_exceeded: a request-rate limit was reached.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "temporarily_unavailable, time_limit or (on a store route) store_unreachable: ask again (with time_limit, allow more time). Retryable.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/video-detail": {
      "post": {
        "operationId": "video-detail",
        "tags": [
          "Videos"
        ],
        "summary": "Get one video in full",
        "description": "One TikTok video in full by id or URL, in the same shape every route returns videos in, plus createdRegion, the region it was posted from. include [\"exactStats\"] adds the exact counts behind the rounded ones. A short share link is a 400: open it, or pass it to resolve-url, first.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "video": {
                    "type": "string",
                    "description": "A video URL or a numeric video id. Shortened share links are rejected — resolve them first."
                  },
                  "include": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Pass [\"exactStats\"] to also get the exact counts behind the rounded ones — views, likes, comments, shares and saves as whole numbers in exactStats (a video showing playCount 7,900,000 has exactStats.playCount 7,856,927, say) — plus isAdsNative, brandedContentType and accountRegion. It adds about 2 to 5 seconds when the counts are filled, and up to about 25 seconds in the rare case they cannot be; it costs nothing extra, and without it the response is unchanged. Exact counts are filled for nearly all posts — about 19 in 20 resolve, most on the first ask. The rest come back null with a note; asking again later can fill them. Any other value is a 400."
                  },
                  "format": {
                    "type": "string",
                    "description": "json or markdown, in any case; any other value is a 400. Over MCP, markdown returns the result rendered as text; the REST API accepts it and returns JSON.",
                    "example": "json"
                  },
                  "timeoutMs": {
                    "type": "integer",
                    "description": "Time limit for the whole request, in milliseconds (1000–120000); a value outside that range is a 400. When it runs out, a paged request returns what it has with nextCursor, billed for the pages it returned; a request with nothing to return yet fails with a 503 you can retry, marked with the response header X-Timeout-Source: caller. Left out, the request runs as long as it needs."
                  }
                },
                "additionalProperties": false,
                "required": [
                  "video"
                ]
              },
              "examples": {
                "default": {
                  "value": {
                    "video": "https://www.tiktok.com/@nasa/video/7686148096895569165"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "transport": {
                      "type": "string",
                      "description": "The data source: always the platform id, \"tiktok\"."
                    },
                    "notes": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "Caveats you can act on — a private account, comments turned off, a list that ran out early, paging that has gone as deep as it goes. Empty when there are none. An empty result always comes with a note explaining it, never as an unexplained empty array."
                    },
                    "pagesFetched": {
                      "type": "number",
                      "description": "Pages of results fetched, which is what the request costs: one credit per page. resolve-url reports 0 and is not billed."
                    },
                    "video": {
                      "type": "object",
                      "additionalProperties": true,
                      "description": "The video, in the shape below.",
                      "properties": {
                        "id": {
                          "type": "string",
                          "description": "Numeric video id, which video-detail and comments both accept."
                        },
                        "url": {
                          "type": "string",
                          "description": "Canonical link to the video. This is what you use to open or embed it."
                        },
                        "description": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "The caption, or null when there is none."
                        },
                        "createdAt": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "ISO 8601 timestamp of when it was posted, or null."
                        },
                        "durationSeconds": {
                          "type": [
                            "number",
                            "null"
                          ],
                          "description": "Length in seconds, or null."
                        },
                        "isPhotoPost": {
                          "type": "boolean",
                          "description": "True for a photo carousel rather than a clip."
                        },
                        "coverUrl": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "The cover frame. An image, so it re-fetches through GET /media normally."
                        },
                        "assets": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "additionalProperties": true,
                            "properties": {
                              "downloadUrl": {
                                "type": [
                                  "string",
                                  "null"
                                ],
                                "description": "A https://api.fetchlayer.dev/tiktok/media link that keeps working after TikTok’s own link expires. On a video asset it is ?video=<id> and delivers the video as an MP4 without the TikTok watermark; it is null when the creator has turned off downloads. On an image asset it is ?url=… and delivers the image. Each request to it costs 1 credit."
                              }
                            }
                          },
                          "description": "An ordered list, so a clip and a carousel are handled the same way: a clip yields one asset of kind \"video\", a carousel one of kind \"image\" per frame. Each carries url, width, height and downloadUrl. A video asset’s url is TikTok’s own link, which expires within hours and does not open on its own; use downloadUrl. Every post has a video or images, so an empty list means its media could not be read this time: on a request with include, the video then lists assets in missingFields and the page has complete false with a missing entry {field: \"assets\", reason: \"failed\", count}."
                        },
                        "stats": {
                          "type": "object",
                          "additionalProperties": true,
                          "description": "playCount, diggCount, commentCount, shareCount, collectCount and repostCount. A null counter means TikTok did not publish that figure; a real zero comes back as 0. Views, likes, comments and shares are rounded once they reach 10,000 — roundedStats says which. Counts are as TikTok shows them to US viewers. TikTok keeps a copy of the counts for each region, and the copies differ by a few units, so successive requests can differ slightly."
                        },
                        "roundedStats": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "description": "Which counters in stats TikTok publishes only rounded: to the nearest 100 from 10,000, the nearest 100,000 from 1M, the nearest 100M from 1B. Empty means every counter is exact. Saves (collectCount) are always exact."
                        },
                        "author": {
                          "type": "object",
                          "additionalProperties": true,
                          "description": "id, uniqueId, nickname, avatarUrl, signature, verified, privateAccount, profileUrl and secUid."
                        },
                        "music": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": true,
                          "description": "id, title, authorName, durationSeconds, original, coverUrl, playUrl and url, or null."
                        },
                        "hashtags": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "description": "Without the #, as TikTok tags them on the post rather than parsed out of the caption."
                        },
                        "mentions": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "description": "Usernames without the @."
                        },
                        "mentionedUsers": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "additionalProperties": true,
                            "properties": {
                              "unresolved": {
                                "type": [
                                  "string",
                                  "null"
                                ],
                                "description": "null when the tag leads to an account. \"account_unavailable\" when TikTok names the account’s userId but no longer publishes its username or secUid — the account was deleted, banned or is otherwise unavailable; userId, text, start and end still come back, for example {\"username\": null, \"userId\": \"6794638798661157893\", \"secUid\": null, \"text\": \"@Weight Watchers\", \"start\": 17, \"end\": 33, \"unresolved\": \"account_unavailable\"}. \"not_published\" when TikTok published no account id for the tag."
                              },
                              "text": {
                                "type": [
                                  "string",
                                  "null"
                                ],
                                "description": "The tag as the caption shows it, including the @. Often the display name rather than the username: \"@E.L.F Cosmetics\" tags eyeslipsfacecosmetics. Use username, userId or secUid to identify the account."
                              },
                              "start": {
                                "type": [
                                  "number",
                                  "null"
                                ],
                                "description": "Where the tag starts in description; end is where it stops, exclusive. Both count UTF-16 code units, so description.slice(start, end) equals text in JavaScript; in Python, slice the UTF-16 encoding."
                              }
                            }
                          },
                          "description": "Every account tagged in the caption, in caption order: username, userId (an exact string), secUid, text, start, end and unresolved, each null when TikTok published no value — so username and secUid can be null."
                        },
                        "hashtagDetails": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "additionalProperties": true
                          },
                          "description": "Every hashtag in the caption, with id (or null), name without the #, text with it, and start and end counted like mentionedUsers."
                        },
                        "isAd": {
                          "type": [
                            "boolean",
                            "null"
                          ],
                          "description": "TikTok’s own isAd value: true when TikTok runs or has run the post as a promoted ad, null when TikTok sends no value. Not the creator’s own #ad disclosure. The three flags combine freely: a post can be an ad and a paid partnership, or a partnership that is also shoppable."
                        },
                        "isPaidPartnership": {
                          "type": "boolean",
                          "description": "True when the post carries TikTok’s paid-partnership label, which is exactly when commercialSignals.adLabelVersion is 2. False when it is unmarked."
                        },
                        "isShoppable": {
                          "type": "boolean",
                          "description": "True for a shop or product video: commercialSignals.isECVideo is above 0, or the post carries TikTok’s e-commerce link type 33. False when it is unmarked."
                        },
                        "commercialSignals": {
                          "type": "object",
                          "additionalProperties": true,
                          "description": "TikTok’s own values behind isPaidPartnership and isShoppable, exactly as TikTok publishes them, for callers who want the numbers. null means TikTok sent no value for the post. TikTok does not publish an ad-type or branded-content code beyond these.",
                          "properties": {
                            "adLabelVersion": {
                              "type": [
                                "number",
                                "null"
                              ],
                              "description": "TikTok’s ad-label value, or null. 2 is its paid-partnership label, and isPaidPartnership is true exactly when this is 2."
                            },
                            "brandOrganicType": {
                              "type": [
                                "number",
                                "null"
                              ],
                              "description": "TikTok’s own branded/organic code, such as 1001, or null. TikTok does not explain what the codes mean, and 1001 appears on ads, partnership posts and some unmarked posts alike, so treat it as informational, not as a flag."
                            },
                            "isECVideo": {
                              "type": [
                                "number",
                                "null"
                              ],
                              "description": "Above 0 (seen: 1) when TikTok marks the post as a shop or product video; null when TikTok sends no value."
                            },
                            "adAuthorization": {
                              "type": [
                                "boolean",
                                "null"
                              ],
                              "description": "True when the creator allowed the post to be used in ads, or null. Not a sign that it is running as an ad."
                            },
                            "anchorTypes": {
                              "type": "array",
                              "items": {
                                "type": "number"
                              },
                              "description": "TikTok’s type codes for the links attached to the post: 35 a product link (always with isECVideo 1), 54 an editing-app link, 28 an effect link. Other codes are passed through as TikTok sends them. Empty when no links are attached."
                            }
                          }
                        },
                        "createdRegion": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "The two-letter region TikTok records this post as created in, such as \"US\". Filled on video-detail; on user-videos, search-videos and hashtag-videos it is null unless the request has include: [\"createdRegion\"]. Not the account’s region."
                        },
                        "language": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "The language TikTok assigned to the caption, or null."
                        },
                        "exactStats": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "additionalProperties": true,
                          "description": "Only with include [\"exactStats\"]: the exact counts — playCount, diggCount, commentCount, shareCount and collectCount — as whole numbers, never rounded, where stats rounds from 10,000 up. null, with a note, when they could not be filled. Exact counts are filled for nearly all posts — about 19 in 20 resolve, most on the first ask. The rest come back null with a note; asking again later can fill them. A miss is a normal 200, not an error: the video comes back in full with its usual stats (six counts, including repostCount) and roundedStats, and exactStats, isAdsNative, brandedContentType and accountRegion are present and null, with a note — so check exactStats === null rather than the HTTP status. exactStats has five counts; it has no repostCount. On a list, a page can be partly filled: a note gives how many videos are null, and video-detail can fill those one at a time. The notes read, verbatim: “The exact counts could not be found for this video, so exactStats and accountRegion are null; ask again shortly.”; when your timeoutMs ran out first, “The exact counts could not be filled in time, so exactStats and accountRegion are null; ask again, or allow more time.”; on a list, “The exact counts could not be filled for N of these M videos in time, so exactStats is null for them; ask again or use video-detail for those videos.”; and when only the region is missing, “The exact counts were filled, but this account’s registered region did not come with them, so accountRegion is null.”",
                          "properties": {
                            "playCount": {
                              "type": "integer",
                              "description": "Exact views."
                            },
                            "diggCount": {
                              "type": "integer",
                              "description": "Exact likes."
                            },
                            "commentCount": {
                              "type": "integer",
                              "description": "Exact comments."
                            },
                            "shareCount": {
                              "type": "integer",
                              "description": "Exact shares."
                            },
                            "collectCount": {
                              "type": "integer",
                              "description": "Exact saves."
                            }
                          }
                        },
                        "isAdsNative": {
                          "type": [
                            "boolean",
                            "null"
                          ],
                          "description": "Only with include [\"exactStats\"]: TikTok’s own ad marker for the post. true is rare; false and null are what nearly every post carries."
                        },
                        "brandedContentType": {
                          "type": [
                            "integer",
                            "null"
                          ],
                          "description": "Only with include [\"exactStats\"]: TikTok’s numeric branded-content type — 0 none, 1 paid partnership, 7 commission; other codes come through as TikTok sends them (4 has been seen). null when not filled."
                        },
                        "accountRegion": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "Only with include [\"exactStats\"]: the two-letter region TikTok records the account as registered in, such as \"US\" — the account’s own country. Not where this post was made (createdRegion), and not where the account’s recent videos were posted (postingRegion on user-profile); the three can differ. null, with a note, when no region came with the exact counts, so exactStats can be filled while this is null."
                        },
                        "missingFields": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "description": "Only on a request with include: the fields asked for (exactStats, accountRegion, createdRegion) that this video was left without, and assets when its media could not be read (its assets list is then empty); empty when it has them all. A field TikTok does not publish for the post, such as a post with no recorded created-in region, is not listed."
                        }
                      }
                    },
                    "complete": {
                      "type": "boolean",
                      "description": "Only on a request with include: true when every video has every field asked for. A 200 with complete false still carries every video: count it as a delivered response with fields to ask for again, not as a failure."
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": true,
                        "properties": {
                          "field": {
                            "type": "string",
                            "description": "exactStats, accountRegion, createdRegion or assets. assets counts the videos whose media could not be read, so their assets list is empty; ask again for them. exactStats missing means isAdsNative, brandedContentType and accountRegion are null too; accountRegion on its own means the exact counts filled and only the account’s region did not come with them."
                          },
                          "count": {
                            "type": "integer",
                            "description": "How many videos were left without that field, for that reason."
                          },
                          "reason": {
                            "type": "string",
                            "description": "time_limit: the time limit ran out before it was filled (your timeoutMs, or the default when you set none); ask again, or allow more time. not_found: it was looked up and not found this time; ask again later. failed: the lookup failed; ask again. unavailable: not offered on this request. New reasons may be added, so treat an unknown one as “not filled”. createdRegion is only ever time_limit or failed; accountRegion is only ever not_found; assets is only ever failed; exactStats can carry any of the four."
                          }
                        }
                      },
                      "description": "Only on a request with include: one entry per field and reason, as {field, count, reason}, counting the videos left without it; empty when complete."
                    }
                  },
                  "additionalProperties": false
                },
                "examples": {
                  "default": {
                    "value": {
                      "transport": "tiktok",
                      "notes": [],
                      "pagesFetched": 1,
                      "video": {
                        "id": "7686148096895569165",
                        "url": "https://www.tiktok.com/@nasa/video/7686148096895569165",
                        "description": "Turns out you can dance in space! 🪩🕺💫🛰️ Microgravity just unlocked some new moves.",
                        "createdAt": "2026-09-16T15:00:41.000Z",
                        "durationSeconds": 58,
                        "isPhotoPost": false,
                        "coverUrl": "https://p19-common-sign.tiktokcdn-us.com/tos-useast5-p-0068-tx/...",
                        "assets": [
                          {
                            "kind": "video",
                            "url": "https://v16-webapp-prime.us.tiktok.com/video/tos/useast5/...",
                            "width": 720,
                            "height": 1280,
                            "downloadUrl": "https://api.fetchlayer.dev/tiktok/media?video=7686148096895569165"
                          }
                        ],
                        "stats": {
                          "playCount": 27600,
                          "diggCount": 4367,
                          "commentCount": 173,
                          "shareCount": 104,
                          "collectCount": 273,
                          "repostCount": 0
                        },
                        "roundedStats": [
                          "playCount"
                        ],
                        "author": {
                          "id": "7664638705177150477",
                          "uniqueId": "nasa",
                          "nickname": "NASA",
                          "verified": true,
                          "privateAccount": false,
                          "profileUrl": "https://www.tiktok.com/@nasa"
                        },
                        "music": {
                          "id": "7686148224364694286",
                          "title": "original sound - NASA",
                          "authorName": "NASA",
                          "durationSeconds": 58,
                          "original": false,
                          "url": "https://www.tiktok.com/music/x-7686148224364694286"
                        },
                        "hashtags": [],
                        "mentions": [],
                        "mentionedUsers": [],
                        "hashtagDetails": [],
                        "isAd": false,
                        "language": "en",
                        "isPaidPartnership": false,
                        "isShoppable": false,
                        "commercialSignals": {
                          "adLabelVersion": null,
                          "brandOrganicType": null,
                          "isECVideo": null,
                          "adAuthorization": null,
                          "anchorTypes": []
                        },
                        "createdRegion": "US"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "invalid_input: the request needs fixing; error names the field.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized: the API key is missing or not valid.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "insufficient_credits: no credits, trial or monthly allowance left.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "forbidden: this key or account is not allowed this request.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "quota_exceeded: a request-rate limit was reached.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "temporarily_unavailable, time_limit or (on a store route) store_unreachable: ask again (with time_limit, allow more time). Retryable.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/comments": {
      "post": {
        "operationId": "comments",
        "tags": [
          "Videos"
        ],
        "summary": "Read a video’s comments",
        "description": "The public comments on a TikTok video, by id or URL, each with its text, time, likes, reply count, pinned and author flags. Paged: up to 50 comments a page, 1 credit per page fetched.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "video": {
                    "type": "string",
                    "description": "A video URL or a numeric video id. Shortened share links are rejected — resolve them first."
                  },
                  "limit": {
                    "type": "integer",
                    "description": "Maximum comments returned, up to 500. Use -1 for the maximum. TikTok serves at most 50 to a page, so a larger limit needs more pages; a page often holds a few fewer, because TikTok counts comments it does not show, and the note says so.",
                    "example": "30"
                  },
                  "pages": {
                    "type": "integer",
                    "description": "Pages of results to return in one request, up to 20. Use -1 for the maximum. Each page fetched is 1 credit, and the response reports how many as pagesFetched. A limit larger than one page needs more pages: with pages: 1 the response holds one page, a nextCursor and a note saying the pages limit was reached. When leaving out videos already returned would bring a response short of limit, it takes one more page to fill it; that page shows in pagesFetched, so a request can cost one credit more than the pages asked for.",
                    "example": "1"
                  },
                  "cursor": {
                    "type": "string",
                    "description": "Continue from a previous response’s nextCursor, passed back unchanged with the same request. A cursor continues only the route, and the account and sort, hashtag, search term or video, it came from; a cursor from anywhere else, or one this service did not return, is a 400. Bare numeric cursors from before still work, except on search-videos, where one is a 400 asking you to repeat the search."
                  },
                  "format": {
                    "type": "string",
                    "description": "json or markdown, in any case; any other value is a 400. Over MCP, markdown returns the result rendered as text; the REST API accepts it and returns JSON.",
                    "example": "json"
                  },
                  "timeoutMs": {
                    "type": "integer",
                    "description": "Time limit for the whole request, in milliseconds (1000–120000); a value outside that range is a 400. When it runs out, a paged request returns what it has with nextCursor, billed for the pages it returned; a request with nothing to return yet fails with a 503 you can retry, marked with the response header X-Timeout-Source: caller. Left out, the request runs as long as it needs."
                  }
                },
                "additionalProperties": false,
                "required": [
                  "video"
                ]
              },
              "examples": {
                "default": {
                  "value": {
                    "video": "7686148096895569165",
                    "limit": 30
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "transport": {
                      "type": "string",
                      "description": "The data source: always the platform id, \"tiktok\"."
                    },
                    "notes": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "Caveats you can act on — a private account, comments turned off, a list that ran out early, paging that has gone as deep as it goes. Empty when there are none. An empty result always comes with a note explaining it, never as an unexplained empty array."
                    },
                    "pagesFetched": {
                      "type": "number",
                      "description": "Pages of results fetched, which is what the request costs: one credit per page. resolve-url reports 0 and is not billed."
                    },
                    "videoId": {
                      "type": "string",
                      "description": "The video the comments belong to."
                    },
                    "comments": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": true,
                        "properties": {
                          "id": {
                            "type": "string",
                            "description": "Numeric comment id."
                          },
                          "text": {
                            "type": "string",
                            "description": "The comment body."
                          },
                          "createdAt": {
                            "type": "string",
                            "description": "ISO 8601 timestamp, or null."
                          },
                          "likeCount": {
                            "type": "number",
                            "description": "Likes on the comment."
                          },
                          "replyCount": {
                            "type": "number",
                            "description": "How many replies exist in total — which can exceed what `replies` holds."
                          },
                          "isAuthor": {
                            "type": "boolean",
                            "description": "Whether the video’s author wrote it."
                          },
                          "likedByAuthor": {
                            "type": "boolean",
                            "description": "Whether the video’s author liked it."
                          },
                          "pinned": {
                            "type": "boolean",
                            "description": "Whether it is pinned to the top."
                          },
                          "author": {
                            "type": "object",
                            "additionalProperties": true,
                            "description": "id, uniqueId, nickname, avatarUrl, signature, verified, privateAccount, profileUrl and secUid. Fields TikTok does not publish on a commenter are null."
                          },
                          "replies": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "additionalProperties": true
                            },
                            "description": "Only the replies TikTok shows alongside the comment — usually none or a handful. Read replyCount for the true total."
                          }
                        }
                      },
                      "description": "The comments, in TikTok’s own order. Empty when comments are turned off, with the note \"Comments are turned off for this video.\""
                    },
                    "commentCount": {
                      "type": "number",
                      "description": "How many comments are in this response."
                    },
                    "totalCount": {
                      "type": "number",
                      "description": "The total TikTok publishes for the video, which can exceed what paging can reach."
                    },
                    "hasMore": {
                      "type": "boolean",
                      "description": "Whether more comments exist beyond what was returned."
                    },
                    "nextCursor": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "An opaque token (tt1.…) to pass back unchanged as cursor, or null. TikTok ranks comments afresh for each request, so a further page can repeat a few you already have and miss others: de-duplicate on id."
                    }
                  },
                  "additionalProperties": false
                },
                "examples": {
                  "default": {
                    "value": {
                      "transport": "tiktok",
                      "notes": [],
                      "pagesFetched": 1,
                      "videoId": "7686148096895569165",
                      "comments": [
                        {
                          "id": "7686156652273713942",
                          "text": "Imagine trying to nod to the beat in zero gravity and accidentally rotating the rest of yourself 😂",
                          "createdAt": "2026-09-16T15:33:48.000Z",
                          "likeCount": 5,
                          "replyCount": 0,
                          "isAuthor": false,
                          "likedByAuthor": false,
                          "pinned": false,
                          "author": {
                            "id": "6992252002843853829",
                            "uniqueId": "newy963",
                            "nickname": "newy963",
                            "verified": null,
                            "profileUrl": "https://www.tiktok.com/@newy963"
                          },
                          "replies": []
                        }
                      ],
                      "commentCount": 30,
                      "totalCount": 183,
                      "hasMore": true,
                      "nextCursor": "tt1.eyJyIjoiY20iLCJrIjoiNzY4NjE0ODA5Njg5NTU2OTE2NSIsImMiOiIzMCJ9"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "invalid_input: the request needs fixing; error names the field.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized: the API key is missing or not valid.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "insufficient_credits: no credits, trial or monthly allowance left.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "forbidden: this key or account is not allowed this request.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "quota_exceeded: a request-rate limit was reached.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "temporarily_unavailable, time_limit or (on a store route) store_unreachable: ask again (with time_limit, allow more time). Retryable.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/video-transcript": {
      "post": {
        "operationId": "video-transcript",
        "tags": [
          "Videos"
        ],
        "summary": "Get a video’s transcript",
        "description": "The transcript TikTok publishes for a video, by id or URL: full text plus timed segments, and usually an English translation beside a non-English original. About two thirds of videos have one; a video without one is a normal 200 with available false, not an error.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "video": {
                    "type": "string",
                    "description": "A video URL or a numeric video id. Shortened share links are rejected — resolve them first."
                  },
                  "format": {
                    "type": "string",
                    "description": "json or markdown, in any case; any other value is a 400. Over MCP, markdown returns the result rendered as text; the REST API accepts it and returns JSON.",
                    "example": "json"
                  },
                  "timeoutMs": {
                    "type": "integer",
                    "description": "Time limit for the whole request, in milliseconds (1000–120000); a value outside that range is a 400. When it runs out, a paged request returns what it has with nextCursor, billed for the pages it returned; a request with nothing to return yet fails with a 503 you can retry, marked with the response header X-Timeout-Source: caller. Left out, the request runs as long as it needs."
                  }
                },
                "additionalProperties": false,
                "required": [
                  "video"
                ]
              },
              "examples": {
                "default": {
                  "value": {
                    "video": "7685115221458930957"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "transport": {
                      "type": "string",
                      "description": "The data source: always the platform id, \"tiktok\"."
                    },
                    "notes": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "Caveats you can act on — a private account, comments turned off, a list that ran out early, paging that has gone as deep as it goes. Empty when there are none. An empty result always comes with a note explaining it, never as an unexplained empty array."
                    },
                    "pagesFetched": {
                      "type": "number",
                      "description": "Pages of results fetched, which is what the request costs: one credit per page. resolve-url reports 0 and is not billed."
                    },
                    "videoId": {
                      "type": "string",
                      "description": "The video the transcript belongs to."
                    },
                    "videoUrl": {
                      "type": "string",
                      "description": "Canonical link to the video."
                    },
                    "transcript": {
                      "type": "object",
                      "properties": {
                        "available": {
                          "type": "boolean",
                          "description": "Whether TikTok publishes a transcript for this video: 68% of 185 videos measured across 14 languages had one, and a photo carousel or a video with no speech never does. False is a normal 200, billed as 1 credit like any other, with tracks empty and the note \"No transcript is published for this video. TikTok transcribes spoken audio for most videos but not all, and never for a video with no speech.\" Do not retry it."
                        },
                        "originalLanguage": {
                          "type": "string",
                          "description": "BCP-47 tag for the language spoken in the video, or null when there is no transcript. Conventionally cased: language lowercase, script Titlecase, region UPPERCASE."
                        },
                        "durationSeconds": {
                          "type": "number",
                          "description": "Length of the video in seconds. Filled in even when available is false."
                        },
                        "tracks": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "additionalProperties": true,
                            "properties": {
                              "language": {
                                "type": "string",
                                "description": "BCP-47 tag for this track, e.g. en-US or es-ES, conventionally cased (TikTok’s eng-US arrives as en-US). Compare case-insensitively anyway."
                              },
                              "isOriginalLanguage": {
                                "type": "boolean",
                                "description": "True on the track in the language actually spoken in the video. The translation alongside it is false."
                              },
                              "isAutoGenerated": {
                                "type": "boolean",
                                "description": "True when TikTok generated the captions rather than the account supplying them."
                              },
                              "source": {
                                "type": "string",
                                "description": "Always \"captions\": the transcript TikTok publishes."
                              },
                              "text": {
                                "type": "string",
                                "description": "The whole track, one caption line per newline."
                              },
                              "segments": {
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "additionalProperties": true
                                },
                                "description": "Time-coded lines, each with start, end and text, in seconds from the start of the video. null rather than absent when a track carries no timings."
                              }
                            }
                          },
                          "description": "One entry per track, the spoken language first. Empty when no transcript is published. A non-English video usually carries an English track alongside its original at no extra cost: a Spanish video comes back as es-ES plus en-US, with the same timings."
                        }
                      },
                      "additionalProperties": false
                    }
                  },
                  "additionalProperties": false
                },
                "examples": {
                  "default": {
                    "value": {
                      "transport": "tiktok",
                      "notes": [],
                      "pagesFetched": 1,
                      "videoId": "7685115221458930957",
                      "videoUrl": "https://www.tiktok.com/@_/video/7685115221458930957",
                      "transcript": {
                        "available": true,
                        "originalLanguage": "en-US",
                        "durationSeconds": 82,
                        "tracks": [
                          {
                            "language": "en-US",
                            "isOriginalLanguage": true,
                            "isAutoGenerated": false,
                            "source": "captions",
                            "text": "NASA's future depends on the people,\nmissions, and the networks that connect them.\nThis week had all three. Here's what's new in your NASA minute.\n…",
                            "segments": [
                              {
                                "start": 0.3,
                                "end": 2.14,
                                "text": "NASA's future depends on the people,"
                              },
                              {
                                "start": 2.141,
                                "end": 4.22,
                                "text": "missions, and the networks that connect them."
                              },
                              {
                                "start": 4.221,
                                "end": 7.88,
                                "text": "This week had all three. Here's what's new in your NASA minute."
                              }
                            ]
                          }
                        ]
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "invalid_input: the request needs fixing; error names the field.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized: the API key is missing or not valid.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "insufficient_credits: no credits, trial or monthly allowance left.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "forbidden: this key or account is not allowed this request.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "quota_exceeded: a request-rate limit was reached.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "temporarily_unavailable, time_limit or (on a store route) store_unreachable: ask again (with time_limit, allow more time). Retryable.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/search-videos": {
      "post": {
        "operationId": "search-videos",
        "tags": [
          "Search & hashtags"
        ],
        "summary": "Search TikTok videos",
        "description": "Videos matching a search term, in TikTok’s own ranking for it. There is no sort or date filter, because TikTok offers neither publicly. Paged: about 12 videos a page, 1 credit per page fetched.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "query": {
                    "type": "string",
                    "description": "What to search TikTok for. Search takes no sort or date filter: sending either is a 400 naming the field, not an option that is quietly ignored."
                  },
                  "limit": {
                    "type": "integer",
                    "description": "Maximum videos returned, up to 500. Use -1 for the maximum. TikTok serves about 12 search results a page, so a larger limit needs more pages.",
                    "example": "30"
                  },
                  "include": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Pass [\"createdRegion\"] to fill each video’s createdRegion in the same request, which is otherwise null on this route. It adds a few seconds. Without timeoutMs the filling stops about 20 seconds after the request starts; with timeoutMs the response always comes within your limit. A video not filled in time keeps null, and a note gives the count — asking again fills the rest. Pass [\"exactStats\"] (alone or with createdRegion) to fill every video on the page with exactStats, isAdsNative, brandedContentType and accountRegion, as on video-detail; a page of 30 videos adds a few seconds, at no extra cost. With both createdRegion and exactStats, use timeoutMs of 30000 or more. complete and missing say which videos were left without a field asked for, and why."
                  },
                  "pages": {
                    "type": "integer",
                    "description": "Pages of results to return in one request, up to 20. Use -1 for the maximum. Each page fetched is 1 credit, and the response reports how many as pagesFetched. A limit larger than one page needs more pages: with pages: 1 the response holds one page, a nextCursor and a note saying the pages limit was reached. When leaving out videos already returned would bring a response short of limit, it takes one more page to fill it; that page shows in pagesFetched, so a request can cost one credit more than the pages asked for.",
                    "example": "1"
                  },
                  "cursor": {
                    "type": "string",
                    "description": "Continue from a previous response’s nextCursor, passed back unchanged with the same request. A cursor continues only the route, and the account and sort, hashtag, search term or video, it came from; a cursor from anywhere else, or one this service did not return, is a 400. Bare numeric cursors from before still work, except on search-videos, where one is a 400 asking you to repeat the search."
                  },
                  "format": {
                    "type": "string",
                    "description": "json or markdown, in any case; any other value is a 400. Over MCP, markdown returns the result rendered as text; the REST API accepts it and returns JSON.",
                    "example": "json"
                  },
                  "timeoutMs": {
                    "type": "integer",
                    "description": "Time limit for the whole request, in milliseconds (1000–120000); a value outside that range is a 400. When it runs out, a paged request returns what it has with nextCursor, billed for the pages it returned; a request with nothing to return yet fails with a 503 you can retry, marked with the response header X-Timeout-Source: caller. Left out, the request runs as long as it needs."
                  }
                },
                "additionalProperties": false,
                "required": [
                  "query"
                ]
              },
              "examples": {
                "default": {
                  "value": {
                    "query": "space launch",
                    "limit": 12
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "transport": {
                      "type": "string",
                      "description": "The data source: always the platform id, \"tiktok\"."
                    },
                    "notes": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "Caveats you can act on — a private account, comments turned off, a list that ran out early, paging that has gone as deep as it goes. Empty when there are none. An empty result always comes with a note explaining it, never as an unexplained empty array."
                    },
                    "pagesFetched": {
                      "type": "number",
                      "description": "Pages of results fetched, which is what the request costs: one credit per page. resolve-url reports 0 and is not billed."
                    },
                    "query": {
                      "type": "string",
                      "description": "The term that was searched."
                    },
                    "videos": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": true,
                        "properties": {
                          "id": {
                            "type": "string",
                            "description": "Numeric video id, which video-detail and comments both accept."
                          },
                          "url": {
                            "type": "string",
                            "description": "Canonical link to the video. This is what you use to open or embed it."
                          },
                          "description": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "The caption, or null when there is none."
                          },
                          "createdAt": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "ISO 8601 timestamp of when it was posted, or null."
                          },
                          "durationSeconds": {
                            "type": [
                              "number",
                              "null"
                            ],
                            "description": "Length in seconds, or null."
                          },
                          "isPhotoPost": {
                            "type": "boolean",
                            "description": "True for a photo carousel rather than a clip."
                          },
                          "coverUrl": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "The cover frame. An image, so it re-fetches through GET /media normally."
                          },
                          "assets": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "additionalProperties": true,
                              "properties": {
                                "downloadUrl": {
                                  "type": [
                                    "string",
                                    "null"
                                  ],
                                  "description": "A https://api.fetchlayer.dev/tiktok/media link that keeps working after TikTok’s own link expires. On a video asset it is ?video=<id> and delivers the video as an MP4 without the TikTok watermark; it is null when the creator has turned off downloads. On an image asset it is ?url=… and delivers the image. Each request to it costs 1 credit."
                                }
                              }
                            },
                            "description": "An ordered list, so a clip and a carousel are handled the same way: a clip yields one asset of kind \"video\", a carousel one of kind \"image\" per frame. Each carries url, width, height and downloadUrl. A video asset’s url is TikTok’s own link, which expires within hours and does not open on its own; use downloadUrl. Every post has a video or images, so an empty list means its media could not be read this time: on a request with include, the video then lists assets in missingFields and the page has complete false with a missing entry {field: \"assets\", reason: \"failed\", count}."
                          },
                          "stats": {
                            "type": "object",
                            "additionalProperties": true,
                            "description": "playCount, diggCount, commentCount, shareCount, collectCount and repostCount. A null counter means TikTok did not publish that figure; a real zero comes back as 0. Views, likes, comments and shares are rounded once they reach 10,000 — roundedStats says which. Counts are as TikTok shows them to US viewers. TikTok keeps a copy of the counts for each region, and the copies differ by a few units, so successive requests can differ slightly."
                          },
                          "roundedStats": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            },
                            "description": "Which counters in stats TikTok publishes only rounded: to the nearest 100 from 10,000, the nearest 100,000 from 1M, the nearest 100M from 1B. Empty means every counter is exact. Saves (collectCount) are always exact."
                          },
                          "author": {
                            "type": "object",
                            "additionalProperties": true,
                            "description": "id, uniqueId, nickname, avatarUrl, signature, verified, privateAccount, profileUrl and secUid."
                          },
                          "music": {
                            "type": [
                              "object",
                              "null"
                            ],
                            "additionalProperties": true,
                            "description": "id, title, authorName, durationSeconds, original, coverUrl, playUrl and url, or null."
                          },
                          "hashtags": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            },
                            "description": "Without the #, as TikTok tags them on the post rather than parsed out of the caption."
                          },
                          "mentions": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            },
                            "description": "Usernames without the @."
                          },
                          "mentionedUsers": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "additionalProperties": true,
                              "properties": {
                                "unresolved": {
                                  "type": [
                                    "string",
                                    "null"
                                  ],
                                  "description": "null when the tag leads to an account. \"account_unavailable\" when TikTok names the account’s userId but no longer publishes its username or secUid — the account was deleted, banned or is otherwise unavailable; userId, text, start and end still come back, for example {\"username\": null, \"userId\": \"6794638798661157893\", \"secUid\": null, \"text\": \"@Weight Watchers\", \"start\": 17, \"end\": 33, \"unresolved\": \"account_unavailable\"}. \"not_published\" when TikTok published no account id for the tag."
                                },
                                "text": {
                                  "type": [
                                    "string",
                                    "null"
                                  ],
                                  "description": "The tag as the caption shows it, including the @. Often the display name rather than the username: \"@E.L.F Cosmetics\" tags eyeslipsfacecosmetics. Use username, userId or secUid to identify the account."
                                },
                                "start": {
                                  "type": [
                                    "number",
                                    "null"
                                  ],
                                  "description": "Where the tag starts in description; end is where it stops, exclusive. Both count UTF-16 code units, so description.slice(start, end) equals text in JavaScript; in Python, slice the UTF-16 encoding."
                                }
                              }
                            },
                            "description": "Every account tagged in the caption, in caption order: username, userId (an exact string), secUid, text, start, end and unresolved, each null when TikTok published no value — so username and secUid can be null."
                          },
                          "hashtagDetails": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "additionalProperties": true
                            },
                            "description": "Every hashtag in the caption, with id (or null), name without the #, text with it, and start and end counted like mentionedUsers."
                          },
                          "isAd": {
                            "type": [
                              "boolean",
                              "null"
                            ],
                            "description": "TikTok’s own isAd value: true when TikTok runs or has run the post as a promoted ad, null when TikTok sends no value. Not the creator’s own #ad disclosure. The three flags combine freely: a post can be an ad and a paid partnership, or a partnership that is also shoppable."
                          },
                          "isPaidPartnership": {
                            "type": "boolean",
                            "description": "True when the post carries TikTok’s paid-partnership label, which is exactly when commercialSignals.adLabelVersion is 2. False when it is unmarked."
                          },
                          "isShoppable": {
                            "type": "boolean",
                            "description": "True for a shop or product video: commercialSignals.isECVideo is above 0, or the post carries TikTok’s e-commerce link type 33. False when it is unmarked."
                          },
                          "commercialSignals": {
                            "type": "object",
                            "additionalProperties": true,
                            "description": "TikTok’s own values behind isPaidPartnership and isShoppable, exactly as TikTok publishes them, for callers who want the numbers. null means TikTok sent no value for the post. TikTok does not publish an ad-type or branded-content code beyond these.",
                            "properties": {
                              "adLabelVersion": {
                                "type": [
                                  "number",
                                  "null"
                                ],
                                "description": "TikTok’s ad-label value, or null. 2 is its paid-partnership label, and isPaidPartnership is true exactly when this is 2."
                              },
                              "brandOrganicType": {
                                "type": [
                                  "number",
                                  "null"
                                ],
                                "description": "TikTok’s own branded/organic code, such as 1001, or null. TikTok does not explain what the codes mean, and 1001 appears on ads, partnership posts and some unmarked posts alike, so treat it as informational, not as a flag."
                              },
                              "isECVideo": {
                                "type": [
                                  "number",
                                  "null"
                                ],
                                "description": "Above 0 (seen: 1) when TikTok marks the post as a shop or product video; null when TikTok sends no value."
                              },
                              "adAuthorization": {
                                "type": [
                                  "boolean",
                                  "null"
                                ],
                                "description": "True when the creator allowed the post to be used in ads, or null. Not a sign that it is running as an ad."
                              },
                              "anchorTypes": {
                                "type": "array",
                                "items": {
                                  "type": "number"
                                },
                                "description": "TikTok’s type codes for the links attached to the post: 35 a product link (always with isECVideo 1), 54 an editing-app link, 28 an effect link. Other codes are passed through as TikTok sends them. Empty when no links are attached."
                              }
                            }
                          },
                          "createdRegion": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "The two-letter region TikTok records this post as created in, such as \"US\". Filled on video-detail; on user-videos, search-videos and hashtag-videos it is null unless the request has include: [\"createdRegion\"]. Not the account’s region."
                          },
                          "language": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "The language TikTok assigned to the caption, or null."
                          },
                          "exactStats": {
                            "type": [
                              "object",
                              "null"
                            ],
                            "additionalProperties": true,
                            "description": "Only with include [\"exactStats\"]: the exact counts — playCount, diggCount, commentCount, shareCount and collectCount — as whole numbers, never rounded, where stats rounds from 10,000 up. null, with a note, when they could not be filled. Exact counts are filled for nearly all posts — about 19 in 20 resolve, most on the first ask. The rest come back null with a note; asking again later can fill them. A miss is a normal 200, not an error: the video comes back in full with its usual stats (six counts, including repostCount) and roundedStats, and exactStats, isAdsNative, brandedContentType and accountRegion are present and null, with a note — so check exactStats === null rather than the HTTP status. exactStats has five counts; it has no repostCount. On a list, a page can be partly filled: a note gives how many videos are null, and video-detail can fill those one at a time. The notes read, verbatim: “The exact counts could not be found for this video, so exactStats and accountRegion are null; ask again shortly.”; when your timeoutMs ran out first, “The exact counts could not be filled in time, so exactStats and accountRegion are null; ask again, or allow more time.”; on a list, “The exact counts could not be filled for N of these M videos in time, so exactStats is null for them; ask again or use video-detail for those videos.”; and when only the region is missing, “The exact counts were filled, but this account’s registered region did not come with them, so accountRegion is null.”",
                            "properties": {
                              "playCount": {
                                "type": "integer",
                                "description": "Exact views."
                              },
                              "diggCount": {
                                "type": "integer",
                                "description": "Exact likes."
                              },
                              "commentCount": {
                                "type": "integer",
                                "description": "Exact comments."
                              },
                              "shareCount": {
                                "type": "integer",
                                "description": "Exact shares."
                              },
                              "collectCount": {
                                "type": "integer",
                                "description": "Exact saves."
                              }
                            }
                          },
                          "isAdsNative": {
                            "type": [
                              "boolean",
                              "null"
                            ],
                            "description": "Only with include [\"exactStats\"]: TikTok’s own ad marker for the post. true is rare; false and null are what nearly every post carries."
                          },
                          "brandedContentType": {
                            "type": [
                              "integer",
                              "null"
                            ],
                            "description": "Only with include [\"exactStats\"]: TikTok’s numeric branded-content type — 0 none, 1 paid partnership, 7 commission; other codes come through as TikTok sends them (4 has been seen). null when not filled."
                          },
                          "accountRegion": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Only with include [\"exactStats\"]: the two-letter region TikTok records the account as registered in, such as \"US\" — the account’s own country. Not where this post was made (createdRegion), and not where the account’s recent videos were posted (postingRegion on user-profile); the three can differ. null, with a note, when no region came with the exact counts, so exactStats can be filled while this is null."
                          },
                          "missingFields": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            },
                            "description": "Only on a request with include: the fields asked for (exactStats, accountRegion, createdRegion) that this video was left without, and assets when its media could not be read (its assets list is then empty); empty when it has them all. A field TikTok does not publish for the post, such as a post with no recorded created-in region, is not listed."
                          }
                        }
                      },
                      "description": "The matching videos, in TikTok’s ranking. For some health topics TikTok shows a support notice with the results, which still come back, with a note such as \"TikTok shows a support notice with these results (\"You are more than your weight\"); the results are listed as TikTok shows them.\" For a few terms TikTok shows no results at all: the response is an immediate 200 with videos empty, hasMore false and a note such as \"TikTok does not show search results for \"suicide\"; it shows a support resource instead (988 Suicide and Crisis Lifeline). Asking again will not change this.\" Repeating the search will not change it."
                    },
                    "complete": {
                      "type": "boolean",
                      "description": "Only on a request with include: true when every video has every field asked for. A 200 with complete false still carries every video: count it as a delivered response with fields to ask for again, not as a failure."
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": true,
                        "properties": {
                          "field": {
                            "type": "string",
                            "description": "exactStats, accountRegion, createdRegion or assets. assets counts the videos whose media could not be read, so their assets list is empty; ask again for them. exactStats missing means isAdsNative, brandedContentType and accountRegion are null too; accountRegion on its own means the exact counts filled and only the account’s region did not come with them."
                          },
                          "count": {
                            "type": "integer",
                            "description": "How many videos were left without that field, for that reason."
                          },
                          "reason": {
                            "type": "string",
                            "description": "time_limit: the time limit ran out before it was filled (your timeoutMs, or the default when you set none); ask again, or allow more time. not_found: it was looked up and not found this time; ask again later. failed: the lookup failed; ask again. unavailable: not offered on this request. New reasons may be added, so treat an unknown one as “not filled”. createdRegion is only ever time_limit or failed; accountRegion is only ever not_found; assets is only ever failed; exactStats can carry any of the four."
                          }
                        }
                      },
                      "description": "Only on a request with include: one entry per field and reason, as {field, count, reason}, counting the videos left without it; empty when complete."
                    },
                    "videoCount": {
                      "type": "number",
                      "description": "How many videos are in this response."
                    },
                    "hasMore": {
                      "type": "boolean",
                      "description": "Whether more results exist beyond what was returned."
                    },
                    "nextCursor": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "An opaque token (tt1.…) to pass back unchanged as cursor, with the same request, to continue exactly where this response stopped. Continuing never repeats or skips a video: with sort latest on user-videos, every video comes back once, newest first. With sort popular, on search and on hashtags the same holds at each boundary, but TikTok can re-rank between requests, so keep the ids you have if every video exactly once across a long walk matters. null when there is nothing further."
                    }
                  },
                  "additionalProperties": false
                },
                "examples": {
                  "default": {
                    "value": {
                      "transport": "tiktok",
                      "notes": [],
                      "pagesFetched": 1,
                      "query": "space launch",
                      "videos": [
                        {
                          "id": "7686148096895569165",
                          "url": "https://www.tiktok.com/@nasa/video/7686148096895569165",
                          "description": "Turns out you can dance in space! 🪩🕺💫🛰️ Microgravity just unlocked some new moves.",
                          "createdAt": "2026-09-16T15:00:41.000Z",
                          "durationSeconds": 58,
                          "isPhotoPost": false,
                          "coverUrl": "https://p19-common-sign.tiktokcdn-us.com/tos-useast5-p-0068-tx/...",
                          "assets": [
                            {
                              "kind": "video",
                              "url": "https://v16-webapp-prime.us.tiktok.com/video/tos/useast5/...",
                              "width": 720,
                              "height": 1280,
                              "downloadUrl": "https://api.fetchlayer.dev/tiktok/media?video=7686148096895569165"
                            }
                          ],
                          "stats": {
                            "playCount": 27600,
                            "diggCount": 4367,
                            "commentCount": 173,
                            "shareCount": 104,
                            "collectCount": 273,
                            "repostCount": 0
                          },
                          "roundedStats": [
                            "playCount"
                          ],
                          "author": {
                            "id": "7664638705177150477",
                            "uniqueId": "nasa",
                            "nickname": "NASA",
                            "verified": true,
                            "privateAccount": false,
                            "profileUrl": "https://www.tiktok.com/@nasa"
                          },
                          "music": {
                            "id": "7686148224364694286",
                            "title": "original sound - NASA",
                            "authorName": "NASA",
                            "durationSeconds": 58,
                            "original": false,
                            "url": "https://www.tiktok.com/music/x-7686148224364694286"
                          },
                          "hashtags": [],
                          "mentions": [],
                          "mentionedUsers": [],
                          "hashtagDetails": [],
                          "isAd": false,
                          "language": "en",
                          "isPaidPartnership": false,
                          "isShoppable": false,
                          "commercialSignals": {
                            "adLabelVersion": null,
                            "brandOrganicType": null,
                            "isECVideo": null,
                            "adAuthorization": null,
                            "anchorTypes": []
                          },
                          "createdRegion": null
                        }
                      ],
                      "videoCount": 12,
                      "hasMore": true,
                      "nextCursor": "tt1.eyJyIjoic3YiLCJrIjoic3BhY2UgbGF1bmNoIiwiYyI6IjAiLCJuIjoxMn0"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "invalid_input: the request needs fixing; error names the field.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized: the API key is missing or not valid.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "insufficient_credits: no credits, trial or monthly allowance left.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "forbidden: this key or account is not allowed this request.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "quota_exceeded: a request-rate limit was reached.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "temporarily_unavailable, time_limit or (on a store route) store_unreachable: ask again (with time_limit, allow more time). Retryable.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/hashtag-videos": {
      "post": {
        "operationId": "hashtag-videos",
        "tags": [
          "Search & hashtags"
        ],
        "summary": "List videos under a hashtag",
        "description": "Videos TikTok lists under a hashtag, most popular first, plus the hashtag itself with its exact view and video counts. Paged: up to 30 videos a page; 1 credit per page of up to 30 posts delivered, minimum 1 credit per request, stated as credits. pollState (or since, knownIds, lastPollAt and within) returns only the posts new to you, and requireHashtag only those carrying the tag.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "hashtag": {
                    "type": "string",
                    "description": "A hashtag name with or without the leading #, or a hashtag URL. Pass exactly one of hashtag or hashtagId; both or neither is a 400. A hashtag that does not exist is a 404, which takes about 5–10 seconds."
                  },
                  "hashtagId": {
                    "type": "string",
                    "description": "The hashtag’s numeric id, as a string (hashtag.id in a response). An alternative to hashtag; an id that names no public hashtag is a 404."
                  },
                  "requireHashtag": {
                    "type": "boolean",
                    "description": "true returns only posts that carry the hashtag in their own caption, leaving out (and counting, as incremental.excludedOffTopicCount) the related posts TikTok also lists under it — often half or more, so a poll returns fewer posts.",
                    "example": "false"
                  },
                  "includeSearch": {
                    "type": "boolean",
                    "description": "true also searches for the hashtag and adds posts that search finds and the hashtag’s list does not, each marked source: \"search\" (the list’s are \"list\"), after the list’s posts. Adds about 10 seconds. The list and the search are different selections, and search leans towards recent posts: in one check each search for #minecraft found about 20 posts from the last day that 8 requests for its list had not shown, while for a smaller hashtag such as #bookbinding it found none the list did not already have. The same filters apply to search posts (knownIds or pollState, within, since, requireHashtag), limit counts both together, and incremental.bySource gives the counts per source. Use timeoutMs of 45000 or more: with less than about 12 seconds left after the list, the search is skipped and a note says so. It is not run when continuing with a cursor.",
                    "example": "false"
                  },
                  "limit": {
                    "type": "integer",
                    "description": "Maximum videos returned, up to 500. Use -1 for the maximum. TikTok serves a hashtag’s videos at most 30 to a page, so a limit above 30 needs more pages.",
                    "example": "30"
                  },
                  "include": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Pass [\"createdRegion\"] to fill each video’s createdRegion in the same request, which is otherwise null on this route. It adds a few seconds. Without timeoutMs the filling stops about 20 seconds after the request starts; with timeoutMs the response always comes within your limit. A video not filled in time keeps null, and a note gives the count — asking again fills the rest. Pass [\"exactStats\"] (alone or with createdRegion) to fill every video on the page with exactStats, isAdsNative, brandedContentType and accountRegion, as on video-detail; a page of 30 videos adds a few seconds, at no extra cost. With both createdRegion and exactStats, use timeoutMs of 30000 or more. complete and missing say which videos were left without a field asked for, and why."
                  },
                  "since": {
                    "type": [
                      "integer",
                      "string"
                    ],
                    "description": "Return only videos posted at or after this time: unix seconds or an ISO 8601 date-time such as \"2026-10-14T12:00:00Z\". Every post published before it is left out. A millisecond timestamp, a time before 2016 or more than a day ahead is a 400 naming the field."
                  },
                  "knownIds": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Ids of videos you already have, up to 2000, as numeric strings; they are left out of the response. An empty list means you have none yet, so older posts come back as newly appeared (newlyPublished false) rather than null. Or, instead of pollState, keep the ids yourself: to poll a hashtag for new posts, send knownIds, lastPollAt and within (such as \"7d\") with limit: -1 and pages: 7, which covers the whole list; that takes about 22–31 seconds, and timeoutMs of 35000 or more lets nearly every request finish. More than 2000, or an id that is not numeric, is a 400 naming the field."
                  },
                  "pollState": {
                    "type": "string",
                    "description": "\"new\" on your first poll, then the nextPollState from your previous response: we remember what you already have for this hashtag, so you need not send knownIds. The simplest way to poll: {\"hashtag\": \"minecraft\", \"pollState\": \"<nextPollState>\", \"within\": \"2d\", \"limit\": -1, \"pages\": 7}. One pollState per hashtag; one from a different hashtag is a 400. It is kept for 30 days after its last use, holding the latest 5,000 posts delivered. If a response is lost, send the same request again (the same pollState and the same other fields) within about 10 minutes: you get exactly the same response again, including the same nextPollState. After that, or if you change any field, it is a fresh poll, which may differ, since TikTok’s list changes between requests. A pollState we no longer have returns every listed post as new, with a note and a fresh nextPollState. You can still add knownIds: both are left out. lastPollAt defaults to your previous poll’s time. Any value other than \"new\" or one we returned is a 400 naming pollState."
                  },
                  "lastPollAt": {
                    "type": [
                      "integer",
                      "string"
                    ],
                    "description": "When you last asked for this hashtag, in the same forms as since. It leaves nothing out; it sets each returned video’s newlyPublished. A millisecond timestamp, a time before 2016 or more than a day ahead is a 400 naming the field."
                  },
                  "within": {
                    "type": [
                      "integer",
                      "string"
                    ],
                    "description": "How far back a post may be published and still count as new to you: \"12h\", \"7d\", \"4w\" (hours, days, weeks) or a number of seconds, from 1 hour to 365 days. With knownIds, posts you do not have that were published before the window are left out and counted, so you get only posts new to you and published within it; without it, every older post you have not seen comes back with newlyPublished false. Without knownIds it works like since set that far back. A value outside those forms or that range is a 400 naming the field."
                  },
                  "pages": {
                    "type": "integer",
                    "description": "Pages of results to return in one request, up to 20. Use -1 for the maximum. A limit larger than one page needs more pages: with pages: 1 the response holds one page, a nextCursor and a note saying the pages limit was reached. This route bills by posts delivered, not pages fetched: 1 credit per page of up to 30 posts delivered, minimum 1 credit per request.",
                    "example": "1"
                  },
                  "cursor": {
                    "type": "string",
                    "description": "Continue from a previous response’s nextCursor, passed back unchanged with the same request. A cursor continues only the route, and the account and sort, hashtag, search term or video, it came from; a cursor from anywhere else, or one this service did not return, is a 400. Bare numeric cursors from before still work, except on search-videos, where one is a 400 asking you to repeat the search."
                  },
                  "format": {
                    "type": "string",
                    "description": "json or markdown, in any case; any other value is a 400. Over MCP, markdown returns the result rendered as text; the REST API accepts it and returns JSON.",
                    "example": "json"
                  },
                  "timeoutMs": {
                    "type": "integer",
                    "description": "Time limit for the whole request, in milliseconds (1000–120000); a value outside that range is a 400. When it runs out, a paged request returns what it has with nextCursor, billed for the posts it returned; a request with nothing to return yet fails with a 503 you can retry, marked with the response header X-Timeout-Source: caller. Left out, the request runs as long as it needs."
                  }
                },
                "additionalProperties": false
              },
              "examples": {
                "default": {
                  "value": {
                    "hashtag": "nasa",
                    "limit": 30
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "transport": {
                      "type": "string",
                      "description": "The data source: always the platform id, \"tiktok\"."
                    },
                    "notes": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "Caveats you can act on — a private account, comments turned off, a list that ran out early, paging that has gone as deep as it goes. Empty when there are none. An empty result always comes with a note explaining it, never as an unexplained empty array."
                    },
                    "pagesFetched": {
                      "type": "number",
                      "description": "Pages of results fetched, search pages included. It is not what this route bills: that is 1 credit per page of up to 30 posts delivered, stated as credits."
                    },
                    "hashtag": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "TikTok’s numeric hashtag id."
                        },
                        "name": {
                          "type": "string",
                          "description": "The tag, without the #."
                        },
                        "url": {
                          "type": "string",
                          "description": "Canonical hashtag URL."
                        },
                        "description": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "The tag’s description, or null."
                        },
                        "coverUrl": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "Cover image, or null."
                        },
                        "viewCount": {
                          "type": [
                            "number",
                            "null"
                          ],
                          "description": "Total views across TikTok for the tag, exact, or null when it publishes none."
                        },
                        "videoCount": {
                          "type": [
                            "number",
                            "null"
                          ],
                          "description": "Videos TikTok reports under the tag, exact, or null."
                        },
                        "roundedStats": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "description": "Which hashtag counts are rounded. Normally empty: both counts are exact."
                        }
                      },
                      "additionalProperties": false
                    },
                    "videos": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": true,
                        "properties": {
                          "newlyPublished": {
                            "type": [
                              "boolean",
                              "null"
                            ],
                            "description": "Present only when since, knownIds, lastPollAt, within, requireHashtag, pollState or includeSearch is set. true: published at or after lastPollAt (or since). false: older (inside within, if it was sent) and not in knownIds, so newly appeared — mostly TikTok rotating its selection rather than a new post. null: cannot be told — no lastPollAt or since, no date from TikTok, or an older post when knownIds was not sent."
                          },
                          "source": {
                            "type": "string",
                            "description": "Present only with includeSearch: list for a post from the hashtag’s own list, search for one a search for the hashtag found that the list did not include."
                          },
                          "id": {
                            "type": "string",
                            "description": "Numeric video id, which video-detail and comments both accept."
                          },
                          "url": {
                            "type": "string",
                            "description": "Canonical link to the video. This is what you use to open or embed it."
                          },
                          "description": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "The caption, or null when there is none."
                          },
                          "createdAt": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "ISO 8601 timestamp of when it was posted, or null."
                          },
                          "durationSeconds": {
                            "type": [
                              "number",
                              "null"
                            ],
                            "description": "Length in seconds, or null."
                          },
                          "isPhotoPost": {
                            "type": "boolean",
                            "description": "True for a photo carousel rather than a clip."
                          },
                          "coverUrl": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "The cover frame. An image, so it re-fetches through GET /media normally."
                          },
                          "assets": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "additionalProperties": true,
                              "properties": {
                                "downloadUrl": {
                                  "type": [
                                    "string",
                                    "null"
                                  ],
                                  "description": "A https://api.fetchlayer.dev/tiktok/media link that keeps working after TikTok’s own link expires. On a video asset it is ?video=<id> and delivers the video as an MP4 without the TikTok watermark; it is null when the creator has turned off downloads. On an image asset it is ?url=… and delivers the image. Each request to it costs 1 credit."
                                }
                              }
                            },
                            "description": "An ordered list, so a clip and a carousel are handled the same way: a clip yields one asset of kind \"video\", a carousel one of kind \"image\" per frame. Each carries url, width, height and downloadUrl. A video asset’s url is TikTok’s own link, which expires within hours and does not open on its own; use downloadUrl. Every post has a video or images, so an empty list means its media could not be read this time: on a request with include, the video then lists assets in missingFields and the page has complete false with a missing entry {field: \"assets\", reason: \"failed\", count}."
                          },
                          "stats": {
                            "type": "object",
                            "additionalProperties": true,
                            "description": "playCount, diggCount, commentCount, shareCount, collectCount and repostCount. A null counter means TikTok did not publish that figure; a real zero comes back as 0. Views, likes, comments and shares are rounded once they reach 10,000 — roundedStats says which. Counts are as TikTok shows them to US viewers. TikTok keeps a copy of the counts for each region, and the copies differ by a few units, so successive requests can differ slightly."
                          },
                          "roundedStats": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            },
                            "description": "Which counters in stats TikTok publishes only rounded: to the nearest 100 from 10,000, the nearest 100,000 from 1M, the nearest 100M from 1B. Empty means every counter is exact. Saves (collectCount) are always exact."
                          },
                          "author": {
                            "type": "object",
                            "additionalProperties": true,
                            "description": "id, uniqueId, nickname, avatarUrl, signature, verified, privateAccount, profileUrl and secUid."
                          },
                          "music": {
                            "type": [
                              "object",
                              "null"
                            ],
                            "additionalProperties": true,
                            "description": "id, title, authorName, durationSeconds, original, coverUrl, playUrl and url, or null."
                          },
                          "hashtags": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            },
                            "description": "Without the #, as TikTok tags them on the post rather than parsed out of the caption."
                          },
                          "mentions": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            },
                            "description": "Usernames without the @."
                          },
                          "mentionedUsers": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "additionalProperties": true,
                              "properties": {
                                "unresolved": {
                                  "type": [
                                    "string",
                                    "null"
                                  ],
                                  "description": "null when the tag leads to an account. \"account_unavailable\" when TikTok names the account’s userId but no longer publishes its username or secUid — the account was deleted, banned or is otherwise unavailable; userId, text, start and end still come back, for example {\"username\": null, \"userId\": \"6794638798661157893\", \"secUid\": null, \"text\": \"@Weight Watchers\", \"start\": 17, \"end\": 33, \"unresolved\": \"account_unavailable\"}. \"not_published\" when TikTok published no account id for the tag."
                                },
                                "text": {
                                  "type": [
                                    "string",
                                    "null"
                                  ],
                                  "description": "The tag as the caption shows it, including the @. Often the display name rather than the username: \"@E.L.F Cosmetics\" tags eyeslipsfacecosmetics. Use username, userId or secUid to identify the account."
                                },
                                "start": {
                                  "type": [
                                    "number",
                                    "null"
                                  ],
                                  "description": "Where the tag starts in description; end is where it stops, exclusive. Both count UTF-16 code units, so description.slice(start, end) equals text in JavaScript; in Python, slice the UTF-16 encoding."
                                }
                              }
                            },
                            "description": "Every account tagged in the caption, in caption order: username, userId (an exact string), secUid, text, start, end and unresolved, each null when TikTok published no value — so username and secUid can be null."
                          },
                          "hashtagDetails": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "additionalProperties": true
                            },
                            "description": "Every hashtag in the caption, with id (or null), name without the #, text with it, and start and end counted like mentionedUsers."
                          },
                          "isAd": {
                            "type": [
                              "boolean",
                              "null"
                            ],
                            "description": "TikTok’s own isAd value: true when TikTok runs or has run the post as a promoted ad, null when TikTok sends no value. Not the creator’s own #ad disclosure. The three flags combine freely: a post can be an ad and a paid partnership, or a partnership that is also shoppable."
                          },
                          "isPaidPartnership": {
                            "type": "boolean",
                            "description": "True when the post carries TikTok’s paid-partnership label, which is exactly when commercialSignals.adLabelVersion is 2. False when it is unmarked."
                          },
                          "isShoppable": {
                            "type": "boolean",
                            "description": "True for a shop or product video: commercialSignals.isECVideo is above 0, or the post carries TikTok’s e-commerce link type 33. False when it is unmarked."
                          },
                          "commercialSignals": {
                            "type": "object",
                            "additionalProperties": true,
                            "description": "TikTok’s own values behind isPaidPartnership and isShoppable, exactly as TikTok publishes them, for callers who want the numbers. null means TikTok sent no value for the post. TikTok does not publish an ad-type or branded-content code beyond these.",
                            "properties": {
                              "adLabelVersion": {
                                "type": [
                                  "number",
                                  "null"
                                ],
                                "description": "TikTok’s ad-label value, or null. 2 is its paid-partnership label, and isPaidPartnership is true exactly when this is 2."
                              },
                              "brandOrganicType": {
                                "type": [
                                  "number",
                                  "null"
                                ],
                                "description": "TikTok’s own branded/organic code, such as 1001, or null. TikTok does not explain what the codes mean, and 1001 appears on ads, partnership posts and some unmarked posts alike, so treat it as informational, not as a flag."
                              },
                              "isECVideo": {
                                "type": [
                                  "number",
                                  "null"
                                ],
                                "description": "Above 0 (seen: 1) when TikTok marks the post as a shop or product video; null when TikTok sends no value."
                              },
                              "adAuthorization": {
                                "type": [
                                  "boolean",
                                  "null"
                                ],
                                "description": "True when the creator allowed the post to be used in ads, or null. Not a sign that it is running as an ad."
                              },
                              "anchorTypes": {
                                "type": "array",
                                "items": {
                                  "type": "number"
                                },
                                "description": "TikTok’s type codes for the links attached to the post: 35 a product link (always with isECVideo 1), 54 an editing-app link, 28 an effect link. Other codes are passed through as TikTok sends them. Empty when no links are attached."
                              }
                            }
                          },
                          "createdRegion": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "The two-letter region TikTok records this post as created in, such as \"US\". Filled on video-detail; on user-videos, search-videos and hashtag-videos it is null unless the request has include: [\"createdRegion\"]. Not the account’s region."
                          },
                          "language": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "The language TikTok assigned to the caption, or null."
                          },
                          "exactStats": {
                            "type": [
                              "object",
                              "null"
                            ],
                            "additionalProperties": true,
                            "description": "Only with include [\"exactStats\"]: the exact counts — playCount, diggCount, commentCount, shareCount and collectCount — as whole numbers, never rounded, where stats rounds from 10,000 up. null, with a note, when they could not be filled. Exact counts are filled for nearly all posts — about 19 in 20 resolve, most on the first ask. The rest come back null with a note; asking again later can fill them. A miss is a normal 200, not an error: the video comes back in full with its usual stats (six counts, including repostCount) and roundedStats, and exactStats, isAdsNative, brandedContentType and accountRegion are present and null, with a note — so check exactStats === null rather than the HTTP status. exactStats has five counts; it has no repostCount. On a list, a page can be partly filled: a note gives how many videos are null, and video-detail can fill those one at a time. The notes read, verbatim: “The exact counts could not be found for this video, so exactStats and accountRegion are null; ask again shortly.”; when your timeoutMs ran out first, “The exact counts could not be filled in time, so exactStats and accountRegion are null; ask again, or allow more time.”; on a list, “The exact counts could not be filled for N of these M videos in time, so exactStats is null for them; ask again or use video-detail for those videos.”; and when only the region is missing, “The exact counts were filled, but this account’s registered region did not come with them, so accountRegion is null.”",
                            "properties": {
                              "playCount": {
                                "type": "integer",
                                "description": "Exact views."
                              },
                              "diggCount": {
                                "type": "integer",
                                "description": "Exact likes."
                              },
                              "commentCount": {
                                "type": "integer",
                                "description": "Exact comments."
                              },
                              "shareCount": {
                                "type": "integer",
                                "description": "Exact shares."
                              },
                              "collectCount": {
                                "type": "integer",
                                "description": "Exact saves."
                              }
                            }
                          },
                          "isAdsNative": {
                            "type": [
                              "boolean",
                              "null"
                            ],
                            "description": "Only with include [\"exactStats\"]: TikTok’s own ad marker for the post. true is rare; false and null are what nearly every post carries."
                          },
                          "brandedContentType": {
                            "type": [
                              "integer",
                              "null"
                            ],
                            "description": "Only with include [\"exactStats\"]: TikTok’s numeric branded-content type — 0 none, 1 paid partnership, 7 commission; other codes come through as TikTok sends them (4 has been seen). null when not filled."
                          },
                          "accountRegion": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Only with include [\"exactStats\"]: the two-letter region TikTok records the account as registered in, such as \"US\" — the account’s own country. Not where this post was made (createdRegion), and not where the account’s recent videos were posted (postingRegion on user-profile); the three can differ. null, with a note, when no region came with the exact counts, so exactStats can be filled while this is null."
                          },
                          "missingFields": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            },
                            "description": "Only on a request with include: the fields asked for (exactStats, accountRegion, createdRegion) that this video was left without, and assets when its media could not be read (its assets list is then empty); empty when it has them all. A field TikTok does not publish for the post, such as a post with no recorded created-in region, is not listed."
                          }
                        }
                      },
                      "description": "The videos TikTok lists under it. What TikTok lists for a hashtag: popular posts first, not newest first — a post published a minute ago can sit behind years-old ones, and there is no date order. Only roughly the top 170 to 200 posts, then TikTok says there are no more, even for hashtags with millions of posts. A topic feed: between a quarter and nine tenths of the listed posts carry the tag in their own caption (each video’s hashtags says which). Two requests a minute apart share about 70–95% of their posts, in a somewhat different order; most of the rest are older posts TikTok rotates in and out of its selection. Empty for a hashtag with no public videos, with the note \"This hashtag has no public videos.\" TikTok ends the list for a few very broad hashtags after a handful of videos (#fyp lists 1 to 3); the response then has hasMore false and a note giving both numbers."
                    },
                    "incremental": {
                      "type": "object",
                      "additionalProperties": true,
                      "description": "Present only when since, knownIds, lastPollAt, within, requireHashtag, pollState or includeSearch is set: scannedCount (posts checked in the hashtag’s list, returned or not), excludedCount (left out because they were in knownIds, posted before since or the within window, or did not carry the hashtag with requireHashtag), excludedOlderCount (of those, the ones posted before since or the window), olderFloorAt (where the within window started, ISO 8601; null without within), newlyPublishedCount and newlyAppearedCount. videoCount then counts only the posts returned. limit counts posts returned, not those left out, and pages still bounds how far down the list a request goes. These options narrow what TikTok lists; they cannot find a new post TikTok does not list. When nothing new is listed, videos is empty with a note, and that is the answer, not a failure.",
                      "properties": {
                        "scannedCount": {
                          "type": "integer",
                          "description": "Posts checked in the hashtag’s list, returned or not."
                        },
                        "excludedCount": {
                          "type": "integer",
                          "description": "Left out because they were in knownIds, posted before since or the within window, or did not carry the hashtag with requireHashtag."
                        },
                        "bySource": {
                          "type": "object",
                          "additionalProperties": true,
                          "description": "Present only with includeSearch: the posts checked and returned from each source, as list and search.",
                          "properties": {
                            "list": {
                              "type": "object",
                              "properties": {
                                "scannedCount": {
                                  "type": "integer",
                                  "description": "Posts checked from the hashtag’s list."
                                },
                                "returnedCount": {
                                  "type": "integer",
                                  "description": "Of those, posts returned."
                                }
                              },
                              "additionalProperties": false
                            },
                            "search": {
                              "type": "object",
                              "properties": {
                                "scannedCount": {
                                  "type": "integer",
                                  "description": "Posts checked from the search for the hashtag."
                                },
                                "returnedCount": {
                                  "type": "integer",
                                  "description": "Of those, posts returned."
                                }
                              },
                              "additionalProperties": false
                            }
                          }
                        },
                        "excludedOffTopicCount": {
                          "type": "integer",
                          "description": "Of excludedCount, the posts left out by requireHashtag for not carrying the hashtag in their own caption."
                        },
                        "excludedOlderCount": {
                          "type": "integer",
                          "description": "Of excludedCount, those posted before since or the within window."
                        },
                        "olderFloorAt": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "Where the within window started, as an ISO 8601 date-time; posts published before it were left out. null without within."
                        },
                        "newlyPublishedCount": {
                          "type": "integer",
                          "description": "Returned posts with newlyPublished true."
                        },
                        "newlyAppearedCount": {
                          "type": "integer",
                          "description": "Returned posts with newlyPublished false."
                        }
                      }
                    },
                    "complete": {
                      "type": "boolean",
                      "description": "Only on a request with include: true when every video has every field asked for. A 200 with complete false still carries every video: count it as a delivered response with fields to ask for again, not as a failure."
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": true,
                        "properties": {
                          "field": {
                            "type": "string",
                            "description": "exactStats, accountRegion, createdRegion or assets. assets counts the videos whose media could not be read, so their assets list is empty; ask again for them. exactStats missing means isAdsNative, brandedContentType and accountRegion are null too; accountRegion on its own means the exact counts filled and only the account’s region did not come with them."
                          },
                          "count": {
                            "type": "integer",
                            "description": "How many videos were left without that field, for that reason."
                          },
                          "reason": {
                            "type": "string",
                            "description": "time_limit: the time limit ran out before it was filled (your timeoutMs, or the default when you set none); ask again, or allow more time. not_found: it was looked up and not found this time; ask again later. failed: the lookup failed; ask again. unavailable: not offered on this request. New reasons may be added, so treat an unknown one as “not filled”. createdRegion is only ever time_limit or failed; accountRegion is only ever not_found; assets is only ever failed; exactStats can carry any of the four."
                          }
                        }
                      },
                      "description": "Only on a request with include: one entry per field and reason, as {field, count, reason}, counting the videos left without it; empty when complete."
                    },
                    "videoCount": {
                      "type": "number",
                      "description": "How many videos are in this response, list and search posts alike. credits is what the request is billed for them."
                    },
                    "hasMore": {
                      "type": "boolean",
                      "description": "Whether more results exist beyond what was returned."
                    },
                    "nextCursor": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "An opaque token (tt1.…) to pass back unchanged as cursor, with the same request, to continue exactly where this response stopped. Continuing never repeats or skips a video: with sort latest on user-videos, every video comes back once, newest first. With sort popular, on search and on hashtags the same holds at each boundary, but TikTok can re-rank between requests, so keep the ids you have if every video exactly once across a long walk matters. null when there is nothing further."
                    },
                    "nextPollState": {
                      "type": "string",
                      "description": "Present only when the request sent pollState: send it as pollState on your next poll of this hashtag."
                    },
                    "stopReason": {
                      "type": "string",
                      "description": "Why the list stopped. With a nextCursor to continue: limit (as many posts as limit asked for), pages (the pages limit was reached), time (your timeoutMs would not fit another page), interrupted (TikTok did not return the next page). Without one: end (the end of what TikTok lists for this hashtag, at most about 170–200 posts). cut_short: TikTok ended the list early, well short of what it reports for the hashtag. Asking again often returns more, and when this response got any posts it carries a nextCursor that continues from where it stopped, with hasMore true; a continuation that gets nothing ends without one. When a list is cut short, follow its nextCursor once. If that continuation comes back with no posts and cut_short (and no cursor), do not repeat it: TikTok stopped listing the hashtag there for this request. Wait a little and poll the hashtag again from the start, with your latest pollState if you use one; the list changes between requests, and a later poll usually goes deeper. A request whose list is cut short has already been retried up to twice before it answers."
                    },
                    "credits": {
                      "type": "integer",
                      "description": "What this request is billed: 1 credit per page of up to 30 posts delivered; minimum 1 credit per request (a poll delivering nothing new costs the base request charge). The whole list of a hashtag (about 170 posts) is about 6; a poll that delivers a few new posts is 1–2; a poll with nothing new is 1. Every request is billed at least 1, including a repeated request and a continuation with a cursor."
                    }
                  },
                  "additionalProperties": false
                },
                "examples": {
                  "default": {
                    "value": {
                      "transport": "tiktok",
                      "notes": [],
                      "pagesFetched": 1,
                      "hashtag": {
                        "id": "3301",
                        "name": "nasa",
                        "url": "https://www.tiktok.com/tag/nasa",
                        "description": null,
                        "coverUrl": null,
                        "viewCount": 57143791248,
                        "videoCount": 1952955,
                        "roundedStats": []
                      },
                      "videos": [
                        {
                          "id": "7686148096895569165",
                          "url": "https://www.tiktok.com/@nasa/video/7686148096895569165",
                          "description": "Turns out you can dance in space! 🪩🕺💫🛰️ Microgravity just unlocked some new moves.",
                          "createdAt": "2026-09-16T15:00:41.000Z",
                          "durationSeconds": 58,
                          "isPhotoPost": false,
                          "coverUrl": "https://p19-common-sign.tiktokcdn-us.com/tos-useast5-p-0068-tx/...",
                          "assets": [
                            {
                              "kind": "video",
                              "url": "https://v16-webapp-prime.us.tiktok.com/video/tos/useast5/...",
                              "width": 720,
                              "height": 1280,
                              "downloadUrl": "https://api.fetchlayer.dev/tiktok/media?video=7686148096895569165"
                            }
                          ],
                          "stats": {
                            "playCount": 27600,
                            "diggCount": 4367,
                            "commentCount": 173,
                            "shareCount": 104,
                            "collectCount": 273,
                            "repostCount": 0
                          },
                          "roundedStats": [
                            "playCount"
                          ],
                          "author": {
                            "id": "7664638705177150477",
                            "uniqueId": "nasa",
                            "nickname": "NASA",
                            "verified": true,
                            "privateAccount": false,
                            "profileUrl": "https://www.tiktok.com/@nasa"
                          },
                          "music": {
                            "id": "7686148224364694286",
                            "title": "original sound - NASA",
                            "authorName": "NASA",
                            "durationSeconds": 58,
                            "original": false,
                            "url": "https://www.tiktok.com/music/x-7686148224364694286"
                          },
                          "hashtags": [],
                          "mentions": [],
                          "mentionedUsers": [],
                          "hashtagDetails": [],
                          "isAd": false,
                          "language": "en",
                          "isPaidPartnership": false,
                          "isShoppable": false,
                          "commercialSignals": {
                            "adLabelVersion": null,
                            "brandOrganicType": null,
                            "isECVideo": null,
                            "adAuthorization": null,
                            "anchorTypes": []
                          },
                          "createdRegion": null
                        }
                      ],
                      "videoCount": 30,
                      "hasMore": true,
                      "nextCursor": "tt1.eyJyIjoiaHYiLCJrIjoibmFzYSIsImMiOiIzMCJ9",
                      "stopReason": "limit",
                      "credits": 1
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "invalid_input: the request needs fixing; error names the field.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized: the API key is missing or not valid.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "insufficient_credits: no credits, trial or monthly allowance left.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "forbidden: this key or account is not allowed this request.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "quota_exceeded: a request-rate limit was reached.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "temporarily_unavailable, time_limit or (on a store route) store_unreachable: ask again (with time_limit, allow more time). Retryable.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/resolve-url": {
      "post": {
        "operationId": "resolve-url",
        "tags": [
          "Utilities"
        ],
        "summary": "Parse a TikTok URL (free)",
        "description": "What a TikTok link points to — a video, account, hashtag, sound or search — and the id, username, tag or query it carries, ready for the other routes. Free: it costs no credit.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "url": {
                    "type": "string",
                    "description": "Any TikTok link, with or without https://: a video (an /embed/v2/ link included), an account, a hashtag, a sound or a search. A short share link (vm.tiktok.com, vt.tiktok.com, tiktok.com/t/…) does not say what it points to, so it comes back as unknown with a note to open it and pass the full URL."
                  },
                  "format": {
                    "type": "string",
                    "description": "json or markdown, in any case; any other value is a 400. Over MCP, markdown returns the result rendered as text; the REST API accepts it and returns JSON.",
                    "example": "json"
                  },
                  "timeoutMs": {
                    "type": "integer",
                    "description": "Time limit for the whole request, in milliseconds (1000–120000); a value outside that range is a 400. When it runs out, a paged request returns what it has with nextCursor, billed for the pages it returned; a request with nothing to return yet fails with a 503 you can retry, marked with the response header X-Timeout-Source: caller. Left out, the request runs as long as it needs."
                  }
                },
                "additionalProperties": false,
                "required": [
                  "url"
                ]
              },
              "examples": {
                "default": {
                  "value": {
                    "url": "https://www.tiktok.com/@nasa/video/7686148096895569165"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "transport": {
                      "type": "string",
                      "description": "The data source: always the platform id, \"tiktok\"."
                    },
                    "notes": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "Caveats you can act on — a private account, comments turned off, a list that ran out early, paging that has gone as deep as it goes. Empty when there are none. An empty result always comes with a note explaining it, never as an unexplained empty array."
                    },
                    "pagesFetched": {
                      "type": "number",
                      "description": "Pages of results fetched, which is what the request costs: one credit per page. resolve-url reports 0 and is not billed."
                    },
                    "kind": {
                      "type": "string",
                      "description": "One of video, user, hashtag, music, search or unknown."
                    },
                    "canonicalUrl": {
                      "type": "string",
                      "description": "The link in its canonical form, or null."
                    },
                    "videoId": {
                      "type": "string",
                      "description": "The video id, when the link points at one."
                    },
                    "username": {
                      "type": "string",
                      "description": "The account handle, when the link carries one."
                    },
                    "hashtagName": {
                      "type": "string",
                      "description": "The tag, when the link points at a hashtag."
                    },
                    "musicId": {
                      "type": "string",
                      "description": "The sound id, when the link points at a sound."
                    },
                    "query": {
                      "type": "string",
                      "description": "The search term, when the link is a search."
                    }
                  },
                  "additionalProperties": false
                },
                "examples": {
                  "default": {
                    "value": {
                      "transport": "tiktok",
                      "notes": [],
                      "pagesFetched": 0,
                      "kind": "video",
                      "canonicalUrl": "https://www.tiktok.com/@nasa/video/7686148096895569165",
                      "videoId": "7686148096895569165",
                      "username": "nasa",
                      "hashtagName": null,
                      "musicId": null,
                      "query": null
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "invalid_input: the request needs fixing; error names the field.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized: the API key is missing or not valid.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "insufficient_credits: no credits, trial or monthly allowance left.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "forbidden: this key or account is not allowed this request.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "quota_exceeded: a request-rate limit was reached.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "temporarily_unavailable, time_limit or (on a store route) store_unreachable: ask again (with time_limit, allow more time). Retryable.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    },
    "/media": {
      "get": {
        "operationId": "media",
        "tags": [
          "Utilities"
        ],
        "summary": "Download a video, image or cover",
        "description": "Delivers one file from a downloadUrl: a video as an MP4 without the TikTok watermark, or a photo-post frame, cover or avatar, with Range support so players can seek and downloads can resume. Pass exactly one of video or url. Each request costs 1 credit, a range request included.",
        "parameters": [
          {
            "name": "video",
            "in": "query",
            "required": false,
            "description": "A video id, as a video asset’s downloadUrl names it. Returns the video as MP4 (H.264 and AAC) at the quality TikTok streams by default, usually 720p, with no size limit. The first request for a video takes about 1.5–3 seconds before the first byte; further requests for it within about 20 minutes start in well under a second. 403 \"The creator has turned off downloads for this video.\" when the creator has turned off downloads (its downloadUrl is then null); 404 for a photo post, whose images are its assets, or a video that is not public; 503 means try again after a short wait.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "url",
            "in": "query",
            "required": false,
            "description": "An image or cover URL, as an image asset’s downloadUrl names it, or a coverUrl or avatarUrl. Only TikTok’s own media hosts; anything else is a 400. An expired or removed image is a 404, \"that media is no longer available on TikTok; read the record again for a fresh link\". A video’s own url is a 404 that says to use the video’s downloadUrl instead.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/octet-stream": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "400": {
            "description": "invalid_input: the request needs fixing; error names the field.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "unauthorized: the API key is missing or not valid.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "insufficient_credits: no credits, trial or monthly allowance left.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "forbidden: this key or account is not allowed this request.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "quota_exceeded: a request-rate limit was reached.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "temporarily_unavailable, time_limit or (on a store route) store_unreachable: ask again (with time_limit, allow more time). Retryable.",
            "headers": {
              "X-Request-Id": {
                "description": "The request id, equal to requestId in the body.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ]
      }
    }
  }
}