# TikTok API (`apidojo/tiktok-api`) Actor

Real-time TikTok data over plain HTTP. Get profiles, videos, followers, comments, replies, hashtags, music and location posts, or search videos, as JSON. No TikTok login, no runs to start. $0.003 per successful request, same price for every endpoint.

- **URL**: https://apify.com/apidojo/tiktok-api.md
- **Developed by:** [API Dojo](https://apify.com/apidojo) (community)
- **Features:** Limited permissions, Multi-tenant, Server interface
- **Stats:** 10 total users, 10 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$3.00 / 1,000 api requests

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## 🎵 TikTok API - Real-Time Posts, Profiles, Comments & Hashtags

Call TikTok data like any REST API. This **TikTok API** is an always-on Apify Standby Actor: send a `GET` request, get JSON back. No runs to start, no datasets to poll, no TikTok developer account.

Look up profiles and posts, search videos, and page through followers, followings, comments, replies and posts by hashtag, sound or location. All through 13 simple endpoints.

**💰 Pricing:** $0.003 per successful request | **⚡ Response:** live JSON, no run startup | **🔓 No TikTok login or API key**

***

### 📋 Table of Contents

1. [How It Works](#-how-it-works)
2. [Quick Start](#-quick-start)
3. [Pricing](#-pricing)
4. [Endpoints](#-endpoints)
5. [Pagination](#-pagination)
6. [Response Format](#-response-format)
7. [Errors & Status Codes](#-errors--status-codes)
8. [Code Examples](#-code-examples)
9. [Free Plan](#-free-plan)
10. [Related Actors](#-related-actors)
11. [FAQ](#-frequently-asked-questions)
12. [Contact](#-contact)

***

### 🧭 How It Works

This Actor runs in [Apify Standby mode](https://docs.apify.com/platform/actors/running/standby). Instead of starting a run and waiting for a dataset, you call an HTTP endpoint and get the result in the response.

| | Classic Actor run | This TikTok API (Standby) |
| --- | --- | --- |
| **How you call it** | Start a run, wait, read the dataset | Plain `GET` request |
| **Latency** | Run startup + scraping | Live response, no startup |
| **Result** | Dataset items | JSON in the HTTP response |
| **Billing** | Per run / per item | **Per request** |
| **Best for** | Large batch jobs | Apps, bots, agents, dashboards |

Every endpoint returns one object or one page of results. Use the `cursor` to get the next page.

***

### 🚀 Quick Start

**1. Get your Apify API token** from [Console → Settings → API & Integrations](https://console.apify.com/settings/integrations?fpr=yhdrb).

**2. Call an endpoint:**

```bash
curl "https://apidojo--tiktok-api.apify.actor/user/handle/taylorswift" \
  -H "Authorization: Bearer YOUR_APIFY_TOKEN"
```

**3. Get JSON back:**

```json
{
  "status": 200,
  "message": "OK",
  "data": {
    "id": "6881290705605477381",
    "url": "https://www.tiktok.com/@taylorswift",
    "username": "taylorswift",
    "nickname": "Taylor Swift",
    "followers": 32400000,
    "verified": true,
    "...": "..."
  }
}
```

That's it. That request cost $0.003.

**Authentication:** send your Apify token in the `Authorization: Bearer <token>` header (recommended) or as a `?token=<token>` query parameter. The `Authorization` header is never forwarded to the upstream service.

***

### 💰 Pricing

One flat price, every endpoint.

| Event | Price | When it fires |
| --- | --- | --- |
| **Request** (`request-event`) | **$0.003** per call | Every successful request that returns data |

- **Same price for every endpoint.** A profile lookup and a page of search results cost the same.
- **You only pay for successful responses.** Invalid requests (`400`), not-found results, rate-limit refusals and upstream errors are **not charged**.
- **No platform fees, no compute units, no runs.** Just the per-request price.

#### Cost Examples

| Scenario | Requests | Cost |
| --- | --- | --- |
| Look up 1 profile | 1 | **$0.003** |
| Fetch 100 posts by ID | 100 | **$0.30** |
| Search a keyword, 50 pages deep | 50 | **$0.15** |
| Look up 1,000 profiles | 1,000 | **$3.00** |
| 10,000 calls in a month | 10,000 | **$30.00** |

> Paginated endpoints are charged per page. Following a `cursor` is a new request, so 10 pages = 10 requests = $0.03.

***

### 📚 Endpoints

All endpoints are `GET`. Base URL: `https://apidojo--tiktok-api.apify.actor`

#### 👤 Users

| Endpoint | Description | Params |
| --- | --- | --- |
| `/user/handle/{username}` | Full profile by username | `username` (e.g. `taylorswift`) |
| `/user/{id}/posts` | A user's posts | `id` (e.g. `208464585232822272`), `region`, `cursor` |
| `/user/{id}/followers` | A user's followers | `id`, `cursor` |
| `/user/{id}/followings` | Accounts a user follows | `id`, `cursor` |

#### 🎬 Posts

| Endpoint | Description | Params |
| --- | --- | --- |
| `/post/search` | Search posts by keyword | `keyword` (required), `sortType` (`RELEVANCE`, `MOST_LIKED` or `DATE_POSTED`), `dateRange` (`ALL_TIME`, `YESTERDAY`, `THIS_WEEK`, `THIS_MONTH`, `LAST_THREE_MONTHS` or `LAST_SIX_MONTHS`), `region`, `cursor` |
| `/post/{id}` | Full post by ID | `id` (e.g. `6977747303692078337`), `region` |
| `/post` | Full post by URL, including short `vt.tiktok.com` links | `url` (required, e.g. `https://vt.tiktok.com/ZSDHmaujt/`), `region` (exactly two letters, e.g. `US`) |

#### 💬 Comments

| Endpoint | Description | Params |
| --- | --- | --- |
| `/post/{id}/comments` | Comments on a post | `id`, `cursor` |
| `/post/{id}/comments/{commentId}/replies` | Replies to a comment | `id`, `commentId` (e.g. `6977747558290555649`), `cursor` |

#### #️⃣ Hashtags

| Endpoint | Description | Params |
| --- | --- | --- |
| `/hashtag/handle/{name}` | Hashtag details by name: ID and total views | `name` (without `#`, e.g. `work`) |
| `/hashtag/{id}/posts` | Posts that use a hashtag | `id` (e.g. `6122`), `region`, `cursor` |

#### 🎵 Music

| Endpoint | Description | Params |
| --- | --- | --- |
| `/music/{id}/posts` | Posts that use a sound | `id`, `region`, `cursor` |

#### 📍 Locations

| Endpoint | Description | Params |
| --- | --- | --- |
| `/location/{locationId}/posts` | Posts tagged with a location | `locationId` (e.g. `22535796485353377`), `region`, `cursor` |

> **Tip:** The endpoints that take an `id` need TikTok's numeric ID, not a name. Get a user ID from the `id` field of `/user/handle/{username}`, and a hashtag ID from the `id` field of `/hashtag/handle/{name}`.

`region` is a two-letter country code (e.g. `GB`, `US`). It is optional everywhere. On `/post`, anything that is not two letters is refused with a `400`.

The full OpenAPI spec is available on the Actor's **API** tab in Apify Console.

***

### 🔄 Pagination

Paginated endpoints return a `cursor` with each page. Pass it back to get the next page.

```bash
## Page 1
curl "https://apidojo--tiktok-api.apify.actor/post/search?keyword=nike&sortType=MOST_LIKED" \
  -H "Authorization: Bearer YOUR_APIFY_TOKEN"

## Page 2
curl "https://apidojo--tiktok-api.apify.actor/post/search?keyword=nike&sortType=MOST_LIKED&cursor=CURSOR_FROM_PAGE_1" \
  -H "Authorization: Bearer YOUR_APIFY_TOKEN"
```

Keep the other parameters the same between pages. Stop when the response has no `cursor` or the page comes back empty. Each page is one request ($0.003).

Paginated endpoints: `/user/{id}/posts`, `/user/{id}/followers`, `/user/{id}/followings`, `/post/search`, `/post/{id}/comments`, `/post/{id}/comments/{commentId}/replies`, `/hashtag/{id}/posts`, `/music/{id}/posts` and `/location/{locationId}/posts`.

***

### 📊 Response Format

Every response has the same envelope:

```json
{
  "status": 200,
  "message": "OK",
  "data": { }
}
```

| Endpoint type | `data` contains |
| --- | --- |
| Single profile (`/user/handle/{username}`) | One user object |
| Single post (`/post/{id}`, `/post`) | One post object |
| Hashtag details (`/hashtag/handle/{name}`) | One hashtag object |
| Post lists (user posts, search, hashtag, music, location) | `{ "posts": [...], "cursor": "..." }` |
| Followers | `{ "followers": [...], "cursor": "..." }` |
| Followings | `{ "followings": [...], "cursor": "..." }` |
| Comments | `{ "comments": [...], "cursor": "..." }` |
| Comment replies | `{ "replies": [...], "cursor": "..." }` |

#### Post Object

```json
{
  "id": "6881290705605477381",
  "title": "This is a TikTok video description",
  "views": 1000000,
  "likes": 50000,
  "comments": 1000,
  "shares": 500,
  "bookmarks": 200,
  "hashtags": ["tiktok", "viral", "funny"],
  "channel": {
    "id": "6881290705605477381",
    "name": "Taylor Swift",
    "username": "taylorswift",
    "verified": true,
    "url": "https://www.tiktok.com/@taylorswift",
    "followers": 7813283,
    "following": 72,
    "videos": 1045
  },
  "uploadedAt": 1640995200,
  "uploadedAtFormatted": "2022-01-01T00:00:00.000Z",
  "video": {
    "width": 720,
    "height": 1280,
    "ratio": "9:16",
    "duration": 15.5,
    "url": "https://v16-webapp.tiktok.com/video/tos/alisg/tos-alisg-pve-0037c001-o0/example.mp4",
    "cover": "https://p16-sign-sg.tiktokcdn.com/obj/tos-alisg-p-0037c001/example.jpg"
  },
  "song": {
    "title": "Anti-Hero",
    "artist": "Taylor Swift",
    "album": "Midnights",
    "duration": 201
  },
  "postPage": "https://www.tiktok.com/@taylorswift/video/6881290705605477381"
}
```

Posts can also include `images` (photo posts: `url`, `width`, `height`), `collabInfo` (collaborating accounts), `subtitleInformation` (caption tracks with `language`, `format` and `url`), `channel.bio`, `channel.avatar`, `video.thumbnail`, `song.id` and `song.cover`. `uploadedAt` is a Unix timestamp in seconds.

#### User Object

Key fields: `id`, `url`, `username`, `nickname`, `bio`, `bioUrl`, `followers`, `following`, `likes`, `videos`, `verified`, `avatar`.

#### Follower Object

Returned by `/followers` and `/followings`. Key fields: `id`, `url`, `username`, `nickname`, `bio`, `followers`, `following`, `likes`, `videos`, `verified`, `avatar`, `coverImage`, `region`, `language`, `hasEmail`, `hasPhone`.

#### Comment Object

Returned by `/comments` and `/replies`: `type`, `id`, `text`, `language`, `createdAt`, `createdAtFormatted`, `user` (`id`, `name`, `username`, `avatar`, `verified`, `url`).

#### Hashtag Object

`id`, `name`, `views`.

***

### ⚠️ Errors & Status Codes

Errors use the same envelope, without `data`. **Requests that return no data are not charged.**

| Status | Meaning | Charged? |
| --- | --- | --- |
| `200` | Success | ✅ $0.003 |
| `400` | Invalid parameters. `errors` lists what's wrong | ❌ |
| `404` | Unknown endpoint or nothing found | ❌ |
| `403` | Access not available on your plan or account | ❌ |
| `429` | Monthly free request limit reached | ❌ |
| `502` | Upstream error, safe to retry | ❌ |
| `503` | Plan check temporarily unavailable, retry shortly | ❌ |

Any other status from the upstream service is passed through unchanged. You are charged only when the response contains `data`.

Example `400`:

```json
{
  "status": 400,
  "message": "Bad request",
  "errors": ["query.region: region must be a two-letter country code"]
}
```

***

### 💻 Code Examples

#### cURL

```bash
curl "https://apidojo--tiktok-api.apify.actor/post/6977747303692078337" \
  -H "Authorization: Bearer YOUR_APIFY_TOKEN"
```

#### Python

```python
import requests

BASE = "https://apidojo--tiktok-api.apify.actor"
HEADERS = {"Authorization": "Bearer YOUR_APIFY_TOKEN"}

def search_posts(keyword, pages=5):
    posts, cursor = [], None
    for _ in range(pages):
        params = {"keyword": keyword, "sortType": "DATE_POSTED"}
        if cursor:
            params["cursor"] = cursor
        res = requests.get(f"{BASE}/post/search", headers=HEADERS, params=params, timeout=300).json()
        data = res.get("data") or {}
        posts += data.get("posts", [])
        cursor = data.get("cursor")
        if not cursor or not data.get("posts"):
            break
    return posts

print(len(search_posts("nike", pages=3)))  # max 3 requests = $0.009
```

#### JavaScript / Node.js

```javascript
const BASE = 'https://apidojo--tiktok-api.apify.actor';
const headers = { Authorization: `Bearer ${process.env.APIFY_TOKEN}` };

const res = await fetch(`${BASE}/user/handle/taylorswift`, { headers });
const { data: user } = await res.json();

const followers = await fetch(`${BASE}/user/${user.id}/followers`, { headers }).then((r) => r.json());
console.log(followers.data.followers.length, followers.data.cursor);
```

#### Post by URL

```bash
curl -G "https://apidojo--tiktok-api.apify.actor/post" \
  --data-urlencode "url=https://vt.tiktok.com/ZSDHmaujt/" \
  -H "Authorization: Bearer YOUR_APIFY_TOKEN"
```

***

### 🆓 Free Plan

Apify Free plan users can try this API with a limited number of free requests each month. When the monthly limit is reached, the API answers `429` until the next month. Invalid requests (`400`) do not use up your free requests. [Subscribe to a paid Apify plan](https://apify.com/pricing?fpr=yhdrb) for unlimited requests.

***

### 🌴 Related Actors

Need bulk exports to a dataset, CSV or Excel instead of live calls? Use our batch scrapers:

| Tool | Best For |
| --- | --- |
| 🎬 **[TikTok Scraper](https://apify.com/apidojo/tiktok-scraper?fpr=yhdrb)** | Large post exports from profiles, hashtags, search and more |
| 👤 **[TikTok Profile Scraper](https://apify.com/apidojo/tiktok-profile-scraper?fpr=yhdrb)** | Bulk profiles and their post history |
| 👥 **[TikTok User Scraper](https://apify.com/apidojo/tiktok-user-scraper?fpr=yhdrb)** | Bulk followers and followings |
| 💬 **[TikTok Comments Scraper](https://apify.com/apidojo/tiktok-comments-scraper?fpr=yhdrb)** | Full comment threads |
| 🎵 **[TikTok Music Scraper](https://apify.com/apidojo/tiktok-music-scraper?fpr=yhdrb)** | Posts that use a sound |
| 📍 **[TikTok Location Scraper](https://apify.com/apidojo/tiktok-location-scraper?fpr=yhdrb)** | Posts tagged with a place |

***

### ❓ Frequently Asked Questions

#### What is a Standby Actor?

A Standby Actor is an always-running web server on Apify. You call it over HTTP like any API and get the response directly. No runs to start or datasets to read. [Learn more](https://docs.apify.com/platform/actors/running/standby).

#### How much does it cost?

**$0.003 per successful request**, the same for every endpoint. 1,000 requests = $3. Failed and invalid requests are free.

#### Am I charged per post or per request?

Per request. A page of search results costs the same as a single profile lookup.

#### Do I need a TikTok developer account?

No. You only need an Apify API token.

#### How do I get more than one page of results?

Pass the `cursor` from the previous response as a query parameter. Each page is a separate $0.003 request. See [Pagination](#-pagination).

#### Can I sort or filter search results?

Yes. `/post/search` accepts `sortType` (`RELEVANCE`, `MOST_LIKED`, `DATE_POSTED`) and `dateRange` (`ALL_TIME`, `YESTERDAY`, `THIS_WEEK`, `THIS_MONTH`, `LAST_THREE_MONTHS`, `LAST_SIX_MONTHS`). Any other value returns a `400`.

#### How do I find a user ID or hashtag ID?

Call `/user/handle/{username}` or `/hashtag/handle/{name}` and use the `id` field from the response. Each lookup is one request.

#### How fast is it?

Responses come back live. There is no run startup time.

#### Can I use it from an AI agent or bot?

Yes. It's a plain HTTP API with an OpenAPI spec, so it fits LLM tool calls, bots, backends and no-code tools that can make HTTP requests.

#### Where is the data stored?

Nowhere. Results are returned in the HTTP response only. For dataset, CSV or Excel exports, use one of the [batch scrapers](#-related-actors).

#### Can I access private accounts?

No. Only publicly available data is returned.

***

### 📞 Contact

If you need any sort of support, please send an email to **apidojo10@gmail.com**. You name it, we get it.

***

**Ready to call TikTok data like an API?** One endpoint per question, $0.003 per answer, live JSON with no run startup. Grab your Apify token and send your first request. 🎵

# Actor input Schema

## Actor input object example

```json
{}
```

# Actor output Schema

## `overview` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {};

// Run the Actor and wait for it to finish
const run = await client.actor("apidojo/tiktok-api").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {}

# Run the Actor and wait for it to finish
run = client.actor("apidojo/tiktok-api").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{}' |
apify call apidojo/tiktok-api --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,apidojo/tiktok-api"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/xfGlsIPG4SQMyGGtb/builds/GotBGrKWT3OaJnFS4/openapi.json
