YouTube API docs

YouTube API: Search — Videos By Country

Discover Search data on YouTube from a user query and connect the results to search, catalog, or research interfaces.

Use “Videos By Country” when an exact object ID is not known and relevant candidates must be found first.

Method GET
Entity Search
Versions 2
What this endpoint does

What you can build with this API method

Review the result and common workflows first, then move to parameters and a working request example.

What this endpoint helps with

The response includes matching Search, public context, and pagination data when more results are available.

When to use it

Use “Videos By Country” when an exact object ID is not known and relevant candidates must be found first.

Common use cases

In-product search

Add YouTube data search to customer-facing and internal interfaces.

Catalog building

Find candidates by query and save relevant objects for later enrichment.

Market research

Collect result sets for topic, creator, and competitive analysis.

Available versions

Response version

Both versions solve the same job and accept the same parameters. Use the switch to compare the response structure and choose the version your client expects.

Response version V2

Switch versions on this page to compare response structures while keeping the same documentation URL.

What stays the same

Authentication, required parameters, and the request shape stay the same across V1 and V2. In practice, you choose the version when you build the endpoint path and when you parse the response.

What changes between versions

The main difference is the response envelope. Use V2 for new integrations and keep V1 only when you need compatibility with an existing client contract.

How to use it

How to call the method

Use the same API key header and the same query parameters for both versions. This documentation shows the shared parameter set first, then version-specific endpoint paths and code snippets.

Input parameters

Shared parameters
Parameter Required Type Example Description
country_code No str US Two-letter ISO 3166-1 alpha-2 country code used for YouTube localization. Example: US.
cursor No str | None QVFB... Next-page cursor returned by the previous response. Omit it for the first page.
duration No short | medium | long | None value Optional YouTube video duration filter. Can be used only without upload_date/feature and with sort_by=relevance. Examples: short, medium, long.
feature No live | hd | subtitles | creative_commons | 3d | 4k | 360 | location | hdr | vr180 | purchased | None value Optional YouTube video feature filter. Can be used only without upload_date/duration and with sort_by=relevance. Examples: hd, 4k, subtitles, hdr.
query No str technology review User-entered search query.
sort_by No relevance | uploadDate | viewCount | rating relevance YouTube search sort order. Examples: relevance, uploadDate, viewCount, rating.
upload_date No lastHour | today | thisWeek | thisMonth | thisYear | None value Optional YouTube upload date filter. Examples: today, thisWeek.

Version-specific request path

V2

Choose a version when you copy the exact endpoint path, example URL, and code snippet. The parameter list above stays the same.

GET /api/v2/youtube.com/search/videos-by-country

Normalized format

Code examples

curl --request GET \
  --url "https://www.scrapestorm.net/api/v2/youtube.com/search/videos-by-country" \
  --header "X-API-Key: 00000000-0000-4000-8000-000000000000" \
  # Optional parameters:
  # --data-urlencode 'country_code=US'
  # --data-urlencode 'cursor=QVFB...'
  # --data-urlencode 'duration=value'
  # --data-urlencode 'feature=value'
  # --data-urlencode 'query=technology review'
  # --data-urlencode 'sort_by=relevance'
  # --data-urlencode 'upload_date=value'
Response example

Live response by version

The preview keeps key fields and the first collection items so you can scan the response shape quickly. Switching versions changes the JSON format.

Response example

V2 response JSON

Verified example

This compact JSON example comes from the latest successful verification run for V2.

{
  "success": true,
  "status": "ok",
  "pagination": {
    "cursor": "QVFB...",
    "has_more": true
  },
  "search_context": {
    "sort_by": "relevance",
    "query": "technology review",
    "country_code": "US"
  },
  "data": {
    "videos": {
      "count": 23,
      "items": [
        {
          "author": {
            "url": "https://www.youtube.com/@howtomen",
            "channel_id": "UCqjVP9gAanUGFgTA5BRDvyA",
            "username": "howtomen",
            "display_name": "HowToMen"
          },
          "url": "https://www.youtube.com/watch?v=m9mCqZ7tmUg&pp=ygURdGVjaG5vbG9neSByZXZpZXc%3D",
          "video_id": "m9mCqZ7tmUg",
          "title": "CES 2026: 20 Best Tech You’ll Actually Want!",
          "snippet": "Here are the Best Gadgets at CES 2026 that will make you jealous that you don't own them! ▣ Aiper Learn more about AIPER ...",
          "published_time": "6 months ago",
          "duration_seconds": 1794,
          "duration_text": "29:54",
          "view_count": 836484,
          "badges": [
            "4K",
            "Verified"
          ],
          "thumbnail_url": "https://example.com/image.jpg",
          "thumbnails": [
            {
              "url": "https://i.ytimg.com/vi/m9mCqZ7tmUg/hq720.jpg?sqp=-oaymwEcCOgCEMoBSFXyq4qpAw4IARUAAIhCGAFwAcABBg==&rs=AOn4CLCxnjiJbLI1JSXtYNK8qUxr1GVkVA",
              "width": 360,
              "height": 202
            },
            {
              "url": "https://i.ytimg.com/vi/m9mCqZ7tmUg/hq720.jpg?sqp=-oaymwEcCNAFEJQDSFXyq4qpAw4IARUAAIhCGAFwAcABBg==&rs=AOn4CLBhirVSDkOJPc8X8Ybe0hXCvyj5nA",
              "width": 720,
              "height": 404
            }
          ]
        },
        {
          "author": {
            "url": "https://www.youtube.com/@LinusTechTips",
            "channel_id": "UCXuqSBlHAE6Xw-yeJA0Tunw",
            "username": "LinusTechTips",
            "display_name": "Linus Tech Tips"
          },
          "url": "https://www.youtube.com/watch?v=IJWvYvCJ0os&pp=ygURdGVjaG5vbG9neSByZXZpZXc%3D",
          "video_id": "IJWvYvCJ0os",
          "title": "Apple is SO Close to Winning Me - iPhone 17 / iPhone Air Long Term Review",
          "snippet": "Grab yourself a case or some overpriced stickers at https://iamveryshort.com Linus tested the iPhone 17 lineup longer than ...",
          "published_time": "6 months ago",
          "duration_seconds": 627,
          "duration_text": "10:27",
          "view_count": 1087707,
          "badges": [
            "4K",
            "Verified"
          ],
          "thumbnail_url": "https://example.com/image.jpg",
          "thumbnails": [
            {
              "url": "https://i.ytimg.com/vi/IJWvYvCJ0os/hq720.jpg?sqp=-oaymwEcCOgCEMoBSFXyq4qpAw4IARUAAIhCGAFwAcABBg==&rs=AOn4CLCzI6dbNGmOorGYR53dEOx8V6tQFg",
              "width": 360,
              "height": 202
            },
            {
              "url": "https://i.ytimg.com/vi/IJWvYvCJ0os/hq720.jpg?sqp=-oaymwEcCNAFEJQDSFXyq4qpAw4IARUAAIhCGAFwAcABBg==&rs=AOn4CLC0csPq_iHW6iZnGqNcETukPrey-g",
              "width": 720,
              "height": 404
            }
          ]
        },
        {
          "_more_items": 21
        }
      ]
    }
  }
}
What to do next

Continue the evaluation

Use this documentation as the first decision point, then move into pricing, platform coverage, and integration rules before you connect the endpoint for recurring use.

Open the YouTube platform page

Compare adjacent entities, API method groups, and related docs before implementation.

Open platform page

Compare API method pricing

Check where this API method sits inside the public price table before you scale usage.

View pricing

Review integration rules

Use the starter docs to confirm authentication, versioning, retries, and mock vs live behavior.

Open docs
FAQ

Questions teams ask before implementation

Use these answers to decide whether this API method fits your workflow, versioning choice, and rollout plan.

What data does this YouTube API method return?

The method performs “Videos By Country” for Search. The compact response example below shows the exact field structure.

Should I choose V1 or V2?

Choose V2 for new integrations because it provides a normalized structure. Use V1 only for compatibility with clients that already consume the platform-native format.

What do I need for the first request?

Create an API key, send it in the request header, and provide the required parameters from the table. The code samples already contain the correct path and request structure.