# CleanScript docs

Ask a YouTube, TikTok or Instagram post a question, or name the fields you want, and get JSON with the quote and moment behind every value. Or its clean transcript.

One HTTP API: send a post link and a question, get the answer as JSON with the quote and moment behind it. Or every word, as a clean transcript.

```bash
curl https://api.cleanscript.ai/v1/extract \
  -H "Authorization: Bearer $CLEANSCRIPT_API_KEY" \
  --json '{"url": "https://youtu.be/jwnez8HdN7E", "prompt": "Who sponsors it?"}'
```

## What you can get

- [**Answers**](https://cleanscript.ai/docs/extract.md): `POST /v1/extract` takes a question, a preset or your own JSON Schema, and returns JSON with a quote and moment for every value; what the post doesn't say is `null`.
- [**A transcript**](https://cleanscript.ai/docs/transcripts.md): `GET /v1/transcript` returns clean text in paragraphs and sections, with times and a link to each moment. Automatic captions are corrected.
- [**A creator's posts**](https://cleanscript.ai/docs/posts.md): `GET /v1/posts` lists recent posts, ready for the two calls above.
- **Your balance**: `GET /v1/account`, free.

## The basics

- **Base URL:** `https://api.cleanscript.ai`
- **Auth:** `Authorization: Bearer <key>`. Create a key in the [dashboard](https://cleanscript.ai/dashboard/api-keys); new accounts get 100 free credits, no card.
- **Cost:** 1 credit per started 10 minutes of video for a transcript; see [Credits & limits](https://cleanscript.ai/docs/credits.md).
- **Posts:** YouTube videos and Shorts, TikTok posts, Instagram posts and Reels (TikTok and Instagram are in beta). Any link form works, or a bare YouTube video ID.
- **Shape:** JSON in and out, snake_case, times in seconds. Every field is always present; unknown values are `null`.
- **Errors:** one shape, never charged. See [errors](https://cleanscript.ai/docs/credits.md#errors).

## How to use it

- **Code:** curl, or the Python and TypeScript SDKs. Start with the [Quickstart](https://cleanscript.ai/docs/quickstart.md).
- **AI agents:** the MCP server at `https://api.cleanscript.ai/mcp`, a skill for coding agents, and `llms.txt`. See [Agents & MCP](https://cleanscript.ai/docs/agents.md).
- **No-code tools:** n8n, Make and Zapier over HTTP. See [Batches & automations](https://cleanscript.ai/docs/automations.md).
- **Your browser:** the [Playground](https://cleanscript.ai/playground) runs a post and shows the request behind it.
