# Transcripts

> Get the transcript of a YouTube, Instagram, TikTok, or Loom video from its link, plus any on-screen and slide text.

`GET /v1/transcripts?url=` with a video link returns its transcript. It works for YouTube,
Instagram, TikTok, and Loom. Eden returns its stored copy first, and saves any new transcript for
good.

```http
GET https://api.eden.so/v1/transcripts?url={link}
```

## Query

| Param | Required | What it is                                                           |
| ----- | -------- | -------------------------------------------------------------------- |
| `url` | Yes      | The full link to the video, starting with `https://`. URL-encode it. |

## Example

```bash
curl -G "https://api.eden.so/v1/transcripts" \
  --data-urlencode "url=https://www.youtube.com/watch?v=Xyz123AbC45" \
  -H "Authorization: Bearer $EDEN_API_KEY"
```

```json
{
  "ok": true,
  "url": "https://www.youtube.com/watch?v=Xyz123AbC45",
  "platform": "youtube",
  "post_id": "sample-post-0",
  "language": "en",
  "duration_seconds": 540,
  "transcript": {
    "text": "Most people think they need more time to write. You need a system. Here is mine. Step one, I keep every idea in one place...",
    "status": "available",
    "truncated": false,
    "source": "cache"
  },
  "on_screen_text": { "text": null, "status": "not-supported" },
  "slide_text": { "text": null, "status": "not-supported", "truncated": false }
}
```

## Fields

| Field                  | What it is                                                                                                        |
| ---------------------- | ----------------------------------------------------------------------------------------------------------------- |
| `url`                  | The link you sent.                                                                                                |
| `platform`             | `youtube`, `instagram`, `tiktok`, or `loom` (for a video). Other platforms can answer too, see below.             |
| `post_id`              | Eden's id for the post. Use it with [`GET /v1/posts/{platform}/{id}`](https://eden.so/developers/posts/). `null` for Loom.       |
| `language`             | The post's language code, like `en`, when Eden knows it.                                                          |
| `duration_seconds`     | Video length, when known.                                                                                         |
| `transcript.text`      | The spoken words, or `null`.                                                                                      |
| `transcript.status`    | `available`, `not-supported`, `vendor-miss` (no transcript could be made), `fetch-disabled`, or `fetch-failed`.   |
| `transcript.truncated` | `true` when a very long transcript was cut short.                                                                 |
| `transcript.source`    | `cache` when Eden already had it, `live-fetch` when it was just made.                                             |
| `on_screen_text`       | Text shown on screen in an Instagram reel or TikTok (hooks, captions, lists). `status` can also be `scan-failed`. |
| `slide_text`           | The words on each slide of an Instagram carousel, as `Slide 1:` and so on.                                        |

Loom answers carry only `url`, `platform`, `post_id`, and `transcript`.

## Good to know

- **Stored first.** Eden checks its own copy before fetching. A transcript it fetches for you is
  saved for good, so the next call for that link comes back with `"source": "cache"`.
- **Reels and TikToks** are transcribed from the audio, so they work without captions.
- **First time for a link?** The call can answer `202` with `retry_after_seconds` while Eden fetches
  the post. Wait, then call again. Waiting is free.
- **No words, no charge.** If the video has no transcript, on-screen text, or slide text, the call is
  free. A call with words costs 0.1 credit, the same whether it came from the store or a fresh fetch.
- **Other links.** X, LinkedIn, Threads, and Substack links work too, but those posts are text.
  Use [`GET /v1/posts?url=`](https://eden.so/developers/posts/) to get their words.
- Any other link answers `422` with `"status": "unsupported"`.

## Errors

| HTTP  | `status`      | When                                          |
| ----- | ------------- | --------------------------------------------- |
| `202` | `queued`      | Eden is fetching the post for the first time. |
| `404` | `not-found`   | The post is gone or private.                  |
| `422` | `invalid`     | `url` is missing or not a full link.          |
| `422` | `unsupported` | Eden can't read this kind of link.            |

All errors are on the [Errors](https://eden.so/developers/errors/) page.
