# TikTok API

> Returns TikTok account profiles and statistics, an account's videos, video details, comments and replies, hashtags and sounds with their top videos, live rooms, trending videos and hashtags, search suggestions, and video transcripts.

Category: Social & Video. Region: global. 12 endpoints at `https://api.hoshime.com/v1/tiktok/<endpoint>`, `GET` with query parameters, answering `{data, meta}` (see https://hoshime.com/docs/responses.md). Reference: https://hoshime.com/docs/platforms/tiktok
## GET /v1/tiktok/user

Profile and statistics of one account.

Scope: `social:read` · Units: 5 · Cached: 60 min

| Parameter | Type | Required | Description |
|---|---|---|---|
| `username` | string | yes | Username, with or without @, or profile URL. (e.g. tiktok) |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `avatarUrl` (string), `bio` (string), `bioLink` (string), `createdAt` (string), `followerCount` (integer (int64)), `followingCount` (integer (int64)), `friendCount` (integer (int64)), `id` (string), `likeCount` (integer (int64)), `name` (string), `postCount` (integer (int64)), `private` (boolean), `secUid` (string), `url` (string), `username` (string), `verified` (boolean)

```bash
curl "https://api.hoshime.com/v1/tiktok/user?username=tiktok" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/tiktok/userPosts

Posts of one TikTok account, newest first.

Scope: `social:read` · Units: 10 · Cached: 10 min · Paginated: cursor

| Parameter | Type | Required | Description |
|---|---|---|---|
| `username` | string | yes | Username, with or without @, or profile URL. (e.g. tiktok) |
| `cursor` | string | no | meta.pagination.nextCursor of the previous page. Omit it for the first page. |
| `limit` | integer | no | Items per page, 1 to 35. (default 15) |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `author` (Author), `author.avatarUrl` (string), `author.id` (string), `author.name` (string), `author.url` (string), `author.username` (string), `authorSecUid` (string), `authorVerified` (boolean), `collectCount` (integer (int64)), `commentCount` (integer (int64)), `description` (string), `durationSeconds` (integer (int64)), `hashtags` (Hashtag[]), `hashtags[].name` (string), `height` (integer (int64)), `id` (string), `images` (Image[]), `images[].height` (any), `images[].url` (string), `images[].width` (any), `isAd` (boolean), `likeCount` (integer (int64)), `location` (string), `music` (VideoMusic), `music.author` (string), `music.durationSeconds` (integer (int64)), `music.id` (string), `music.original` (boolean), `music.title` (string), `publishedAt` (string), `repostCount` (integer (int64)), `shareCount` (integer (int64)), `thumbnails` (Image[]), `thumbnails[].height` (any), `thumbnails[].url` (string), `thumbnails[].width` (any), `title` (string), `url` (string), `viewCount` (integer (int64)), `width` (integer (int64))

```bash
curl "https://api.hoshime.com/v1/tiktok/userPosts?username=tiktok" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/tiktok/live

Whether one TikTok account is live now, and its live room.

Scope: `social:read` · Units: 1 · Cached: 1 min

| Parameter | Type | Required | Description |
|---|---|---|---|
| `username` | string | yes | Username, with or without @, or profile URL. (e.g. tiktok) |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `author` (Author), `author.avatarUrl` (string), `author.id` (string), `author.name` (string), `author.url` (string), `author.username` (string), `coverUrl` (string), `isLive` (boolean), `roomId` (string), `startedAt` (string), `title` (string), `url` (string), `viewerCount` (integer (int64))

```bash
curl "https://api.hoshime.com/v1/tiktok/live?username=tiktok" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/tiktok/video

Details and statistics of one video or photo post.

Scope: `social:read` · Units: 5 · Cached: 10 min

| Parameter | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | Post id, or a tiktok.com video or photo URL. (e.g. https://www.tiktok.com/@scout2015/video/6718335390845095173) |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `author` (Author), `author.avatarUrl` (string), `author.id` (string), `author.name` (string), `author.url` (string), `author.username` (string), `authorSecUid` (string), `authorVerified` (boolean), `collectCount` (integer (int64)), `commentCount` (integer (int64)), `description` (string), `durationSeconds` (integer (int64)), `hashtags` (Hashtag[]), `hashtags[].name` (string), `height` (integer (int64)), `id` (string), `images` (Image[]), `images[].height` (any), `images[].url` (string), `images[].width` (any), `isAd` (boolean), `likeCount` (integer (int64)), `location` (string), `music` (VideoMusic), `music.author` (string), `music.durationSeconds` (integer (int64)), `music.id` (string), `music.original` (boolean), `music.title` (string), `publishedAt` (string), `repostCount` (integer (int64)), `shareCount` (integer (int64)), `thumbnails` (Image[]), `thumbnails[].height` (any), `thumbnails[].url` (string), `thumbnails[].width` (any), `title` (string), `url` (string), `viewCount` (integer (int64)), `width` (integer (int64))

```bash
curl "https://api.hoshime.com/v1/tiktok/video?id=https%3A%2F%2Fwww.tiktok.com%2F%40scout2015%2Fvideo%2F6718335390845095173" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/tiktok/comments

Top-level comments of one video or photo post, one page at a time.

Scope: `social:read` · Units: 1 · Cached: 10 min · Paginated: cursor

| Parameter | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | Post id, or a tiktok.com video or photo URL. (e.g. 6718335390845095173) |
| `cursor` | string | no | meta.pagination.nextCursor of the previous page. Omit it for the first page. |
| `limit` | integer | no | Items per page, 1 to 50. (default 20) |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `author` (Author), `author.avatarUrl` (string), `author.id` (string), `author.name` (string), `author.url` (string), `author.username` (string), `authorSecUid` (string), `createdAt` (string), `id` (string), `language` (string), `likeCount` (integer (int64)), `parentId` (string), `postId` (string), `replyCount` (integer (int64)), `text` (string)

```bash
curl "https://api.hoshime.com/v1/tiktok/comments?id=6718335390845095173" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/tiktok/commentReplies

Replies to one comment of a video or photo post, one page at a time.

Scope: `social:read` · Units: 1 · Cached: 10 min · Paginated: cursor

| Parameter | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | Post id, or a tiktok.com video or photo URL. (e.g. 7106594312292453675) |
| `commentId` | string | yes | Id of the comment whose replies to list, from comments. (e.g. 7106606555949433646) |
| `cursor` | string | no | meta.pagination.nextCursor of the previous page. Omit it for the first page. |
| `limit` | integer | no | Items per page, 1 to 50. (default 20) |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `author` (Author), `author.avatarUrl` (string), `author.id` (string), `author.name` (string), `author.url` (string), `author.username` (string), `authorSecUid` (string), `createdAt` (string), `id` (string), `language` (string), `likeCount` (integer (int64)), `parentId` (string), `postId` (string), `replyCount` (integer (int64)), `text` (string)

```bash
curl "https://api.hoshime.com/v1/tiktok/commentReplies?id=7106594312292453675&commentId=7106606555949433646" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/tiktok/searchSuggestions

Search suggestions TikTok shows for a keyword.

Scope: `social:read` · Units: 1 · Cached: 60 min

| Parameter | Type | Required | Description |
|---|---|---|---|
| `query` | string | yes | Text typed into the search box. (e.g. music) |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `keyword` (string), `suggestions` (Suggestion[]), `suggestions[].text` (string)

```bash
curl "https://api.hoshime.com/v1/tiktok/searchSuggestions?query=music" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/tiktok/transcript

Subtitles of one video with timestamps: TikTok's captions and machine translations.

Scope: `social:read` · Units: 10 · Cached: 60 min

| Parameter | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | Post id, or a tiktok.com video URL. (e.g. 7554652158981983544) |
| `lang` | string | no | Subtitle language as TikTok names it, such as eng-US or ind-ID. Empty for the video's original language. |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `availableLanguages` (SubtitleLanguage[]), `availableLanguages[].code` (string), `id` (string), `language` (string), `segments` (TranscriptSegment[]), `segments[].durationMs` (integer (int64)), `segments[].startMs` (integer (int64)), `segments[].text` (string), `text` (string)

```bash
curl "https://api.hoshime.com/v1/tiktok/transcript?id=7554652158981983544" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/tiktok/trending

Trending videos in one country, from TikTok's Explore feed.

Scope: `social:read` · Units: 3 · Cached: 30 min · Paginated: cursor

| Parameter | Type | Required | Description |
|---|---|---|---|
| `country` | string | no | Country, as a lowercase ISO 3166-1 alpha-2 code. The US is not offered: TikTok serves its feed only to signed requests. (one of ae, ar, au, br, ca, co, de, eg, es, fr, gb, id, il, it, jp, kr, mx, my, ph, sa, sg, th, tr, tw, vn, za; default id; e.g. id) |
| `limit` | integer | no | Items per page, 1 to 100. (default 30) |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `author` (Author), `author.avatarUrl` (string), `author.id` (string), `author.name` (string), `author.url` (string), `author.username` (string), `authorSecUid` (string), `authorVerified` (boolean), `collectCount` (integer (int64)), `commentCount` (integer (int64)), `description` (string), `durationSeconds` (integer (int64)), `hashtags` (Hashtag[]), `hashtags[].name` (string), `height` (integer (int64)), `id` (string), `images` (Image[]), `images[].height` (any), `images[].url` (string), `images[].width` (any), `isAd` (boolean), `likeCount` (integer (int64)), `location` (string), `music` (VideoMusic), `music.author` (string), `music.durationSeconds` (integer (int64)), `music.id` (string), `music.original` (boolean), `music.title` (string), `publishedAt` (string), `repostCount` (integer (int64)), `shareCount` (integer (int64)), `thumbnails` (Image[]), `thumbnails[].height` (any), `thumbnails[].url` (string), `thumbnails[].width` (any), `title` (string), `url` (string), `viewCount` (integer (int64)), `width` (integer (int64))

```bash
curl "https://api.hoshime.com/v1/tiktok/trending?country=id" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/tiktok/trendingHashtags

Trending hashtags in one country: TikTok's official top hashtags from Creative Center, and the hashtags of the videos trending on the Explore feed, ranked by how many of them use each.

Scope: `social:read` · Units: 5 · Cached: 60 min

| Parameter | Type | Required | Description |
|---|---|---|---|
| `country` | string | no | Country, as a lowercase ISO 3166-1 alpha-2 code. The US is not offered: TikTok serves its feed only to signed requests. (one of ae, ar, au, br, ca, co, de, eg, es, fr, gb, id, il, it, jp, kr, mx, my, ph, sa, sg, th, tr, tw, vn, za; default id; e.g. id) |
| `period` | string | no | Days the official ranking covers: 7 or 30. (one of 7, 30; default 7) |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `country` (string), `feed` (FeedHashtag[]), `feed[].name` (string), `feed[].url` (string), `feed[].videoCount` (integer (int64)), `feed[].videoIds` (string[]), `feed[].viewCount` (integer (int64)), `official` (OfficialHashtag[]), `official[].id` (string), `official[].name` (string), `official[].popularity` (Popularity[]), `official[].postCount` (integer (int64)), `official[].rank` (integer (int64)), `official[].url` (string), `official[].viewCount` (integer (int64)), `sampledVideoCount` (integer (int64))

```bash
curl "https://api.hoshime.com/v1/tiktok/trendingHashtags?country=id" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/tiktok/hashtag

Statistics of one TikTok hashtag and its top videos.

Scope: `social:read` · Units: 1 · Cached: 60 min

| Parameter | Type | Required | Description |
|---|---|---|---|
| `name` | string | yes | Hashtag, with or without #, or a tiktok.com/tag URL. (e.g. fyp) |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `id` (string), `name` (string), `url` (string), `videoCount` (integer (int64)), `videos` (Video[]), `videos[].author` (Author), `videos[].authorSecUid` (string), `videos[].authorVerified` (boolean), `videos[].collectCount` (integer (int64)), `videos[].commentCount` (integer (int64)), `videos[].description` (string), `videos[].durationSeconds` (integer (int64)), `videos[].hashtags` (Hashtag[]), `videos[].height` (integer (int64)), `videos[].id` (string), `videos[].images` (Image[]), `videos[].isAd` (boolean), `videos[].likeCount` (integer (int64)), `videos[].location` (string), `videos[].music` (VideoMusic), `videos[].publishedAt` (string), `videos[].repostCount` (integer (int64)), `videos[].shareCount` (integer (int64)), `videos[].thumbnails` (Image[]), `videos[].title` (string), `videos[].url` (string), `videos[].viewCount` (integer (int64)), `videos[].width` (integer (int64)), `viewCount` (integer (int64))

```bash
curl "https://api.hoshime.com/v1/tiktok/hashtag?name=fyp" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/tiktok/sound

Information about one TikTok sound and its top videos.

Scope: `social:read` · Units: 10 · Cached: 60 min

| Parameter | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | Sound id, or a tiktok.com/music URL. (e.g. 7028292655268268033) |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `author` (string), `coverUrl` (string), `durationSeconds` (integer (int64)), `id` (string), `title` (string), `url` (string), `videoCount` (integer (int64)), `videos` (Video[]), `videos[].author` (Author), `videos[].authorSecUid` (string), `videos[].authorVerified` (boolean), `videos[].collectCount` (integer (int64)), `videos[].commentCount` (integer (int64)), `videos[].description` (string), `videos[].durationSeconds` (integer (int64)), `videos[].hashtags` (Hashtag[]), `videos[].height` (integer (int64)), `videos[].id` (string), `videos[].images` (Image[]), `videos[].isAd` (boolean), `videos[].likeCount` (integer (int64)), `videos[].location` (string), `videos[].music` (VideoMusic), `videos[].publishedAt` (string), `videos[].repostCount` (integer (int64)), `videos[].shareCount` (integer (int64)), `videos[].thumbnails` (Image[]), `videos[].title` (string), `videos[].url` (string), `videos[].viewCount` (integer (int64)), `videos[].width` (integer (int64))

```bash
curl "https://api.hoshime.com/v1/tiktok/sound?id=7028292655268268033" -H "Authorization: Bearer $HOSHIME_TOKEN"
```
