Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

github.com/mongj/youtube-transcriber-api

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/mongj/youtube-transcriber-api

  • v1.0.0
  • Source
  • Go
  • Socket score

Version published
Created
Source

youtube-transcriber-api

Youtube's official API currently does not support fetching of a video's transcript. This project is a RESTful API built on top of jdepoix's API, and provides simple HTTP endpoints for retrieving pure-text transcripts for YouTube videos. It also provides the ability to translate transcripts into different languages.

codecov

API Endpoints

Note: All language codes used should follow the ISO 639-1 standard (case-sensitive)

Transcripts

GET /v1/transcripts{{id}}

Retrieve transcripts for a specified YouTube video. (try: https://youtube-transcriber-api.vercel.app/v1/transcripts?id=k_GM1JA608Y&lang=en)

Query Parameters

ParameterRequiredNote
idYesThe ID of the YouTube video
langNoThe language code for the desired transcript. If no language is specified, all available transcripts will be returned
typeNoThe desired output format. Accepts json, text, srt, and webvtt. Default to text if not specified
lbNoBoolean (0 or 1) indicating whether the transcript should contain line breaks. Only applies for type text. Default to 0 if not specified
sfxNoBoolean (0 or 1) indicating whether the transcript should contain sound effects information eg. [Cheering], [Applause], [Music]. Default to 0 if not specified

Response

The request returns a JSON object containing the following fields:

FieldDescription
video_idThe ID of the YouTube video
transcriptsA list of transcripts. Each transcript has the following fields:

language: The language of the transcript
languageCode: The ISO 639-1 code
isGenerated: Boolean indicating whether the transcript is machine-generated
isTranslatable: Boolean indicating whether the transcript can be translated
text: The transcript in the specified format

Translation

GET /v1/translations{{id}}{{lang}}

Retrieve a translated transcript for a specified YouTube video. (try: https://youtube-transcriber-api.vercel.app/v1/transcripts?id=k_GM1JA608Y&lang=es)

Query Parameters

ParameterRequiredNote
idYesThe ID of the YouTube video
langYesThe language code for the target language

Response

The request returns a JSON object containing the following fields:

FieldDescription
video_idThe ID of the YouTube video
sourceLanguageThe language code of the source transcript
targetLanguageThe language code of the target translation
transcriptsThe transcript text

Metadata

GET /v1/metadata{{id}}

Retrieve transcript metadata for a specified YouTube video. (try: https://youtube-transcriber-api.vercel.app/v1/metadata?id=k_GM1JA608Y)

Query Parameters

ParameterRequiredNote
idYesThe ID of the YouTube video

Response

The request returns a JSON object containing the following fields:

FieldDescription
video_idThe ID of the YouTube video.
transcriptsA list of transcript metadata. Each item has the following fields:

language: The language of the transcription
languageCode: The ISO 639-1 code
isGenerated: Boolean indicating whether the transcript is machine-generated
isTranslatable: Boolean indicating whether the transcript can be translated

Future Plans

This project is still in active development. Future plans include

  • Add rate limiting
  • Automated testing

Donation

"Buy Me A Coffee"

License

See license

FAQs

Package last updated on 16 Dec 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc