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

# Transcribe a Video

> Generate a transcription and title of a video uploaded to Ayrshare using AI, then use them to create a post summary or a YouTube title. Max 10 minutes.

Generate a transcription and title of a video file using AI.
This transcription can then be used in the [/generate/post](https://www.ayrshare.com/docs/apis/generate/post-text.md) to create a social media summary of the video.
For [YouTube](https://www.ayrshare.com/docs/apis/post/social-networks/youtube.md), which requires a title, the generated title can be used.

> [!WARNING]
>
> The video must have been previously uploaded to Ayrshare with [/media](https://www.ayrshare.com/docs/apis/media/overview.md).
> Videos not hosted by Ayrshare will be rejected.
>
> Maximum video file size is 500GB and maximum duration is 10 minutes.

### Transcribe Video Guide

[Transcribe a Video](https://www.youtube.com/embed/d1JBbHrxmls)

## Header Parameters

**Authorization** `string` *required*

[API Key](https://www.ayrshare.com/docs/apis/overview.md#authorization) of the Primary Profile.

Format: `Authorization: Bearer API_KEY`

## Body Parameters

**videoUrl** `string` *required*

URL encoded video URL. The video must be hosted by Ayrshare.

```bash cURL theme={"system"}
curl \
-H "Authorization: Bearer API_KEY" \
-H 'Content-Type: application/json' \
-d '{"videoUrl": "https://img.ayrshare.com/random/landscape5.mp4"}' \
-X POST https://api.ayrshare.com/api/generate/transcription
```

```javascript JavaScript theme={"system"}
const API_KEY = "API_KEY";

fetch("https://api.ayrshare.com/api/generate/transcription", {
      method: "POST",
      headers: {
        "Content-Type": "application/json",
        "Authorization": `Bearer ${API_KEY}`
      },
      body: JSON.stringify({
        videoUrl: "https://img.ayrshare.com/random/landscape5.mp4", // required
      }),
    })
      .then((res) => res.json())
      .then((json) => console.log(json))
      .catch(console.error);
```

```python Python theme={"system"}
import requests

payload = {'videoUrl': 'https://img.ayrshare.com/random/landscape5.mp4'}
headers = {'Content-Type': 'application/json',
        'Authorization': 'Bearer API_KEY'}

r = requests.post('https://api.ayrshare.com/api/generate/transcription',
    json=payload,
    headers=headers)

print(r.json())
```

```php PHP theme={"system"}
<?php

$curl = curl_init();
$data = array (
  "videoUrl" => "https://img.ayrshare.com/random/landscape5.mp4"
);

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.ayrshare.com/api/generate/transcription',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS => http_build_query($data),
  CURLOPT_HTTPHEADER => array(
    'Authorization: Bearer API_KEY',
    'Accept-Encoding: gzip'
  ),
));

$response = curl_exec($curl);
curl_close($curl);
echo $response;
```

```json 200: Success theme={"system"}
{
    "status": "success",
    "transcript": "This is your last chance. After this, there is no turning back. You take the blue pill the story ends you wake up in your bed and believe whatever you want to be. You take the red pill you stay in Wonderland. And I show you how deep the rabbit hole goes.",
    "transcriptArray": [
        "This is your last chance.",
        "After this, there is no turning back.",
        "You take the blue pill the story ends you wake up in your bed and believe whatever you want to be. You take the red pill you stay in Wonderland.",
        "And I show you how deep the rabbit hole goes."
    ],
    "videoTitle": "Choose Wisely: Blue Pill or Red Pill Adventure Awaits!",
    "wordCount": 52
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.