---
title: "How to get TikTok data"
description: "Get TikTok profiles, videos with play counts, comments, transcripts, hashtags and search as JSON: what TikTok’s official APIs allow, working code, a real response and prices."
canonical_url: https://groundsocial.dev/guides/how-to-get-tiktok-data
---
# How to get TikTok data

> Get TikTok profiles, videos with play counts, comments, transcripts, hashtags and search as JSON: what TikTok’s official APIs allow, working code, a real response and prices.

_Checked 2026-11-27._

TikTok has no self-serve API for public data: its Research API is for approved non-profit researchers and the Display API only reads users who log in to your app. A data API reads public TikTok for you. One GET returns an account’s videos with play, like, comment and share counts in TikTok’s own JSON, 1 credit a page.

> **Checked 27 November 2026** Every request on this page was run against the live API on that date, and the sample response is from that run. Official-API facts link to the platform’s own pages.

## The official TikTok API

TikTok has three developer APIs, and none reads public data for a commercial product.

- **Research API**: for researchers at non-profit institutions, approved per project. TikTok’s FAQ says creators, advertisers and commercial users are not eligible. Approved projects get 1,000 requests and up to 100,000 records a day.
- **Display API**: reads the profile and videos of a TikTok user who logs in to your app with Login Kit. It cannot read other accounts, search, hashtags or comments.
- **Content Posting API**: posts on a user’s behalf. Write only.
- There is no API key for public videos, comments or transcripts.

Sources: [Research API FAQ](https://developers.tiktok.com/doc/research-api-faq), [TikTok Research Tools](https://developers.tiktok.com/products/research-api), [Display API](https://developers.tiktok.com/doc/display-api-get-started/).

## Quick start

1. **Get a key.** [Sign up](https://groundsocial.dev/app/sign-in?new=1) with an email code: 100 free credits, no card. An agent can sign itself up with `POST https://api.groundsocial.dev/v1/agent/signup`.
2. **Set it in your shell.** `export GROUNDSOCIAL_API_KEY=gs_live_…`
3. **Make the call.** An account’s videos with stats: `GET /v1/tiktok/users/nasa/videos`, 1 credit.

cURL:

```bash
curl "https://api.groundsocial.dev/v1/tiktok/users/nasa/videos?sort=popular" \
  -H "Authorization: Bearer $GROUNDSOCIAL_API_KEY"
```

TypeScript:

```ts
const res = await fetch('https://api.groundsocial.dev/v1/tiktok/users/nasa/videos?sort=popular', {
  headers: { Authorization: `Bearer ${process.env.GROUNDSOCIAL_API_KEY}` },
})
if (!res.ok) throw new Error((await res.json()).error.hint)
const data = await res.json()
```

Python:

```python
import os, requests

res = requests.get(
    "https://api.groundsocial.dev/v1/tiktok/users/nasa/videos?sort=popular",
    headers={"Authorization": f"Bearer {os.environ['GROUNDSOCIAL_API_KEY']}"},
)
res.raise_for_status()
data = res.json()
```

## Sample response

Trimmed from the real response on 27 November 2026: lists cut to their first items and long strings shortened. Every field is described in the [tutorial](https://groundsocial.dev/tutorials/tiktok/user-videos/python).

```json
{
  "itemList": [
    {
      "id": "7665358680627399966",
      "desc": "Not a sunrise. Not a sunset.  An Earthset, captured from lunar flyby on Artemis II. 🌎",
      "createTime": 1784730423,
      "author": {
        "id": "7664638705177150477",
        "uniqueId": "nasa",
        "nickname": "NASA",
        "signature": "Making the seemingly impossible, possible.✨",
        "verified": true,
        "privateAccount": false,
        "duetSetting": 0,
        "isADVirtual": false
      },
      "authorStats": {
        "followerCount": 2200000,
        "followingCount": 23,
        "heartCount": 12000000,
        "heart": 12000000,
        "videoCount": 70,
        "diggCount": 370,
        "friendCount": 0
      },
      "stats": {
        "playCount": 21200000,
        "diggCount": 2700000,
        "commentCount": 25800,
        "collectCount": 161900
      },
      "video": {
        "duration": 53,
        "codecType": "h264",
        "definition": "720p",
        "format": "mp4",
        "height": 1280,
        "id": "7665358680627399966",
        "ratio": "720p",
        "size": 2835898
      },
      "music": {
        "id": "7665358675728550686",
        "title": "original sound",
        "authorName": "NASA",
        "original": true,
        "duration": 52,
        "isCopyrighted": true,
        "is_commerce_music": true,
        "is_unlimited_music": false
      }
    }
  ],
  "cursor": "31281",
  "hasMore": true
}
```

## Get every page

`/v1/tiktok/users/nasa/videos` returns videos a page at a time, and each page costs 1 credit. Pass the response’s `cursor` back as `cursor` until it runs out.

TypeScript:

```ts
// Collect up to 5 pages of videos.
const first = 'https://api.groundsocial.dev/v1/tiktok/users/nasa/videos?sort=popular'
const items: unknown[] = []
let cursor: string | undefined
for (let page = 0; page < 5; page++) {
  const url = new URL(first)
  if (cursor) url.searchParams.set('cursor', cursor)
  const res = await fetch(url, {
    headers: { Authorization: `Bearer ${process.env.GROUNDSOCIAL_API_KEY}` },
  })
  if (!res.ok) throw new Error((await res.json()).error.hint)
  const data = await res.json()
  items.push(...(data.itemList ?? []))
  cursor = data.hasMore ? data.cursor : undefined
  if (!cursor) break
}
console.log(items.length, 'videos')
```

Python:

```python
import os, requests

# Collect up to 5 pages of videos.
FIRST = "https://api.groundsocial.dev/v1/tiktok/users/nasa/videos?sort=popular"
headers = {"Authorization": f"Bearer {os.environ['GROUNDSOCIAL_API_KEY']}"}
items, cursor = [], None
for page in range(5):
    params = {"cursor": cursor} if cursor else {}
    res = requests.get(FIRST, params=params, headers=headers)
    res.raise_for_status()
    data = res.json()
    items += data.get("itemList") or []
    cursor = data.get("cursor") if data.get("hasMore") else None
    if not cursor:
        break
print(len(items), "videos")
```

## What else you can get from TikTok

| What you get | Endpoint | Credits |
| --- | --- | --- |
| [An account’s videos with stats](https://groundsocial.dev/tutorials/tiktok/user-videos/python) | `GET /v1/tiktok/users/nasa/videos` | 1 |
| [A profile with follower and like counts](https://groundsocial.dev/tutorials/tiktok/profile/python) | `GET /v1/tiktok/users/nasa` | 1 |
| [One video with its stats](https://groundsocial.dev/tutorials/tiktok/video/python) | `GET /v1/tiktok/videos/7707446852798549279` | 1 |
| [Comments on a video, 20 a page](https://groundsocial.dev/tutorials/tiktok/comments/python) | `GET /v1/tiktok/videos/7707446852798549279/comments` | 1 |
| [Replies to one comment](https://groundsocial.dev/tutorials/tiktok/comment-replies/python) | `GET /v1/tiktok/videos/7707446852798549279/comments/7707656405906162445/replies` | 1 |
| [A video’s transcript, text and WebVTT](https://groundsocial.dev/tutorials/tiktok/transcript/python) | `GET /v1/tiktok/videos/7707446852798549279/transcript` | 1 |
| [Video search](https://groundsocial.dev/tutorials/tiktok/search/python) | `GET /v1/tiktok/search/videos` | 1 |
| [Videos for a hashtag](https://groundsocial.dev/tutorials/tiktok/hashtag-videos/python) | `GET /v1/tiktok/hashtags/cooking/videos` | 1 |

Each row links to its tutorial. Every TikTok endpoint and price: [TikTok API](https://groundsocial.dev/tiktok-api).

## Tips

- Handles work with or without the `@`, and every id parameter also takes a full TikTok URL.
- `sort=popular` returns an account’s most-played videos first; `latest` (the default) is newest first.
- `stats` holds rounded counts as TikTok shows them; `statsV2` holds exact counts as strings.
- Transcripts are the captions TikTok itself has (automatic or creator-made). A video with none answers `404` and is not charged.

## Use it from Claude or Cursor (MCP)

Every endpoint is also an MCP tool on the remote server `https://api.groundsocial.dev/mcp`. The `?platforms=tiktok` below loads only the TikTok tools. The client signs in with OAuth, or send your key as a Bearer token. Tools used in this guide: `tiktok_user_videos`, `tiktok_user_get`, `tiktok_video_get`, `tiktok_video_comments`, `tiktok_comment_replies`, `tiktok_video_transcript`, `tiktok_search_videos`, `tiktok_search_hashtag`.

Claude Code:

```bash
claude mcp add --transport http groundsocial "https://api.groundsocial.dev/mcp?platforms=tiktok"
```

Cursor:

```json
{
  "mcpServers": {
    "groundsocial": {
      "url": "https://api.groundsocial.dev/mcp?platforms=tiktok"
    }
  }
}
```

Claude.ai:

```text
Customize → Connectors → + Add → Add custom connector
URL: https://api.groundsocial.dev/mcp?platforms=tiktok
```

> **Then ask** “Get @nasa’s 30 most popular TikTok videos and tell me which topics get the most plays per follower.”

Setup for ChatGPT, VS Code, Windsurf, n8n and others: [MCP client setup](https://groundsocial.dev/mcp).

## Pricing

Pay per call from prepaid credits; no subscription. 100 free credits cover the examples on this page. Costs below are at the [credit packs](https://groundsocial.dev/pricing)’ highest and lowest rates.

| Job | Credits | Cost |
| --- | --- | --- |
| 100 profiles | 100 | $0.10 → $0.04 |
| Last ~150 videos of 50 accounts (5 pages each) | 250 | $0.25 → $0.10 |
| 1,000 videos with 3 pages of comments each | 4,000 | $4.00 → $1.60 |
| 1,000 transcripts | 1,000 | $1.00 → $0.40 |

## FAQ

### Do I need a TikTok developer account?

No. Calls read what TikTok shows a logged-out visitor; you only need a Groundsocial key.

### Can I get private accounts or a user’s liked videos?

Private accounts, no. Liked videos only when the account has made its likes public (`GET /v1/tiktok/users/{handle}/liked`).

### How many comments come per page?

Up to 20 top-level comments in TikTok’s order, with like and reply counts. Pass `cursor` while `has_more` is true; expand replies with the replies endpoint.

### Are failed calls charged?

No. A target that does not exist answers `404 target_not_found`, an upstream failure answers `503`, and neither costs anything. Credits never expire.

### Is Groundsocial official?

No. Groundsocial is an independent API that reads what the platform shows a logged-out visitor. TikTok is a trademark of ByteDance Ltd. We are not affiliated with or endorsed by TikTok or ByteDance.

## Go deeper

- [TikTok tutorials: 35 endpoints in six languages](https://groundsocial.dev/tutorials/tiktok)
- [Does TikTok have a public API?](https://groundsocial.dev/answers/does-tiktok-have-a-public-api)
- [How do I get TikTok data without the official API?](https://groundsocial.dev/answers/how-to-get-tiktok-data-without-api)
- [What are the TikTok Research API limits?](https://groundsocial.dev/answers/tiktok-research-api-limits)
- [Is there an MCP server for social media data?](https://groundsocial.dev/answers/social-media-mcp-server)
- [ScrapeCreators alternatives](https://groundsocial.dev/alternatives/scrapecreators)
- [Influencer discovery API](https://groundsocial.dev/use-cases/influencer-discovery-api)
- [Video transcript API](https://groundsocial.dev/use-cases/video-transcript-api)
- [Groundsocial vs EnsembleData](https://groundsocial.dev/compare/ensembledata)

## Related guides

- [How to get Instagram data](https://groundsocial.dev/guides/how-to-get-instagram-data)
- [How to get YouTube data](https://groundsocial.dev/guides/how-to-get-youtube-data)

TikTok is a trademark of ByteDance Ltd. We are not affiliated with or endorsed by TikTok or ByteDance.

_Canonical HTML: https://groundsocial.dev/guides/how-to-get-tiktok-data_

## Site Navigation

### Global Hub
- [Home](https://groundsocial.dev/index.md)
- [Pricing](https://groundsocial.dev/pricing.md)
- [Endpoints](https://groundsocial.dev/endpoints.md)
- [For agents](https://groundsocial.dev/agents.md)
- [Docs](https://groundsocial.dev/docs.md)
- [Compare](https://groundsocial.dev/compare.md)
- [Blog](https://groundsocial.dev/blog.md)
- [Tutorials](https://groundsocial.dev/tutorials.md)
- [Changelog](https://groundsocial.dev/changelog.md)
- [llms.txt](https://groundsocial.dev/llms.txt)
- [Agent skill](https://groundsocial.dev/SKILL.md)

### On This Topic
- [Groundsocial: Social data in one API call](https://groundsocial.dev/index.md)
- [Pricing](https://groundsocial.dev/pricing.md)
- [Playground](https://groundsocial.dev/playground.md)
- [Use cases](https://groundsocial.dev/use-cases.md)
- [Brand monitoring API](https://groundsocial.dev/use-cases/brand-monitoring-api.md)
- [Social listening API](https://groundsocial.dev/use-cases/social-listening-api.md)
- [Comment scraping API](https://groundsocial.dev/use-cases/comment-scraping-api.md)
- [Influencer discovery API](https://groundsocial.dev/use-cases/influencer-discovery-api.md)
- [Video transcript API](https://groundsocial.dev/use-cases/video-transcript-api.md)
- [Ad library API](https://groundsocial.dev/use-cases/ad-library-api.md)
- [Review monitoring API](https://groundsocial.dev/use-cases/review-monitoring-api.md)
- [Trend detection API](https://groundsocial.dev/use-cases/trend-detection-api.md)
- [Social lead generation API](https://groundsocial.dev/use-cases/lead-generation-api.md)
- [Market research API](https://groundsocial.dev/use-cases/market-research-api.md)

## Structured data

```json
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://groundsocial.dev/"},{"@type":"ListItem","position":2,"name":"Guides","item":"https://groundsocial.dev/guides"},{"@type":"ListItem","position":3,"name":"How to get TikTok data","item":"https://groundsocial.dev/guides/how-to-get-tiktok-data"}]}
```
