YouTube Shorts search API
API health
- 24h health
- Normal
- Healthy / normal
- Available
Last 24 hours
Last 30 days
Search YouTube Shorts across the whole site by keyword, with optional sort and date_range. Each Short has title, channel, view count, the time YouTube shows and is_backfill for related Shorts YouTube adds when matches run short. About 50 per page and the count varies; pass next_page_token back as page_token for more.
Send POST https://api.everyinfra.com/api/v1/social with platform set to youtube and action set to shorts_search. Price $0.79 per 1,000 requests ($0.000792 per call). Failed calls and empty results are not charged. Synchronous. For slow jobs add "mode": "async" to the body, take the job_id and poll.
AI prompt
#Please help me write a data collection script with the EveryInfra YouTube Shorts search endpoint (youtube/shorts_search).
How the endpoint works:
- Request: POST https://api.everyinfra.com/api/v1/social with the header Authorization: Bearer <API key>. Read the key from the EVERYINFRA_API_KEY environment variable and never hard-code it.
- In the request body, set platform to youtube and action to shorts_search, and put the parameters inside params.
- Required parameters:
- keyword: Search words, up to 200 characters. Searches Shorts across the whole site, not one channel.
- Optional parameters:
- date_range: Upload time: last_hour, today, this_week, this_month or this_year; leave it out for any time. A value that is not recognized returns 422 and is not charged. (allowed: last_hour / this_month / this_week / this_year / today)
- page_token: Page token. Leave it out for the first page, then pass back the previous response's next_page_token exactly as received, with the other parameters unchanged.
- sort: Order: relevance (default), newest, most_viewed or top_rated. A value that is not recognized returns 422 and is not charged. (allowed: most_viewed / newest / relevance / top_rated)
- Returns a list of records. Main fields of each record: type, id, url, title, text, author_name, author_username, author_id, author_url, author_avatar_url, author_is_verified (Whether the channel has a verified badg…), view_count; 17 fields in total, full list at https://api.everyinfra.com/api/v1/social/catalog?platform=youtube.
- Example request body:
{
"platform": "youtube",
"action": "shorts_search",
"params": {
"keyword": "minecraft"
}
}
- Price: $0.79 per 1,000 requests; failed and empty results are not charged.
- For dozens or hundreds of targets, add "mode": "async" to the body: you get a job_id at once and poll GET https://api.everyinfra.com/api/v1/jobs/{job_id} for the result.
- On 422, fix the request using the suggested parameter names and allowed values in the error; on 429 or 503, wait for Retry-After and try again.
Before writing code, ask me which targets I need, how many, which fields, and what output format I want; then confirm the plan and the rough cost with me.Request parameters
#| Name | In | Type | Required | Default | Description |
|---|---|---|---|---|---|
Authorization | header | string | Yes | - | Bearer followed by your API key. Create it in the console; never put it in a URL or a code repository. |
platform | body | string | Yes | youtube | Platform identifier, fixed value. |
action | body | string | Yes | shorts_search | Capability identifier, fixed value. |
keyword | body.params | string | Yes | - | Search words, up to 200 characters. Searches Shorts across the whole site, not one channel. |
date_range | body.params | string (enum) | No | - | Upload time: last_hour, today, this_week, this_month or this_year; leave it out for any time. A value that is not recognized returns 422 and is not charged.Allowed valueslast_hourthis_monththis_weekthis_yeartoday |
page_token | body.params | string | No | - | Page token. Leave it out for the first page, then pass back the previous response's next_page_token exactly as received, with the other parameters unchanged. About 50 Shorts per page, and the count varies a lot between pages; each page is one call and limit has no effect. Tokens last 24 hours, and the last page has no next_page_token. |
sort | body.params | string (enum) | No | - | Order: relevance (default), newest, most_viewed or top_rated. A value that is not recognized returns 422 and is not charged.Allowed valuesmost_viewednewestrelevancetop_rated |
Code samples
#curl -X POST 'https://api.everyinfra.com/api/v1/social' \
-H "Authorization: Bearer $EVERYINFRA_API_KEY" \
-H 'Content-Type: application/json' \
--data-raw '{
"platform": "youtube",
"action": "shorts_search",
"params": {
"keyword": "minecraft"
}
}'OpenAPI definition (JSON)Samples read the key from the EVERYINFRA_API_KEY environment variable; copied code never contains your key.
Response example
#{ "id": "req_…", "platform": "youtube", "action": "shorts_search", "results": [ { "type": "short", "id": "d1dIVnplTNg", "url": "https://www.youtube.com/shorts/d1dIVnplTNg", "title": "Making a WORKING Dance Floor in Minecraft", "view_count": 253000, "thumbnail_url": "https://i.ytimg.com/vi/d1dIVnplTNg/oar2.jpg?sqp=-oaymwEgCJUDEOAESFWQAgHyq4qpAw8IARUAAIhCcAHAAQbIAQE=&rs=AOn4CLDijdFz3Us_02xjf448y4idELAlsA", "is_backfill": false, "platform": "youtube" }, { "type": "short", "id": "NwOg9bYZkjY", "url": "https://www.youtube.com/shorts/NwOg9bYZkjY", "title": "minecraft facts", "view_count": 54000, "thumbnail_url": "https://i.ytimg.com/vi/NwOg9bYZkjY/oar2.jpg?sqp=-oaymwEgCJUDEOAESFWQAgHyq4qpAw8IARUAAIhCcAHAAQbIAQE=&rs=AOn4CLBmQHsuE5Wv_98Q4stufQgifrs1ZQ", "is_backfill": false, "platform": "youtube" } ], "next_page_token": …, "pagination": { … }, "count": 56, "billing": { "charged": …, "charged_usd": …, "balance_after_usd": …, … }, "quota": { … }}
Response fields
#Business data is in results. The table lists the fields a record can contain. Values the platform does not show are never made up.
| Field | Meaning |
|---|---|
type | Record type; values depend on the capability (for example video / image / text). |
id | The record's unique ID on the platform. Unique only within one platform; IDs can repeat across platforms. |
url | Link to the record on the platform. |
title | Title. null when the platform has no titles (for example text-only posts). |
text | Body text with HTML removed, returned in full and never cut short (on a few platforms the list results themselves carry only an excerpt; the platform's field notes say so). |
author_name | Author's display name. |
author_username | Author's username (@handle), usually usable in URLs. |
author_id | Author's unique ID on the platform. |
author_url | Link to the author's profile on the platform. |
author_avatar_url | Keeps the platform's own meaning |
author_is_verified | Whether the channel has a verified badge. |
view_count | Views or plays. null means not disclosed, not 0. |
duration | Keeps the platform's own meaning |
published_text | Publish time as written on the YouTube page, in relative form (e.g. 2 years ago), returned as is; null when the page shows none. |
thumbnail_url | Thumbnail link, lower resolution than image_url. |
badges | Badges shown on the video, as an array of strings (e.g. 4K, CC, New); an empty array when there are none. |
is_backfill | In Shorts search, whether YouTube added this item as related content because there were not enough matches. |
platform | Source platform identifier, the same as platform in the request (for example xiaohongshu, tiktok). |
Errors and billing
#- 401
- Missing or invalid key.
- 402
- Insufficient balance. Top up first.
- 422
- Invalid parameter name or value. Fix it using the suggestions in the error. No charge.
- 429
- Per-minute request limit reached. Wait for Retry-After, then try again.
- 503
- Could not complete. The held charge is returned to your balance. If the outcome is unknown, verify it before you retry.
- 200 empty
- No data. No charge.