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

# Get TikTok Video

> Retrieves detailed information about a specific TikTok video.

## Description

This endpoint allows you to fetch comprehensive metadata about a specific TikTok video, including video details, author information, statistics, music, hashtag challenges, and more.

## Endpoint

**POST** `/api/v1/get-tiktok-video`

## Request Headers

| Header          | Type   | Description                                       |
| :-------------- | :----- | :------------------------------------------------ |
| `Content-Type`  | string | Must be `application/json`.                       |
| `Authorization` | string | Your API key (Bearer token). e.g. `Bearer sk_xxx` |

## Request Body

| Parameter       | Type   | Description                                                              | Required | Default |
| :-------------- | :----- | :----------------------------------------------------------------------- | :------- | :------ |
| `url`           | string | The full TikTok video URL.                                               | Yes      |         |
| `requestSource` | string | Optional. Source of the request (e.g., `MAKE_DOT_COM`, `ZAPIER`, `API`). | No       | `API`   |

<Info>
  The `url` must be a valid TikTok video URL, e.g., `https://www.tiktok.com/@username/video/1234567890` or `https://vm.tiktok.com/ZMhKxyz/`
</Info>

## Responses

### Success (200 OK)

Returns comprehensive video information including metadata, statistics, author details, music, and challenges.

```json theme={null}
{
  "id": "7321234567890123456",
  "desc": "This is the video description with #hashtags",
  "createTime": 1704067200,
  "createTimeISO": "2024-01-01T00:00:00.000Z",
  "video": {
    "id": "v123",
    "height": 1024,
    "width": 576,
    "duration": 15,
    "ratio": "720p",
    "cover": "https://...jpg",
    "downloadAddr": "https://...mp4",
    "playAddr": "https://...mp4",
    "format": "mp4",
    "bitrate": 1234567
  },
  "author": {
    "id": "6659752019493208069",
    "uniqueId": "username",
    "nickname": "Display Name",
    "avatarThumb": "https://...jpeg",
    "signature": "User bio text",
    "verified": true,
    "privateAccount": false
  },
  "music": {
    "id": "7123456789",
    "title": "Song Title",
    "playUrl": "https://...mp3",
    "authorName": "Artist Name",
    "original": false,
    "duration": 15
  },
  "challenges": [
    {
      "id": "123456",
      "title": "hashtagname",
      "desc": "Hashtag description",
      "coverThumb": "https://...jpeg"
    }
  ],
  "stats": {
    "diggCount": 12345,
    "shareCount": 678,
    "commentCount": 234,
    "playCount": 567890,
    "collectCount": 123
  },
  "textExtra": [
    {
      "hashtagName": "hashtag1",
      "hashtagId": "123",
      "start": 10,
      "end": 19
    }
  ],
  "duetEnabled": true,
  "stitchEnabled": true,
  "shareEnabled": true
}
```

**Response Headers:**

* `Content-Type: application/json`

- **X-RateLimit-Limit:** The rate limit for the user.
- **X-RateLimit-Remaining:** The remaining number of requests for the user.

### Error Responses

#### 400 Bad Request

Indicates an issue with the request parameters.

```json theme={null}
{
  "error": "'url' parameter is required and must be a non-empty string."
}
```

Possible error messages:

* `Invalid JSON in request body`
* `'url' parameter is required and must be a non-empty string.`
* `Invalid TikTok video URL format.`
* `The video service could not process the provided URL.`
* `The video service reported an issue.`

#### 401 Unauthorized

API key is missing, invalid, or inactive.

```json theme={null}
{
  "error": "API key is invalid or missing."
}
```

#### 403 Forbidden

API key does not have enough credits.

```json theme={null}
{
  "error": "Insufficient credits. Please top up your account."
}
```

#### 404 Not Found

The requested TikTok video could not be found.

```json theme={null}
{
  "error": "TikTok video not found for URL: [url]"
}
```

#### 500 Internal Server Error

An unexpected error occurred on the server.

```json theme={null}
{
  "error": "An unexpected server error occurred while fetching the TikTok video: [specific error message]"
}
```

Possible error messages:

* `Service not configured. Please contact support.`
* `Service authentication failed. Please contact support.`
* `An unexpected server error occurred...`

#### 502 Bad Gateway

Indicates an issue with an upstream service.

```json theme={null}
{
  "error": "Received invalid data structure from video service."
}
```

Possible error messages:

* `The video service is currently unavailable.`
* `Received invalid data structure from video service.`
* `Error fetching video data from the upstream service.`

#### 503 Service Unavailable

Rate limit exceeded with an upstream service.

```json theme={null}
{
  "error": "Rate limit exceeded. Please try again later."
}
```

## Example Request

### cURL

```bash theme={null}
curl -X POST \
  https://app.dumplingai.com/api/v1/get-tiktok-video \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{ "url": "https://www.tiktok.com/@username/video/7321234567890123456" }'
```

### Node.js (fetch)

```javascript theme={null}
async function getTikTokVideo(apiKey, url) {
  const endpoint = 'https://app.dumplingai.com/api/v1/get-tiktok-video';
  const options = {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
      'Authorization': `Bearer ${apiKey}`
    },
    body: JSON.stringify({ url })
  };

  try {
    const response = await fetch(endpoint, options);
    const data = await response.json();
    if (!response.ok) {
      console.error(`Error: ${response.status}`, data);
      return null;
    }
    console.log('Video ID:', data.id);
    console.log('Author:', data.author.uniqueId);
    console.log('Stats:', data.stats);
    return data;
  } catch (error) {
    console.error('Failed to fetch TikTok video:', error);
    return null;
  }
}

// Example usage:
// getTikTokVideo('YOUR_API_KEY', 'https://www.tiktok.com/@username/video/7321234567890123456');
```

## Notes

* The response includes comprehensive video metadata suitable for analytics, content management, and monitoring.
* Video statistics include views (playCount), likes (diggCount), comments, shares, and saves (collectCount).
* The `textExtra` array provides detailed information about hashtags mentioned in the video description with their positions.
* Music information is included when the video uses a soundtrack.
* Challenge/hashtag data includes cover images and descriptions.

## Credit Cost

This endpoint costs **10 credits** per successful request. For more details, see our [Credit Costs](/api-reference/credit-costs) page.

## Rate Limiting

This endpoint is subject to standard API rate limits. Check the `X-RateLimit-Limit` and `X-RateLimit-Remaining` headers in the response to monitor your usage.


## OpenAPI

````yaml POST /api/v1/get-tiktok-video
openapi: 3.0.3
info:
  title: DumplingAI API
  version: 1.0.0
  description: >
    REST API for DumplingAI's content intelligence and automation platform.

    All endpoints are grouped under `/api/v1`; most are secured via Bearer API
    keys unless an operation explicitly sets `security: []`.
servers:
  - url: https://app.dumplingai.com
    description: Production
security:
  - bearerAuth: []
tags:
  - name: YouTube
    description: Access metadata, search results, and transcripts from YouTube.
  - name: TikTok
    description: Retrieve TikTok profile, video, follower, and transcript data.
  - name: LinkedIn
    description: Programmatically fetch LinkedIn company and profile data.
  - name: Search
    description: Search-orientated endpoints spanning web, news, maps, and autocomplete.
  - name: Google
    description: Integrations with Google business listings and location data.
  - name: Scraping
    description: Webpage capture, crawling, and structured content extraction utilities.
  - name: Documents
    description: Document processing, conversion, and metadata utilities.
  - name: AI
    description: DumplingAI agent and knowledge base endpoints.
  - name: Developer Tools
    description: Utilities for executing sandboxed code via API.
paths:
  /api/v1/get-tiktok-video:
    post:
      tags:
        - TikTok
      summary: Get TikTok video
      description: >-
        Retrieve metadata, author details, and engagement stats for a TikTok
        video URL.
      operationId: getTikTokVideo
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TikTokVideoRequest'
            examples:
              default:
                summary: Fetch video details
                value:
                  url: >-
                    https://www.tiktok.com/@stoolpresidente/video/7556301577875639583
      responses:
        '200':
          description: TikTok video retrieved.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TikTokVideoResponse'
        '400':
          description: Invalid request payload.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Missing or invalid API key.
        '403':
          description: Insufficient credits to fulfill the request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Video not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Unexpected server error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '502':
          description: Upstream video service returned an error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    TikTokVideoRequest:
      type: object
      required:
        - url
      properties:
        url:
          type: string
          format: uri
        requestSource:
          $ref: '#/components/schemas/RequestSource'
    TikTokVideoResponse:
      type: object
      properties:
        id:
          type: string
        desc:
          type: string
        createTime:
          type: integer
          nullable: true
        createTimeISO:
          type: string
          format: date-time
          nullable: true
        video:
          type: object
          additionalProperties: true
        author:
          type: object
          additionalProperties: true
        music:
          type: object
          additionalProperties: true
        challenges:
          type: array
          items:
            type: object
            additionalProperties: true
        stats:
          type: object
          additionalProperties: true
        textExtra:
          type: array
          items:
            type: object
            additionalProperties: true
      additionalProperties: true
    ErrorResponse:
      type: object
      properties:
        error:
          type: string
          description: Human-readable description of what went wrong.
      required:
        - error
    RequestSource:
      type: string
      description: Optional identifier describing where the API request originated.
      enum:
        - API
        - WEB
        - MAKE_DOT_COM
        - ZAPIER
        - N8N
        - PLAYGROUND
        - DEFAULT_AUTOMATION
        - AGENT_PREVIEW
        - AGENT_LIVE
        - AUTOPILOT
        - STUDIO
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key

````