YouTube → Markdown

Examples:

curl -s "https://brettterpstra.com/yt-md/api?id=dQw4w9WgXcQ&thumb=hq&output=json"

curl -s "https://brettterpstra.com/yt-md/api?id=dQw4w9WgXcQ&thumb=maxresdefault.jpg"

Paste a YouTube URL or ID above and click Generate.

API / CGI usage

Purpose: This tool produces plain-text Markdown snippets (image + link + title) that are ideal for pasting into GitHub README files, issues, PR comments, and other Markdown-friendly environments.

The CGI endpoint (index.cgi) accepts the following query parameters and returns plain-text Markdown:

Example responses look like:

[![Never Gonna Give You Up](http://img.youtube.com/vi/dQw4w9WgXcQ/0.jpg)](http://www.youtube.com/watch?v=dQw4w9WgXcQ "Never Gonna Give You Up")

curl examples

Using a URL:

curl -s "https://brettterpstra.com/yt-md/api?url=https://www.youtube.com/watch?v=dQw4w9WgXcQ"

Using an ID:

curl -s "https://brettterpstra.com/yt-md/api?id=dQw4w9WgXcQ"

Provide a custom title (override scraping):

curl -s "https://brettterpstra.com/yt-md/api?url=https://youtu.be/dQw4w9WgXcQ&title=My%20Title"

Request JSON (useful for programmatic consumers):

curl -s "https://brettterpstra.com/yt-md/api?id=dQw4w9WgXcQ&output=json"

Example JSON response:

Request HTML without a caption:

curl -s "https://brettterpstra.com/yt-md/api?id=dQw4w9WgXcQ&output=html&caption=0"

Request a specific thumbnail size (thumb parameter):

curl -s "https://brettterpstra.com/yt-md/api?id=dQw4w9WgXcQ&thumb=hq&output=json"
curl -s "https://brettterpstra.com/yt-md/api?id=dQw4w9WgXcQ&thumb=maxresdefault.jpg"

Why this is handy for GitHub

The output is plain Markdown (image linked to the YouTube video with a title). It's designed so you can copy it directly into a GitHub README.md, issue, or pull request comment and have it render as a clickable thumbnail with title.