Answers

How do I get a YouTube video's view count and likes from its URL?

Short answer

Send the link to YouTube video detail (/v1/youtube/videos/get) and read metrics.views, metrics.likes and metrics.comments: $0.004 per video, any watch, youtu.be or Shorts link works, and no Google key is needed. If you already have a Google Cloud project, the official videos.list returns the same counts for 1 quota unit.

An agency runs 40 sponsored videos for a client and reports their views every morning. Someone opens each link and types the number into a sheet. That works for a week, then someone forgets a day. A scheduled call per link takes the person out of it.

YouTube video detail accepts url (watch, youtu.be, /shorts/, /embed/ and /live/ links) or id. It returns title, published_at, the channel's name and handle, the description in text, and the counts under metrics.

curl -s -G "https://api.okdata.online/v1/youtube/videos/get" \
  -H "Authorization: Bearer $OKDATA_API_KEY" \
  --data-urlencode "url=https://www.youtube.com/watch?v=dQw4w9WgXcQ" \
  -d fields=id,title,published_at,metrics.views,metrics.likes,metrics.comments

The response also has meta.fetched_at. Store it next to the numbers; a view count is only meaningful with the time it was read.

What 40 videos a day costs

Job Calls Cost
One check of one video 1 $0.004
40 videos, once a day for 30 days 1,200 $4.80
1,000 checks 1000 $4.00

Failed calls and videos that no longer exist (not_found) are not charged.

Be honest with yourself about the official API

For this exact job, Google's YouTube Data API is hard to beat. videos.list costs 1 quota unit and accepts up to 50 IDs per call, and a project gets 10,000 units a day for free (quota table). The 40-video report is one unit a day. If you can create a Google Cloud project and keep an API key, use it.

okdata makes more sense when:

  • you would rather not run a Google Cloud project or handle its quota and keys;
  • the same report also tracks TikTok and X posts, and you want one key and one response shape;
  • an AI agent fetches the numbers through the MCP server as part of a larger task.

Gotchas

  • No subscriber count. The channel's subscribers are not returned; author.followers is null and listed in meta.unavailable.
  • No shares or saves. YouTube does not show them publicly, so they are null.
  • Hidden likes. If a creator hides the like count, metrics.likes can be null.
  • Snapshots only. There is no history endpoint. Call on a schedule and keep your own time series.
  • Extras on request. view=full adds ext.duration_ms, ext.genre and ext.is_paid_promotion.

For a fuller monitoring setup, see the competitor monitoring solution page.

Updated