DEV Community

dodou
dodou

Posted on

Video Keyword Research With the /google/videos Endpoint

The Google Videos tab is a keyword mine almost nobody works. Video keyword research tools exist, but they're one more subscription. The raw source is the Videos tab itself, and one POST returns it as JSON. This post builds a small video keyword research script on /google/videos at 1 credit per call, then turns the output into a YouTube content calendar.

The pattern: for each candidate keyword, pull the video results, keep the title, source, and duration, and bucket them by how competitive the niche looks. If three big channels from the same network own the first page, the keyword is hard. If the videos are old or from small channels, there is room.

The request

/google/videos takes the same envelope as the rest of the API. POST with the X-API-Key header to https://api.serpbase.dev/google/videos:

curl -X POST "https://api.serpbase.dev/google/videos" \
  -H "X-API-Key: $SERPBASE_KEY" \
  -H "Content-Type: application/json" \
  -d '{"q": "raspberry pi home assistant", "hl": "en", "gl": "us", "num": 10}'
Enter fullscreen mode Exit fullscreen mode

The response includes a videos array with title, link, source, duration, and thumbnail per result, wrapped in the standard envelope: status, request_id, elapsed_ms, credits_charged.

The script

A keyword file, one keyword per line, then this:

import json, requests

def video_serp(keyword: str, api_key: str) -> list:
    r = requests.post(
        "https://api.serpbase.dev/google/videos",
        headers={"X-API-Key": api_key, "Content-Type": "application/json"},
        json={"q": keyword, "hl": "en", "gl": "us", "num": 10},
        timeout=10,
    )
    r.raise_for_status()
    return r.json().get("videos", [])

def score(keyword: str, videos: list) -> dict:
    channels = {v["source"] for v in videos}
    avg_dur = sum(_parse_seconds(v.get("duration", "0:00")) for v in videos) / max(len(videos), 1)
    return {
        "keyword": keyword,
        "result_count": len(videos),
        "unique_channels": len(channels),
        "avg_duration_s": int(avg_dur),
        "tough": len(channels) <= 2 and len(videos) >= 8,
    }

def _parse_seconds(d: str) -> int:
    parts = d.split(":")
    if len(parts) == 2:
        return int(parts[0]) * 60 + int(parts[1])
    if len(parts) == 3:
        return int(parts[0]) * 3600 + int(parts[1]) * 60 + int(parts[2])
    return 0
Enter fullscreen mode Exit fullscreen mode

For every keyword the script writes one row: result count, unique channels, average duration, and a tough flag when the same two channels own the whole first page. That flag is the "hard keyword, skip it" signal.

The content calendar

Sort the scored keywords by tough=False and by avg_duration_s. Short average duration on a competitive-looking keyword means people watch short explainers — a scripted 5-minute video has a shot. Long average duration with few unique channels means the niche rewards depth and is already owned; write an article instead.

A week of topic ideas, computed in a single script run: 200 keywords × 1 call = 200 credits. Weekly runs for a month = 800 calls ≈ $0.24 on the Starter Boost pack ($3 / 10,000 searches, expires one month after purchase, once per account per month). At daily runs (6,000 calls/month) the Growth tier ($50 / 125,000 searches, credits never expire) costs about $2.40/month.

What this gives you that a manual search cannot

A manual Videos-tab search shows you the top of the page. The API gives you the same page as JSON you can diff week over week: when a keyword's first-page channels change, that is a content opportunity appearing in real time. The elapsed_ms and request_id fields keep the loop auditable — the same envelope pattern across /google/search, /google/news, and /google/videos at 1 credit each. That consistency is why the pipeline stays at ~30 lines instead of turning into a scraping project.

Honest limits

  • duration is parsed from Google's compact metadata, so a few results can miss it. The _parse_seconds fallback returns 0 for those.
  • hl/gl change which videos and channels show. Fix one locale per content strategy.
  • The tough heuristic is a first pass, not a verdict. Two dominant channels with 8+ results is a strong smell, but check the actual videos before dropping a keyword.

Source: SERP API comparison, updated Apr 23, 2026.

Full parameter and response reference: serpbase.dev/docs.

Top comments (0)