POST

Stato di salute dell'API

Operatività nelle ultime 24 ore
Normale
  • Buono / normale
  • Disponibile
Normale

Ultime 24 ore

Ultimi 30 giorni

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.

Invia POST https://api.everyinfra.com/api/v1/social con platform impostato su youtube e action impostato su shorts_search. Prezzo $0.79 per 1.000 richieste ($0.000792 per chiamata). Le chiamate non riuscite e i risultati vuoti non vengono addebitati. Sincrona. Per i job più lenti, aggiungi "mode": "async" al corpo della richiesta, recupera il job_id ed esegui il polling.

Prompt per l'AI

#
Aiutami a scrivere uno script di raccolta dei dati con l'endpoint YouTube Shorts search di EveryInfra (youtube/shorts_search).

Come funziona l'endpoint:
- Richiesta: POST https://api.everyinfra.com/api/v1/social con l'header Authorization: Bearer <chiave API>. Leggi la chiave dalla variabile d'ambiente EVERYINFRA_API_KEY e non scriverla mai direttamente nel codice.
- Nel corpo della richiesta imposta platform su youtube e action su shorts_search, e inserisci i parametri in params.
- Parametri obbligatori:
  - keyword: Search words, up to 200 characters. Searches Shorts across the whole site, not one channel.
- Parametri facoltativi:
  - 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. (valori consentiti: 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. (valori consentiti: most_viewed / newest / relevance / top_rated)
- Restituisce un elenco di record. Campi principali di ogni 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 campi in totale, elenco completo su https://api.everyinfra.com/api/v1/social/catalog?platform=youtube.
- Esempio di corpo della richiesta:
{
  "platform": "youtube",
  "action": "shorts_search",
  "params": {
    "keyword": "minecraft"
  }
}
- Prezzo: $0.79 per 1.000 richieste; le richieste non riuscite e i risultati vuoti non vengono addebitati.
- Per decine o centinaia di target, aggiungi "mode": "async" al corpo: ricevi subito un job_id ed esegui il polling su GET https://api.everyinfra.com/api/v1/jobs/{job_id} per ottenere il risultato.
- In caso di 422, correggi la richiesta usando i nomi dei parametri e i valori consentiti suggeriti nell'errore; in caso di 429 o 503, attendi il tempo indicato da Retry-After e riprova.

Prima di scrivere il codice, chiedimi quali target mi servono, quanti, quali campi e quale formato di output voglio; poi conferma con me il piano e il costo indicativo.

Parametri della richiesta

#
NomePosizioneTipoObbligatorioPredefinitoDescrizione
AuthorizationheaderstringSì-Bearer seguito dalla tua chiave API. Creala nella console; non inserirla mai in un URL o in un repository di codice.
platformbodystringSìyoutubeIdentificativo della piattaforma, valore fisso.
actionbodystringSìshorts_searchIdentificativo della funzionalità, valore fisso.
keywordbody.paramsstringSì-Search words, up to 200 characters. Searches Shorts across the whole site, not one channel.
date_rangebody.paramsstring (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.Valori consentitilast_hourthis_monththis_weekthis_yeartoday
page_tokenbody.paramsstringNo-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.
sortbody.paramsstring (enum)No-Order: relevance (default), newest, most_viewed or top_rated. A value that is not recognized returns 422 and is not charged.Valori consentitimost_viewednewestrelevancetop_rated

Esempi di codice

#
bash
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"
  }
}'

Definizione OpenAPI (JSON)Gli esempi leggono la chiave dalla variabile d'ambiente EVERYINFRA_API_KEY; il codice copiato non contiene mai la tua chiave.

Esempio di risposta

#
Acquisita il November 21, 2026 at 07:24 (UTC) chiamando questa API con i parametri dell'esempio di codice qui sopra. results e count sono la risposta reale di quella chiamata, da cui sono state rimosse le informazioni personali (nomi, handle, avatar, link ai profili, recapiti); l'elenco conserva i primi 2. id, billing e quota cambiano a ogni chiamata, quindi ne viene mostrata solo la struttura.
json
{  "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": { … }}

Campi della risposta

#

I dati di business si trovano in results. La tabella elenca i campi che un record può contenere; i valori che la piattaforma non mostra non vengono mai inventati.

CampoSignificato
typeTipo di record; i valori dipendono dalla funzionalità (ad esempio video / image / text).
idID univoco del record sulla piattaforma. È univoco solo all'interno di una piattaforma; gli ID possono ripetersi tra piattaforme diverse.
urlLink al record sulla piattaforma.
titleTitolo. null quando la piattaforma non prevede titoli (ad esempio post di solo testo).
textTesto del contenuto senza HTML, restituito per intero e mai troncato (su alcune piattaforme i risultati degli elenchi contengono solo un estratto; lo indicano le note sui campi della piattaforma).
author_nameNome visualizzato dell'autore.
author_usernameUsername dell'autore (@handle), di solito utilizzabile negli URL.
author_idID univoco dell'autore sulla piattaforma.
author_urlLink al profilo dell'autore sulla piattaforma.
author_avatar_urlMantiene il significato attribuito dalla piattaforma
author_is_verifiedWhether the channel has a verified badge.
view_countVisualizzazioni o riproduzioni. null significa non rese note, non 0.
durationMantiene il significato attribuito dalla piattaforma
published_textPublish 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_urlLink alla miniatura, a risoluzione inferiore rispetto a image_url.
badgesBadges shown on the video, as an array of strings (e.g. 4K, CC, New); an empty array when there are none.
is_backfillIn Shorts search, whether YouTube added this item as related content because there were not enough matches.
platformIdentificativo della piattaforma di origine, uguale a platform nella richiesta (ad esempio xiaohongshu, tiktok).

Errori e addebiti

#
401
Chiave mancante o non valida.
402
Saldo insufficiente. Effettua prima una ricarica.
422
Nome o valore del parametro non valido. Correggilo seguendo i suggerimenti dell'errore. Nessun addebito.
429
Raggiunto il limite di richieste al minuto. Attendi il tempo indicato da Retry-After, poi riprova.
503
Impossibile completare. L'importo trattenuto torna sul tuo saldo. Se l'esito è incerto, verificalo prima di riprovare.
Risposta 200 vuota
Nessun dato. Nessun addebito.

Errori

Google Analytics: serve il consenso Privacy