> ## Documentation Index
> Fetch the complete documentation index at: https://docs.drain.lat/llms.txt
> Use this file to discover all available pages before exploring further.

# TikTok

> Fetch public TikTok profile data including follower counts, bio, and account info.

# TikTok

**Base URL:** `https://drain.lat/api/v1/tiktok`

<AccordionGroup>
  <Accordion title="GET /profile/:username" icon="user">
    Fetch a public TikTok profile. Works with or without the `@` symbol.

    ```
    GET /api/v1/tiktok/profile/:username
    ```

    <ParamField path="username" type="string" required>
      TikTok username. The `@` prefix is optional.
    </ParamField>

    <CodeGroup>
      ```bash cURL theme={null}
      curl "https://drain.lat/api/v1/tiktok/profile/charlidamelio" \
        -H "x-api-key: YOUR_API_KEY"
      ```

      ```javascript JavaScript theme={null}
      const res = await fetch("https://drain.lat/api/v1/tiktok/profile/charlidamelio", {
        headers: { "x-api-key": "YOUR_API_KEY" }
      });
      const data = await res.json();
      ```

      ```python Python theme={null}
      import requests

      res = requests.get(
          "https://drain.lat/api/v1/tiktok/profile/charlidamelio",
          headers={"x-api-key": "YOUR_API_KEY"}
      )
      print(res.json())
      ```
    </CodeGroup>

    <ResponseField name="id" type="string">TikTok user ID.</ResponseField>
    <ResponseField name="username" type="string">TikTok username.</ResponseField>
    <ResponseField name="displayName" type="string">Display name shown on profile.</ResponseField>
    <ResponseField name="bio" type="string">Profile bio.</ResponseField>
    <ResponseField name="avatarUrl" type="string">Avatar image URL.</ResponseField>
    <ResponseField name="verified" type="boolean">Whether the account is verified.</ResponseField>
    <ResponseField name="isPrivate" type="boolean">Whether the account is private.</ResponseField>
    <ResponseField name="region" type="string">Account region code (e.g. `US`).</ResponseField>
    <ResponseField name="bioLink" type="string">Link in bio URL.</ResponseField>
    <ResponseField name="followers" type="number">Follower count.</ResponseField>
    <ResponseField name="following" type="number">Following count.</ResponseField>
    <ResponseField name="likes" type="number">Total likes received.</ResponseField>
    <ResponseField name="videoCount" type="number">Number of videos posted.</ResponseField>
    <ResponseField name="profileUrl" type="string">Link to the TikTok profile.</ResponseField>

    ```json Response theme={null}
    {
      "id": "6868786954978230278",
      "username": "charlidamelio",
      "displayName": "charli d'amelio",
      "bio": "just a girl who loves to dance",
      "avatarUrl": "https://p16-sign-va.tiktokcdn.com/...",
      "verified": true,
      "isPrivate": false,
      "region": "US",
      "bioLink": "",
      "followers": 155400000,
      "following": 1012,
      "likes": 11200000000,
      "videoCount": 2341,
      "profileUrl": "https://www.tiktok.com/@charlidamelio",
      "scrapedAt": "2026-05-05T12:00:00.000Z"
    }
    ```
  </Accordion>

  <Accordion title="GET /profile/:username/videos" icon="film">
    Get a user's recent videos.

    ```
    GET /api/v1/tiktok/profile/:username/videos
    ```

    <ParamField path="username" type="string" required>
      TikTok username. The `@` prefix is optional.
    </ParamField>

    <CodeGroup>
      ```bash cURL theme={null}
      curl "https://drain.lat/api/v1/tiktok/profile/charlidamelio/videos" \
        -H "x-api-key: YOUR_API_KEY"
      ```

      ```javascript JavaScript theme={null}
      const res = await fetch("https://drain.lat/api/v1/tiktok/profile/charlidamelio/videos", {
        headers: { "x-api-key": "YOUR_API_KEY" }
      });
      const data = await res.json();
      ```

      ```python Python theme={null}
      import requests

      res = requests.get(
          "https://drain.lat/api/v1/tiktok/profile/charlidamelio/videos",
          headers={"x-api-key": "YOUR_API_KEY"}
      )
      print(res.json())
      ```
    </CodeGroup>

    <ResponseField name="username" type="string">TikTok username.</ResponseField>

    <ResponseField name="videos" type="array">
      <Expandable title="video object">
        <ResponseField name="id" type="string">Video ID.</ResponseField>
        <ResponseField name="description" type="string">Video caption.</ResponseField>
        <ResponseField name="createTime" type="string">Upload date (ISO 8601).</ResponseField>
        <ResponseField name="cover" type="string">Cover image URL.</ResponseField>
        <ResponseField name="duration" type="number">Duration in seconds.</ResponseField>
        <ResponseField name="plays" type="number">Play count.</ResponseField>
        <ResponseField name="likes" type="number">Like count.</ResponseField>
        <ResponseField name="comments" type="number">Comment count.</ResponseField>
        <ResponseField name="shares" type="number">Share count.</ResponseField>
        <ResponseField name="url" type="string">Link to the video.</ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="total" type="number">Number of videos returned.</ResponseField>

    ```json Response theme={null}
    {
      "username": "charlidamelio",
      "videos": [
        {
          "id": "7123456789",
          "description": "pov you found this",
          "createTime": "2026-04-01T12:00:00.000Z",
          "cover": "https://...",
          "duration": 15,
          "plays": 4200000,
          "likes": 380000,
          "comments": 12000,
          "shares": 45000,
          "url": "https://www.tiktok.com/@charlidamelio/video/7123456789"
        }
      ],
      "total": 20,
      "scrapedAt": "2026-05-08T10:00:00.000Z"
    }
    ```
  </Accordion>

  <Accordion title="GET /video/:videoId" icon="play">
    Get info and stats for a single TikTok video.

    ```
    GET /api/v1/tiktok/video/:videoId
    ```

    <ParamField path="videoId" type="string" required>
      The TikTok video ID.
    </ParamField>

    <CodeGroup>
      ```bash cURL theme={null}
      curl "https://drain.lat/api/v1/tiktok/video/7123456789" \
        -H "x-api-key: YOUR_API_KEY"
      ```

      ```javascript JavaScript theme={null}
      const res = await fetch("https://drain.lat/api/v1/tiktok/video/7123456789", {
        headers: { "x-api-key": "YOUR_API_KEY" }
      });
      const data = await res.json();
      ```

      ```python Python theme={null}
      import requests

      res = requests.get(
          "https://drain.lat/api/v1/tiktok/video/7123456789",
          headers={"x-api-key": "YOUR_API_KEY"}
      )
      print(res.json())
      ```
    </CodeGroup>

    <ResponseField name="id" type="string">Video ID.</ResponseField>
    <ResponseField name="description" type="string">Video caption.</ResponseField>
    <ResponseField name="createTime" type="string">Upload date (ISO 8601).</ResponseField>

    <ResponseField name="author" type="object">
      <Expandable title="author object">
        <ResponseField name="id" type="string">Author user ID.</ResponseField>
        <ResponseField name="username" type="string">Author username.</ResponseField>
        <ResponseField name="displayName" type="string">Author display name.</ResponseField>
        <ResponseField name="avatarUrl" type="string">Author avatar URL.</ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="stats" type="object">
      <Expandable title="stats object">
        <ResponseField name="plays" type="number">Play count.</ResponseField>
        <ResponseField name="likes" type="number">Like count.</ResponseField>
        <ResponseField name="comments" type="number">Comment count.</ResponseField>
        <ResponseField name="shares" type="number">Share count.</ResponseField>
        <ResponseField name="bookmarks" type="number">Bookmark count.</ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="video" type="object">
      <Expandable title="video object">
        <ResponseField name="duration" type="number">Duration in seconds.</ResponseField>
        <ResponseField name="ratio" type="string">Aspect ratio (e.g. `9:16`).</ResponseField>
        <ResponseField name="cover" type="string">Cover image URL.</ResponseField>
        <ResponseField name="downloadUrl" type="string">Direct download URL.</ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="music" type="object">
      <Expandable title="music object">
        <ResponseField name="id" type="string">Music ID.</ResponseField>
        <ResponseField name="title" type="string">Track title.</ResponseField>
        <ResponseField name="author" type="string">Track author.</ResponseField>
        <ResponseField name="coverUrl" type="string">Music cover image URL.</ResponseField>
        <ResponseField name="duration" type="number">Track duration in seconds.</ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="url" type="string">Link to the video.</ResponseField>

    ```json Response theme={null}
    {
      "id": "7123456789",
      "description": "pov you found this",
      "createTime": "2026-04-01T12:00:00.000Z",
      "author": {
        "id": "123456",
        "username": "charlidamelio",
        "displayName": "charli d'amelio",
        "avatarUrl": "https://..."
      },
      "stats": {
        "plays": 4200000,
        "likes": 380000,
        "comments": 12000,
        "shares": 45000,
        "bookmarks": 9000
      },
      "video": {
        "duration": 15,
        "ratio": "9:16",
        "cover": "https://...",
        "downloadUrl": "https://..."
      },
      "music": {
        "id": "987654",
        "title": "original sound",
        "author": "charlidamelio",
        "coverUrl": "https://...",
        "duration": 15
      },
      "url": "https://www.tiktok.com/@charlidamelio/video/7123456789",
      "scrapedAt": "2026-05-08T10:00:00.000Z"
    }
    ```
  </Accordion>
</AccordionGroup>
