Skip to content
← Blog

Read YouTube video data without a Google Cloud project

Get YouTube video details, channels, comments, transcripts and search results as clean JSON with one HTTP call, no API project or OAuth setup.

1 min read#youtube#tutorial

The official YouTube Data API is solid, but getting started means a Google Cloud project, an API key, and a daily quota measured in units that run out fast on search. For reading public data, there is a shorter path.

One call

curl "https://api.hoshime.com/v1/youtube/video?id=dQw4w9WgXcQ" \
  -H "Authorization: Bearer $HOSHIME_TOKEN"

The id parameter takes an id or any YouTube URL: watch, youtu.be, shorts, embed or live. The answer is a Video: title, description, author, publish time, duration, view, like and comment counts, thumbnails and keywords, with the same field names hoshime uses for videos on every platform.

What else you can read

The YouTube reference lists every endpoint. Among them:

  • channel, channelVideos, channelShorts: a channel and its uploads
  • comments and commentReplies: comment threads, paged with cursors
  • transcript: the captions of a video
  • search, suggestions, hashtag, related: discovery

List endpoints page with an opaque cursor. Pass meta.pagination.nextCursor back as cursor until hasMore is false. See Pagination.

In code

import os, requests

res = requests.get(
    "https://api.hoshime.com/v1/youtube/channelVideos",
    params={"id": "@YouTube"},
    headers={"Authorization": f"Bearer {os.environ['HOSHIME_TOKEN']}"},
)
for video in res.json()["data"]:
    print(video["publishedAt"], video["viewCount"], video["title"])

Thumbnails without any call

YouTube serves thumbnails at predictable URLs. The free YouTube thumbnail downloader builds every size from a video link, right in your browser.

esc
↑↓ move↵ open