A service API for retrieving YouTube video transcripts.
POST https://transcriptly.org/api/v1/transcript| Header | Type | Required | Description |
|---|---|---|---|
| x-api-key | string | Yes | API key |
| Parameter | Type | Required | Description |
|---|---|---|---|
| url | string | Yes | YouTube video URL |
| language | string | No | Language of the transcript to be returned, default is English |
{
"url": "https://www.youtube.com/watch?v=your_video_id",
"language": "en"
}Success Response (200 OK):
{
"code": 200,
"message": "Transcript generated successfully",
"data": {
"success": true,
"data": [{
"id": 1,
"start": 0.12,
"end": 2.159,
"text": "this might sound crazy but the way to"
}, {
"id": 2,
"start": 2.159,
"end": 3.84,
"text": "achieve what you want isn't what you"
},
{
"id": 3,
"start": 3.84,
"end": 5.56,
"text": "want isn't what you"
},
{
"id": 176,
"start": 395.56,
"end": 397.919,
"text": "video"
}],
"url": "https://www.youtube.com/watch?v=BJ2NvjS7Aio",
"language": "en",
"total": 176
}
}Error Response (HTTP status 400 Bad Request):
{
"code": 400,
"message": "Invalid request body"
}Error Response (HTTP status 400 Bad Request):
{
"code": 4001,
"message": "Invalid YouTube URL"
}Error Response (HTTP status 401 Unauthorized):
{
"code": 401,
"message": "Invalid API key"
}Error Response (HTTP status 403 Forbidden):
{
"code": 403,
"message": "Insufficient credits"
}Error Response (HTTP status 429 Too Many Requests):
{
"code": 429,
"message": "Access rate limit exceeded"
}Error Response (HTTP status 500 Internal Server Error):
{
"code": 5001,
"message": "Transcript generated failed",
"data": {
"success": false,
"data": [],
"url": "https://www.youtube.com/watch?v=-FNIAzYLCQA",
"language": "123",
"total": 0,
"error": "API request failed: 400"
}
}- Clone the project and install dependencies:
npm install
# or
yarn install- Configure environment variables:
Create a
.env.localfile and add:
TRANSCRIPTLY_API_KEY=your_api_key_here- Start the development server:
npm run dev
# or
yarn devThe server will be running at http://localhost:3000.
- Next.js - React Framework
- Tailwind CSS - Styling Framework
- Ensure you provide a valid YouTube video URL
- Keep your API key secure and never expose it publicly
- Comply with YouTube's Terms of Service and usage policies