> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mavera.io/llms.txt
> Use this file to discover all available pages before exploring further.

# TikTok

> 5 production-ready jobs — video analysis, creative leaderboard, Gen Z focus groups, trend content pipelines, and sound impact analysis

TikTok's Business API exposes the creative performance data, audience demographics, and trend signals that most marketing teams never touch. These five jobs pull that data through Mavera's surfaces (Video Analysis, Focus Groups, Personas, Mave Agent, Generate) to score video hooks, rank creatives by behavioral metrics, test concepts with generational personas, and measure how audio choice affects emotional response.

***

## API Reference Card

| Detail          | Value                                                       |
| --------------- | ----------------------------------------------------------- |
| **Base URL**    | `https://business-api.tiktok.com/open_api/v1.3/`            |
| **Auth**        | OAuth 2.0 — `Access-Token: {token}` header                  |
| **Rate limits** | 10–20 QPS depending on endpoint; 10,000 daily for reporting |
| **Mavera base** | `https://app.mavera.io/api/v1`                              |
| **Mavera auth** | `Authorization: Bearer mvra_live_...`                       |

<Info>
  All examples use three environment variables: `TIKTOK_ACCESS_TOKEN`, `TIKTOK_ADVERTISER_ID`, and `MAVERA_API_KEY`. TikTok tokens are long-lived but can be revoked. Store them in your secrets manager.
</Info>

***

## Prerequisites

<Steps>
  <Step title="TikTok for Business account">Register at [TikTok for Business](https://ads.tiktok.com/). Create or link an ad account with active campaigns.</Step>
  <Step title="Marketing API access">Apply for API access at [TikTok Marketing API](https://business-api.tiktok.com/portal/docs). Obtain your App ID, Secret, and complete the OAuth flow.</Step>
  <Step title="Mavera API key">Get your key from [Mavera dashboard](https://app.mavera.io/settings/api-keys).</Step>
  <Step title="Environment variables">`export TIKTOK_ACCESS_TOKEN="..."`, `export TIKTOK_ADVERTISER_ID="..."`, and `export MAVERA_API_KEY="mvra_live_xxxxx"`</Step>
</Steps>

***

## Jobs

| # | Job                                                                      | TikTok Data                  | Mavera Surface          | Output                                      |
| - | ------------------------------------------------------------------------ | ---------------------------- | ----------------------- | ------------------------------------------- |
| 1 | [Ad Video Analysis Pipeline](/integrations/tiktok/ad-video-analysis)     | Video ads from ad/get/       | Video Analysis          | Hook scoring, emotional arc, cognitive load |
| 2 | [Cross-Creative Leaderboard](/integrations/tiktok/creative-leaderboard)  | Creatives + performance      | Video Analysis          | Predictive scoring vs actual CTR            |
| 3 | [Audience → Gen Z Focus Group](/integrations/tiktok/gen-z-focus-group)   | Audience demographics        | Personas + Focus Groups | Generational concept testing                |
| 4 | [Trend → Content Pipeline](/integrations/tiktok/trend-content-pipeline)  | Trending hashtags            | Mave Agent + Generate   | Brand-aligned trend content                 |
| 5 | [Sound/Music Impact Analysis](/integrations/tiktok/sound-music-analysis) | Same visual, different audio | Video Analysis          | Emotional intensity comparison              |

***

## Rate Limits & Production Notes

| TikTok Endpoint            | Limit                 | Strategy                              |
| -------------------------- | --------------------- | ------------------------------------- |
| Ad Management (`/ad/get/`) | 10 QPS                | Batch with `page_size` up to 1000     |
| Reporting (`/reports/`)    | 10–20 QPS; 10,000/day | Cache daily; run overnight jobs       |
| Research API               | 1,000/day             | Prioritize; cache trend data for 6h   |
| File Info (`/file/video/`) | 20 QPS                | Rate-limit downloads; use CDN caching |

<Warning>
  TikTok enforces **QPS limits** (queries per second) rather than daily totals for most endpoints. However, the Reporting API has a **10,000 daily limit**. All code includes per-request delays. For production batch jobs processing 50+ creatives, implement a semaphore (`asyncio.Semaphore(10)` in Python, `p-limit(10)` in Node).
</Warning>

**Checklist:** Store tokens in env vars or secrets manager. TikTok tokens are long-lived but verify with `GET /oauth2/token_info/`. Handle pagination via `page` and `page_size` params. Monitor `X-TT-RateLimit-Remaining` headers. Compress video before Mavera upload. Cache TikTok data for daily analysis runs. Monitor Mavera credits at [Dashboard](https://app.mavera.io/settings/usage).

***

<CardGroup cols={3}>
  <Card title="All Integrations" icon="plug" href="/integrations" />

  <Card title="TikTok Marketing API" icon="tiktok" href="https://business-api.tiktok.com/portal/docs" />

  <Card title="Video Analysis" icon="video" href="/features/video-analysis" />

  <Card title="Personas" icon="user" href="/features/personas" />

  <Card title="Focus Groups" icon="users" href="/features/focus-groups" />

  <Card title="Mave Agent" icon="brain" href="/features/mave-agent" />
</CardGroup>
