---
title: "WhyViral API"
description: "Read any public TikTok, Instagram, YouTube or X post as JSON, from your own code."
---

> Documentation Index
> Fetch the complete documentation index at: https://api.whyviral.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# WhyViral API

Send a link to a public TikTok, Instagram, YouTube or X post and get back what it says and shows as JSON: a short summary, the transcript and on-screen text with their positions, and the places, recipes, products, apps, events, books and shows it names.

It reads every post type: videos up to 180 seconds, photo posts, carousels, TikTok slideshows and X text posts. Each read costs 20 credits.

The same key reads what your WhyViral projects hold, free: the brand mentions found, the ranking against competitors, alerts, saved creators, campaigns and reports.

## Quick start

1. **Make a key**

   In WhyViral, open [Settings → API keys](https://whyviral.ai/settings#api-keys) and select **Create key**. Copy it right away: it’s shown only once. Keep it on your server, for example as `WHYVIRAL_API_KEY`.

   New to WhyViral? [Create a free account](https://whyviral.ai/sign-in?mode=signup\&returnTo=%2Fsettings): it comes with 165 starter credits.
2. **Read a post**

   Send a post’s link. With `wait`, the request holds the answer for up to 20 seconds while the read runs.

   ```bash
   curl -X POST https://whyviral.ai/api/v1/reads \
     -H "Authorization: Bearer $WHYVIRAL_API_KEY" \
     -H "Content-Type: application/json" \
     -d '{"url": "https://www.tiktok.com/@example.kitchen/video/7430000000000000001", "wait": 20}'
   ```
3. **Use the answer**

   `status` is `"ready"` with the read, `"failed"` with an `error`, or `"pending"` with a 202 when it’s still running. Then ask for it again, as [Waiting for a read](https://api.whyviral.ai/waiting/) shows.

## Base URL

Every path is relative to `https://whyviral.ai/api/v1`. Requests and answers are JSON, and every time is ISO 8601 in UTC.

## What’s here

- [Authentication](https://api.whyviral.ai/authentication/): sending your key, and keeping it safe.
- [Waiting for a read](https://api.whyviral.ai/waiting/): what to do while a read runs.
- [The read object](https://api.whyviral.ai/read-object/): every field, the categories and what positions count.
- [Mentions, ranking and alerts](https://api.whyviral.ai/mentions/): the brand mentions a project found, counted and compared with competitors, and the alerts they raised.
- [Creators, campaigns and reports](https://api.whyviral.ai/creators-campaigns-reports/): saved creators, a creator search, campaigns and report links.
- [Errors](https://api.whyviral.ai/errors/), [Prices](https://api.whyviral.ai/prices/) and [Limits](https://api.whyviral.ai/limits/).
- [Data and privacy](https://api.whyviral.ai/data-and-privacy/): what the API reads and keeps.
- The [API reference](https://api.whyviral.ai/api/): each endpoint with its parameters, answers and code samples.

Source: https://api.whyviral.ai/index.mdx
