# Tiktok — Wrapped API

> **You are on:** `https://api.beta.paywithlocus.com/api` | [llms.txt](https://beta.paywithlocus.com/llms.txt) | [docs](https://docs.paywithlocus.com)
>
> Locus runs on multiple environments -- make sure every URL you call matches your expected environment.
> | Environment | Landing | API | Docs |
> |---|---|---|---|
> | Production | paywithlocus.com | api.paywithlocus.com | docs.paywithlocus.com |
> | Beta | beta.paywithlocus.com | api.beta.paywithlocus.com | docs.paywithlocus.com |
> | Stage | stage.paywithlocus.com | api.stage.paywithlocus.com | docs.paywithlocus.com |
>
> If the API URL above doesn't match your expected environment, re-fetch this file from the correct domain.

> Retrieve detailed information about any public TikTok video including captions, media URLs, view counts, likes, and shares, plus access all comments posted on that video. Perfect for analyzing trending content, monitoring video performance, or building applications that need TikTok video data.

**Category:** Social Media | **Website:** [www.tiktok.com/@lilireinhart/video/7517409255914212638](https://www.tiktok.com/@lilireinhart/video/7517409255914212638) | **Docs:** [parse.bot/marketplace/2e2bd45f-cc23-45f4-a5e7-42b98de5d21c/tiktok-com-api](https://parse.bot/marketplace/2e2bd45f-cc23-45f4-a5e7-42b98de5d21c/tiktok-com-api)

Pay-per-use API proxy for Locus Pro. Each call burns credits from your workspace balance.

## Access

**Base URL:** `https://api.beta.paywithlocus.com/api/wrapped/credits/tiktok-web/`
**Auth:** `Authorization: Bearer <LOCUS_CREDITS_SECRET_KEY>` (an `lcr_` secret key or a scoped `lcac_` agent credential)
**Required header:** `Idempotency-Key: <fresh UUID per call>`. A retry with the same key replays the stored result without a new charge.
**Response:** the provider response after any endpoint-specific normalization. `X-Locus-Credits-Charged` carries the charge and `X-Locus-Credits-Balance` the remaining balance. Insufficient credits return `402` before the provider is called.
**Pricing:** estimated costs below are USD. Locus debits the credit equivalent at your workspace rate.

Full call contract: https://docs.paywithlocus.com/api-reference/introduction

> Using a Pay With Locus wallet key (`claw_` prefix)? Wallet routes are documented separately: https://docs.paywithlocus.com/wrapped-apis/for-agents

## Endpoints

### Get comment replies

Get replies to a specific comment on a TikTok video with cursor-based pagination. Accepts a full TikTok video URL (or numeric video ID) and a comment_id from get_comments results. Returns replies sorted by relevance, each including reply_to_comment_id (the parent comment) and reply_to_reply_id (the specific reply being responded to, or '0' for direct replies to the parent). Use the returned cursor value to fetch subsequent pages.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `comment_id` | string | Yes | ID of the comment to fetch replies for, from get_comments results |
| `count` | integer | No | Number of replies to return per page, maximum 50. |
| `cursor` | integer | No | Pagination cursor. Use the cursor value from a previous response to fetch the next page of replies. |
| `url` | string | Yes | TikTok video URL (e.g. https://www.tiktok.com/@user/video/1234567890) or numeric video ID |

```bash
curl -X POST https://api.beta.paywithlocus.com/api/wrapped/credits/tiktok-web/get-comment-replies \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"comment_id":"<string>","count":"<integer>","cursor":"<integer>","url":"<string>"}'
```

### Get comments

Get comments for a TikTok video with cursor-based pagination. Accepts either a full TikTok video URL or a numeric video ID. Returns comments sorted by relevance with user info, like counts, reply counts, and creator-liked labels. Use the returned cursor value to fetch subsequent pages.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `count` | integer | No | Number of comments to return per page, maximum 50. |
| `cursor` | integer | No | Pagination cursor. Use the cursor value from a previous response to fetch the next page of comments. |
| `url` | string | Yes | TikTok video URL (e.g. https://www.tiktok.com/@user/video/1234567890) or numeric video ID |

```bash
curl -X POST https://api.beta.paywithlocus.com/api/wrapped/credits/tiktok-web/get-comments \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"count":"<integer>","cursor":"<integer>","url":"<string>"}'
```

### Get post details

Get video details including caption, media URL, author info, engagement stats, and metadata for a public TikTok video. Requires a full TikTok video URL including the username path (e.g. https://www.tiktok.com/@username/video/VIDEO_ID). Returns a single Video resource with nested author, stats, and music objects. The media_url is a time-limited signed playback URL.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `url` | string | Yes | Full TikTok video URL in the format https://www.tiktok.com/@username/video/VIDEO_ID |

```bash
curl -X POST https://api.beta.paywithlocus.com/api/wrapped/credits/tiktok-web/get-post-details \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"url":"<string>"}'
```

### Get profile details

Get public profile information for a TikTok user by username. Returns display name, bio, avatar URL, follower/following/like/video counts, verified status, and bio link. Requires one page load per call.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `username` | string | Yes | TikTok username (e.g. 'lilireinhart' or '@lilireinhart'). Leading @ is stripped automatically. |

```bash
curl -X POST https://api.beta.paywithlocus.com/api/wrapped/credits/tiktok-web/get-profile-details \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"username":"<string>"}'
```

## Next steps

- [All wrapped API providers](https://beta.paywithlocus.com/wapi/index.md): pick another provider.
- [Find and call tools](https://beta.paywithlocus.com/agent/tools.md): price ceilings, async results, and errors.
- [Credits and billing](https://beta.paywithlocus.com/agent/billing.md): what a call costs and how to add credits.
- [Agent docs index](https://beta.paywithlocus.com/agent/index.md): every Locus agent page.