# TikTok API by APISH (`apish/tiktok-api`) Actor

TikTok data as clean JSON via APISH: Latest videos of a TikTok account, TikTok playlist / collection videos, Replies to a TikTok comment and 30 more endpoints. Pay per credit; failed calls are free.

- **URL**: https://apify.com/apish/tiktok-api.md
- **Developed by:** [APISH](https://apify.com/apish) (community)
- **Categories:** Social media
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$4.00 / 1,000 credits

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 by APISH

Get public TikTok data as clean, consistent JSON: latest videos of a TikTok account, tikTok playlist / collection videos, replies to a TikTok comment, comments of a TikTok video, popular TikTok creators right now, tikTok discover (keyword) page and more. 33 endpoints, one response shape, numbers parsed, absolute URLs.

### How to use

1. Pick an **Endpoint**. Each option shows what it returns and its price in credits.
2. Enter its **Parameters** as JSON, for example `{"username":"nasa"}`. All parameters are listed below.
3. Run. Each call becomes one row in the dataset. Use **Batch** to run the same endpoint for many inputs and **Pages per input** to follow pagination.

### Pricing

Pay per event: you pay per APISH credit the call used. The price of each endpoint is in the table below. Calls that fail on our side (server errors, timeouts, blocks) are free.

### Endpoints

| Endpoint | Returns | Required parameters | Credits |
|---|---|---|---|
| `/tiktok/v1/channel` | Latest videos of a TikTok account | `username` | 3 |
| `/tiktok/v1/collection/videos` | TikTok playlist / collection videos | `url` | 1 |
| `/tiktok/v1/comment/replies` | Replies to a TikTok comment | `url`, `comment_id` | 1 |
| `/tiktok/v1/comments` | Comments of a TikTok video | `url` | 1 |
| `/tiktok/v1/creators/popular` | Popular TikTok creators right now | — | 1 |
| `/tiktok/v1/discover` | TikTok discover (keyword) page | `keyword` | 1 |
| `/tiktok/v1/discover/related` | TikTok related keywords | `keyword` | 1 |
| `/tiktok/v1/explore/categories` | TikTok Explore categories | — | 1 |
| `/tiktok/v1/hashtag` | TikTok hashtag | `name` | 1 |
| `/tiktok/v1/hashtag/videos` | TikTok hashtag videos | `name` | 1 |
| `/tiktok/v1/live` | TikTok live room | — | 1 |
| `/tiktok/v1/post` | One TikTok video | `url` | 1 |
| `/tiktok/v1/profile` | TikTok profile | `username` | 1 |
| `/tiktok/v1/profile/region` | TikTok account region | `username` | 2 |
| `/tiktok/v1/search` | TikTok videos for a keyword (public hashtag feed) | `q` | 1 |
| `/tiktok/v1/search/keyword` | Search TikTok videos | `q` | 1 |
| `/tiktok/v1/search/live` | Search TikTok LIVE rooms | `q` | 1 |
| `/tiktok/v1/search/suggestions` | TikTok search suggestions | `q` | 1 |
| `/tiktok/v1/search/top` | TikTok Top search (videos and accounts) | `q` | 1 |
| `/tiktok/v1/search/users` | Search TikTok accounts | `q` | 1 |
| `/tiktok/v1/song` | TikTok sound | `id` | 1 |
| `/tiktok/v1/song/videos` | Videos using a TikTok sound | `id` | 1 |
| `/tiktok/v1/trending` | Trending TikTok videos | — | 1 |
| `/tiktok/v1/trends/hashtags` | TikTok trending hashtags (Creative Center) | — | 1 |
| `/tiktok/v1/user/collections` | TikTok user collections | `username` | 1 |
| `/tiktok/v1/user/followers` | TikTok followers | `username` | 1 |
| `/tiktok/v1/user/following` | Accounts a TikTok user follows | `username` | 1 |
| `/tiktok/v1/user/liked` | TikTok user liked videos | `username` | 1 |
| `/tiktok/v1/user/live` | Is a TikTok account live | `username` | 1 |
| `/tiktok/v1/user/playlists` | TikTok user playlists | `username` | 1 |
| `/tiktok/v1/user/reposts` | TikTok user reposts | `username` | 1 |
| `/tiktok/v1/video/related` | Related TikTok videos | `url` | 1 |
| `/tiktok/v1/video/transcript` | TikTok video transcript (TikTok captions) | `url` | 1 |

### Output

Each dataset row has `endpoint`, `params`, `status`, `credits_used` and the endpoint's data. Add `"raw": 1` to the parameters to also get the site's original record, or `"fields": "a,b.c"` to return only the fields you need.

### Endpoint details

#### Latest videos of a TikTok account

Endpoint `/tiktok/v1/channel` · 3 credits per successful call.

The profile's videos, 35 per page; pass `next_cursor` back as `cursor`. Logged out, TikTok serves about two pages (~60 videos), then `next_cursor` is null (`more_available` says whether the account has more). `sort` = latest (default), popular or oldest, like the tabs on the profile.

Parameters:

- `username` (required)
- `sort` — one of `latest`, `popular`, `oldest`: latest (default), popular or oldest.
- `cursor`: Value of `next_cursor` from the previous page (logged out, TikTok serves about two pages).

Example parameters: `{"username":"nasa"}`

#### TikTok playlist / collection videos

Endpoint `/tiktok/v1/collection/videos` · 1 credit per successful call.

Parameters:

- `url` (required)
- `cursor`: Value of `next_cursor` from the previous page.

Example parameters: `{"url":"https://www.tiktok.com/@nba/playlist/Playoffs-7499302679324936990"}`

#### Replies to a TikTok comment

Endpoint `/tiktok/v1/comment/replies` · 1 credit per successful call.

Parameters:

- `url` (required)
- `comment_id` (required)
- `cursor`: Value of `next_cursor` from the previous page.

Example parameters: `{"url":"https://www.tiktok.com/@khaby.lame/video/7137423965982592302","comment_id":"7137510823549272878"}`

#### Comments of a TikTok video

Endpoint `/tiktok/v1/comments` · 1 credit per successful call.

Pagination: pass the cursor from `next_cursor` on the previous response; `next_cursor` is null on the last page.

Parameters:

- `url` (required)
- `cursor`: Cursor from `next_cursor` on the previous response; `next_cursor` is null on the last page.

Example parameters: `{"url":"https://www.tiktok.com/@nasa/video/7697300954667994381"}`

#### Popular TikTok creators right now

Endpoint `/tiktok/v1/creators/popular` · 1 credit per successful call.

Ranks the creators behind what TikTok's Explore feed is pushing right now (All, Singing & Dancing and Comedy by default, or one `category`) by followers, with their trending videos.

Parameters:

- `category`: One Explore category (name or id) instead of the default three.
- `country`: Two-letter country, default US.
- `limit`: Creators to return, up to 200 (default 50).

#### TikTok discover (keyword) page

Endpoint `/tiktok/v1/discover` · 1 credit per successful call.

Parameters:

- `keyword` (required): A phrase or the slug from a tiktok.com/discover/ URL (the URL itself works too).
- `count`: Videos per page, up to 30 (default 20).
- `cursor`: Value of `next_cursor` from the previous page.

Example parameters: `{"keyword":"healthy breakfast ideas"}`

#### TikTok related keywords

Endpoint `/tiktok/v1/discover/related` · 1 credit per successful call.

Parameters:

- `keyword` (required): A phrase or a tiktok.com/discover/ slug.
- `count`: How many (default 60, up to 100).

Example parameters: `{"keyword":"healthy breakfast ideas"}`

#### TikTok Explore categories

Endpoint `/tiktok/v1/explore/categories` · 1 credit per successful call.

The Explore tabs (All, Comedy, Food, ...) with the id that `category` accepts on /tiktok/v1/trending.

#### TikTok hashtag

Endpoint `/tiktok/v1/hashtag` · 1 credit per successful call.

A hashtag page: id, video count, view count, cover, description.

Parameters:

- `name` (required): Hashtag without #, or its tiktok.com/tag URL.

Example parameters: `{"name":"cooking"}`

#### TikTok hashtag videos

Endpoint `/tiktok/v1/hashtag/videos` · 1 credit per successful call.

Videos filed under a hashtag, 30 per page.

Parameters:

- `name` (required): Hashtag without #, or its tiktok.com/tag URL.
- `cursor`: Value of `next_cursor` from the previous page; `next_cursor` is null on the last page.

Example parameters: `{"name":"cooking"}`

#### TikTok live room

Endpoint `/tiktok/v1/live` · 1 credit per successful call.

A live room by `room_id`, or the current room of `username`. An account that is not live answers `live: false`.

Parameters:

- `username`
- `room_id`: Live room ID (instead of username).

#### One TikTok video

Endpoint `/tiktok/v1/post` · 1 credit per successful call.

Parameters:

- `url` (required)

Example parameters: `{"url":"https://www.tiktok.com/@nasa/video/7697300954667994381"}`

#### TikTok profile

Endpoint `/tiktok/v1/profile` · 1 credit per successful call.

Parameters:

- `username` (required)

Example parameters: `{"username":"nasa"}`

#### TikTok account region

Endpoint `/tiktok/v1/profile/region` · 2 credits per successful call.

Most common country the latest posts were published from.

Parameters:

- `username` (required)

Example parameters: `{"username":"khaby.lame"}`

#### TikTok videos for a keyword (public hashtag feed)

Endpoint `/tiktok/v1/search` · 1 credit per successful call.

The public hashtag feed for the keyword (spaces removed): the videos TikTok files under #<keyword>, 30 per page. For TikTok's own keyword search use /tiktok/v1/search/keyword.

Parameters:

- `q` (required)
- `cursor`: Value of `next_cursor` from the previous page; `next_cursor` is null on the last page.

Example parameters: `{"q":"cooking"}`

#### Search TikTok videos

Endpoint `/tiktok/v1/search/keyword` · 1 credit per successful call.

Parameters:

- `q` (required)
- `cursor`: Value of `next_cursor` from the previous page.
- `date` — one of `all`, `day`, `week`, `month`, `3months`, `6months`: Date posted: all (default), day, week, month, 3months, 6months.
- `sort` — one of `relevance`, `likes`: relevance (default) or likes.

Example parameters: `{"q":"cooking"}`

#### Search TikTok LIVE rooms

Endpoint `/tiktok/v1/search/live` · 1 credit per successful call.

Rooms on TikTok's LIVE search tab: title, viewers, likes, owner, stream URLs (HLS/FLV).

Parameters:

- `q` (required)
- `cursor`: Value of `next_cursor` from the previous page; `next_cursor` is null on the last page.

Example parameters: `{"q":"music"}`

#### TikTok search suggestions

Endpoint `/tiktok/v1/search/suggestions` · 1 credit per successful call.

Parameters:

- `q` (required)

Example parameters: `{"q":"cook"}`

#### TikTok Top search (videos and accounts)

Endpoint `/tiktok/v1/search/top` · 1 credit per successful call.

Parameters:

- `q` (required)
- `cursor`: Value of `next_cursor` from the previous page.

Example parameters: `{"q":"gordon ramsay"}`

#### Search TikTok accounts

Endpoint `/tiktok/v1/search/users` · 1 credit per successful call.

TikTok's users-only search is empty for logged-out visitors, so this reads the accounts in the Top results.

Parameters:

- `q` (required)
- `cursor`: Value of `next_cursor` from the previous page.

Example parameters: `{"q":"cooking"}`

#### TikTok sound

Endpoint `/tiktok/v1/song` · 1 credit per successful call.

Parameters:

- `id` (required): Music ID or /music/ URL.

Example parameters: `{"id":"7016547803243022337"}`

#### Videos using a TikTok sound

Endpoint `/tiktok/v1/song/videos` · 1 credit per successful call.

Parameters:

- `id` (required)
- `cursor`: Value of `next_cursor` from the previous page.

Example parameters: `{"id":"7016547803243022337"}`

#### Trending TikTok videos

Endpoint `/tiktok/v1/trending` · 1 credit per successful call.

explore: TikTok's Explore feed for a category (`category`: a name from /tiktok/v1/explore/categories, e.g. food, or its id); foryou: the For You feed logged-out visitors get. Each page is a new batch of videos; pass `next_cursor` back for more. `country` picks the region of the feed (US default; another country's first call is slower).

Parameters:

- `source`: explore or foryou.
- `count`
- `category`: Explore category name or id (explore only), e.g. food, comedy, sports, 111.
- `country`: Two-letter country of the feed (explore only), default US.
- `cursor`: Value of `next_cursor` from the previous page; `next_cursor` is null on the last page.

#### TikTok trending hashtags (Creative Center)

Endpoint `/tiktok/v1/trends/hashtags` · 1 credit per successful call.

Top trending hashtags from TikTok Creative Center for a country and period: rank, posts, views, a daily popularity curve and the top creators using each one. Logged out, TikTok shows the top 3 per country and period; the full ranking needs a TikTok for Business login. `available_filters` lists the countries and industries the page offers.

Parameters:

- `country`: Two-letter country code (default US); see available_filters.hashtagCountry.
- `period` — one of `7`, `30`, `120`: Days to rank over.
- `industry`: Industry id from available_filters.industry.

#### TikTok user collections

Endpoint `/tiktok/v1/user/collections` · 1 credit per successful call.

An account's public collections (the Favorites tab). Videos of a collection: /tiktok/v1/collection/videos.

Parameters:

- `username` (required)
- `cursor`: Value of `next_cursor` from the previous page; `next_cursor` is null on the last page.

Example parameters: `{"username":"tiktok"}`

#### TikTok followers

Endpoint `/tiktok/v1/user/followers` · 1 credit per successful call.

Parameters:

- `username` (required)
- `cursor`: Value of `next_cursor` from the previous page.

Example parameters: `{"username":"khaby.lame"}`

#### Accounts a TikTok user follows

Endpoint `/tiktok/v1/user/following` · 1 credit per successful call.

Parameters:

- `username` (required)
- `cursor`: Value of `next_cursor` from the previous page.

Example parameters: `{"username":"khaby.lame"}`

#### TikTok user liked videos

Endpoint `/tiktok/v1/user/liked` · 1 credit per successful call.

The Liked tab, 30 per page (pass `next_cursor` back as `cursor`). Most accounts keep it private: then `private: true` and no videos.

Parameters:

- `username` (required)
- `cursor`: Value of `next_cursor` from the previous page (logged out, TikTok serves about two pages).

Example parameters: `{"username":"nasa"}`

#### Is a TikTok account live

Endpoint `/tiktok/v1/user/live` · 1 credit per successful call.

Parameters:

- `username` (required)

Example parameters: `{"username":"tiktok"}`

#### TikTok user playlists

Endpoint `/tiktok/v1/user/playlists` · 1 credit per successful call.

Parameters:

- `username` (required)
- `cursor`: Value of `next_cursor` from the previous page.

Example parameters: `{"username":"nba"}`

#### TikTok user reposts

Endpoint `/tiktok/v1/user/reposts` · 1 credit per successful call.

Videos the account reposted (the Reposts tab), as a logged-out visitor sees them, 30 per page; pass `next_cursor` back as `cursor`.

Parameters:

- `username` (required)
- `cursor`: Value of `next_cursor` from the previous page (logged out, TikTok serves about two pages).

Example parameters: `{"username":"nasa"}`

#### Related TikTok videos

Endpoint `/tiktok/v1/video/related` · 1 credit per successful call.

The related videos TikTok shows next to a video (about 16).

Parameters:

- `url` (required): Video URL or id.
- `count`: Up to 30 (default 16).

Example parameters: `{"url":"https://www.tiktok.com/@nasa/video/7697300954667994381"}`

#### TikTok video transcript (TikTok captions)

Endpoint `/tiktok/v1/video/transcript` · 1 credit per successful call.

TikTok's own captions (WebVTT): auto-generated (ASR) or uploaded tracks, read from the video page. `languages` lists every track; `language` picks one (default en).

Parameters:

- `url` (required)
- `language`

Example parameters: `{"url":"https://www.tiktok.com/@x/video/7688809734673108237"}`

### Support

Questions, bugs or a missing field? Open an issue in this Actor's Issues tab and we will reply there.

Public data only: nothing behind a login. You are responsible for how you use the data you collect.

# Actor input Schema

## `endpoint` (type: `string`):

Which TikTok endpoint to call. Each option shows what it returns and its price in credits.

## `params` (type: `object`):

Query parameters for the endpoint, as JSON. See the README for every endpoint's parameters. Example: {"username":"nasa"}

## `batch` (type: `array`):

Run the same endpoint for many inputs: a list of parameter objects. Each item is one call. Leave empty to use Parameters.

## `maxPages` (type: `integer`):

For paginated endpoints: follow next_cursor up to this many pages per input. 1 = first page only.

## Actor input object example

```json
{
  "endpoint": "/tiktok/v1/channel",
  "params": {
    "username": "nasa"
  },
  "batch": [],
  "maxPages": 1
}
```

# Actor output Schema

## `results` (type: `string`):

One row per call: endpoint, params, status, credits_used and the data.

# 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 = {
    "endpoint": "/tiktok/v1/channel",
    "params": {
        "username": "nasa"
    },
    "batch": []
};

// Run the Actor and wait for it to finish
const run = await client.actor("apish/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 = {
    "endpoint": "/tiktok/v1/channel",
    "params": { "username": "nasa" },
    "batch": [],
}

# Run the Actor and wait for it to finish
run = client.actor("apish/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 '{
  "endpoint": "/tiktok/v1/channel",
  "params": {
    "username": "nasa"
  },
  "batch": []
}' |
apify call apish/tiktok-api --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,apish/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/4ajTxf2cI5ij45YVC/builds/8mc9mmtaCVIYGibY0/openapi.json
