Video Search API Tutorial: A Live-Tested Guide (2026)

By Serpent API Team · · 10 min read

A video search API returns ranked video results — titles, URLs, durations, view counts, thumbnails and embed links — as JSON from a single GET request. No player scraping, no per-platform integrations. This tutorial walks through the Serpent API video search endpoint engine by engine, and every request in it was actually run against the live API on July 18, 2026 — the outputs, timings and field tables below are the real ones, including the places where engines behave differently.

That last part matters, because the response you get depends heavily on which engine you pick, and most write-ups gloss over it. We'll cover the three supported engines, the exact fields each one returned in live tests, the filters that demonstrably work, a tested Python client, and the honest answer to “where's Google?”

What a video search API returns

Search engines maintain dedicated video indexes — aggregating YouTube, Vimeo, Dailymotion, TikTok and thousands of publisher sites — and a video search API exposes that index as structured data. One query fans out across every platform the engine indexes, which is the practical difference from integrating platform APIs one by one: you get cross-platform coverage and SERP-style ranking for free. For YouTube-only depth (channel stats, per-video analytics), a dedicated YouTube API is the better tool; the two are complementary.

Serpent API's endpoint is GET /api/videos. It takes q (required), engine (ddg — the default — yahoo, or bing), country, num (1–100), plus the filter parameters covered below. Full parameter reference in the API docs.

Setup and first request

Create a free account — 10 free searches, no card — copy your key, and you can be looking at JSON in under a minute:

curl -H "X-API-Key: YOUR_API_KEY" \
  "https://apiserpent.com/api/videos?q=how+to+train+a+golden+retriever&country=us"

Our July 18 run returned 56 videos in 3763ms on the default ddg engine. Here's the first result exactly as the API returned it (description trimmed for print):

{
  "position": 1,
  "title": "How to Train Your Golden Retriever | Best Golden Retriever Puppy Training Tips",
  "url": "https://www.youtube.com/watch?v=CTaZkCpkpvM",
  "description": "Hi fellow dog lover! My dog Billie had so many behavior problems...",
  "duration": "10:01",
  "publishedTime": "2022-09-10T16:00:10.0000000",
  "provider": "Bing",
  "publisher": "YouTube",
  "viewCount": 4894,
  "thumbnail": "https://tse1.mm.bing.net/th/id/OVP.Qbwr3ji_rSSywwcWbnwe4QHgFo?pid=Api",
  "embedUrl": "https://www.youtube.com/embed/CTaZkCpkpvM?autoplay=1"
}

Everything you'd want for a video-intent dashboard is already parsed: an ISO publish timestamp, an integer view count you can sort on, and an embedUrl you can drop straight into an iframe. If you're publishing the results, the fields map cleanly onto schema.org's VideoObject vocabulary.

The response fields, engine by engine

This is the part nobody documents from live data, so we did: the table below records exactly which fields each engine returned on July 18, 2026, from real responses to real queries. It's worth reading before you write a single struct or model class.

Fieldddg (default)yahoo / bing
position✅ integer (1)string ("1")
title
url
duration"10:01""02:21"
thumbnail
description✅ full text
publisher"YouTube"
publishedTime✅ ISO timestamp
viewCount✅ integer 4894
views✅ string "6.9M views"
source"youtube.com"
embedUrl
Max results seen live5660

Three practical takeaways from that table. First, ddg is the metadata-rich engine — it's the only one with descriptions, ISO timestamps, integer view counts and embed URLs, which is why it's the default. Second, the yahoo and bing engines serve results from Yahoo's video search (as the docs note) with up to 60 results and human-readable strings like "6.9M views" — fine for display, but you'll parse them before sorting. Third, the type gotcha: position is an integer on ddg and a string on yahoo/bing. If your JSON decoder is strict about types — as Go's is, something our Golang tutorial deals with at length — normalize that field before it bites you.

A tested Python client

Standard library only — a video search API is a plain HTTPS GET, so urllib covers it. This exact script was run on July 18, 2026:

import os, json, urllib.parse, urllib.request

API_KEY = os.environ["SERPENT_API_KEY"]
BASE = "https://apiserpent.com/api/videos"

def video_search(query, **params):
    params["q"] = query
    req = urllib.request.Request(
        BASE + "?" + urllib.parse.urlencode(params),
        headers={"X-API-Key": API_KEY},
    )
    with urllib.request.urlopen(req, timeout=30) as resp:
        return json.load(resp)

data = video_search("how to make sourdough bread", engine="ddg", num=5)
print(f"{data['meta']['totalVideos']} videos in {data['meta']['elapsed']}")
for v in data["results"]["videos"]:
    views = v.get("viewCount")
    views = f"{views:,} views" if isinstance(views, int) else "views n/a"
    print(f"{v['position']}. [{v['duration']}] {v['title'][:60]} — {views}")

Real output from that run:

5 videos in 10122ms
1. [16:09] How To Make Sourdough Bread Masterclass — 16,317,362 views
2. [14:08] YOUR FIRST SOURDOUGH (Sourdough Bread For Complete Beginners — 4,526,808 views
3. [9:25] The Ultimate Homemade Sourdough Bread — 3,728,473 views
4. [16:50] Amazing Sourdough Bread Recipe — 3,509,308 views
5. [11:53] Bake the Perfect Sourdough Bread: A Step-by-Step Guide — 3,021,501 views

Note the .get("viewCount") defensive read — write your client against the field table above and it survives an engine switch. Timing honesty: this run took 10.1s while the earlier one took 3.8s. Live searches vary; if you're batching thousands of queries, size a worker pool to your account's documented allocations (the rate-limit comparison has cross-provider numbers, and the scale guide covers the client engineering).

Rank tracking? Use format=simple

If you only care about ranking order — say you're tracking where your videos place for a keyword — pass format=simple and the response collapses to a flat array of four fields. Live output with engine=bing&num=5:

[
  { "position": 1, "title": "All React Hooks Explained in 2 Hours | Complete React Hooks Tutorial with Example",
    "url": "https://www.youtube.com/watch?v=6wf5dIrryoQ", "duration": "17:47" },
  { "position": 2, "title": "Basic React Hooks Crash Course (useState, useEffect, useMemo, useCallback) | WebDevSimplified",
    "url": "https://www.youtube.com/watch?v=qRkSWHbGkEU", "duration": "40:34" },
  ...
]

Smaller payloads, trivial parsing, and the same flat shape across all five SERP endpoints — the pattern our SERP API uses for web results too. (Notice position came back as an integer here: the simple formatter normalizes it for you.)

Filters that actually work

Filter support is where video APIs most often overpromise, so we tested rather than transcribed. A live run of duration=short&freshness=m on the default engine returned 60 results whose first eight durations were 1:05, 0:33, 0:11, 0:09, 0:08, 0:43, 0:59, 4:26 — overwhelmingly sub-minute clips — and whose publish timestamps all fell within the previous month (July 6, June 20, June 24…). The filters are engine-side, so they shape which videos are retrieved, not just a post-hoc trim; treat the boundaries as the engine's judgment (that one 4:26 still counted as “short”) rather than hard cutoffs.

Production notes

Three behaviors to build around, all observed rather than theorized. First, result counts float: we asked for the default and got 56 on one engine, 60 on another — read meta.totalVideos instead of assuming, and treat a thin result set for an obscure query as normal engine behavior. Second, timings float too (3.8s and 10.1s for the same shape of request in our runs), so give clients a 30-second timeout and log meta.elapsed if you care about latency trends. Third, if you push past your account's request allocations you'll see a 429 — the platform's automated protection against overload — with a Retry-After header that tells your client exactly how long to pause. Honor it and back off with jitter; the retry pattern in our Go client tutorial ports to any language in a few lines.

Where's Google in all this?

Honest answer: there is no engine=google on the dedicated video endpoint, and requesting it returns a clear 400 — we ran it so you don't have to:

{ "success": false,
  "error": "Video search is available with engine=ddg or engine=yahoo. Google videos appear inline in web search results." }

That error message is the architecture lesson: Google doesn't expose a standalone video vertical the way it once did — it surfaces video carousels inside web results. So if you specifically need Google's video rankings, run a deep web search and read results.videos from the response; the Google SERP API returns inline videos alongside organic results, People Also Ask and AI Overviews. For everything else — cross-platform video discovery, metadata, competitive monitoring — the dedicated endpoint is purpose-built, and its engines return richer per-video fields than Google's inline carousel does. (And remember that all live SERPs shuffle between runs — here's why — so track medians, not single samples.)

What it costs

Video search is one of Serpent API's cheapest verticals — half the price of web search at every tier: from $0.30 per 1,000 searches on the entry tier down to $0.03 and then $0.015 per 1,000 at the highest tier — the numbers above come from the live pricing page today, and the video search API page keeps the current tier table. At $0.015/1K, monitoring 1,000 keywords daily for a month costs about 45 cents. Comparing providers for a bigger stack? The interactive cost calculator models real monthly bills across ten providers, the cheapest SERP API breakdown covers the web-search side, and the 2026 SERP API comparison ranks the field overall.

What people build with it

Content-gap research: query your target keywords, aggregate publisher and viewCount, and you know which topics have demand but weak coverage. Competitive monitoring: schedule daily format=simple runs and diff the positions — the same pattern as web rank tracking, at video-vertical prices. Editorial embeds: embedUrl plus thumbnail gives a CMS everything it needs to attach relevant video to articles automatically. Trend detection: freshness=d plus viewCount surfaces what took off in the last 24 hours for any topic you care about.

FAQ

Is there a free video search API?

Yes — video search is included in Serpent API's free tier: 10 searches on signup, no card, same endpoint and JSON as paid plans.

Which engines are supported?

ddg (default), yahoo and bing. Google isn't offered as a dedicated video engine — its videos live inline in web results, which a deep web search exposes under results.videos.

How many results can I get per call?

num accepts 1–100. Live runs served 56 (ddg) and 60 (yahoo) for single queries; always read meta.totalVideos for the count actually returned.

Can I filter by video length or upload date?

Yes — duration and freshness (plus safe, resolution, and yahoo/bing's time). Our live duration=short&freshness=m test returned mostly sub-minute videos published within the prior month.

How fast are responses?

Seconds, not milliseconds — 3.8 to 10.1s across the runs recorded for this tutorial. Batch work should lean on concurrency within your account's documented allocations rather than raw per-call speed.

Search videos from your code today

Every request in this tutorial ran against the live API before publishing. Start with 10 free searches — no card — and video queries from $0.015 per 1,000 at scale.

Start Free — 10 Searches, No Card

Explore: Video Search API · API Docs · Pricing

References

Related Posts