# FlashData YouTube Video Metadati API

Recuperare i metadati video di YouTube video ID, compresi i dettagli del canale, conteggi di fidanzamento, miniature, formati e capitoli disponibili.

Riferimento canonico: https://flashdata.dev/it/docs/sources/youtube_metadata
Recensito: 2026-10-23

Punto di arrivo: POST https://data.flashdata.dev/v1/queries/realtime
Autenticazione: X-API-Key: YOUR_API_KEY
Modalità: [Realtime](https://flashdata.dev/it/docs/reference/realtime-and-async/reference.md#realtime) · [Async](https://flashdata.dev/it/docs/reference/realtime-and-async/reference.md#async) · [Batch](https://flashdata.dev/it/docs/reference/batch-and-bulk/reference.md#batch) · [Bulk](https://flashdata.dev/it/docs/reference/bulk-processing/reference.md)

Permesso di origine richiesto: youtube_metadata

Sostituisci YOUR_API_KEY con una chiave API che ha questo permesso di origine e crediti disponibili. Eseguire le richieste sul server o sul server host dell'agente.

[Impostare l'autenticazione](https://flashdata.dev/it/docs/guides/headers-and-authentication/reference.md)

[Recuperare e utilizzare i metadati video](https://flashdata.dev/it/docs/guides/video-metadata-recipe/reference.md)

<a id="quickstart"></a>

## Invia una richiesta

### Python

```bash
python3 -m pip install requests
```

```python
import json

import requests

api_key = "YOUR_API_KEY"
payload = {
    "source": "youtube_metadata",
    "video_id": "dQw4w9WgXcQ",
    "params": {
        "include_formats": False,
        "include_chapters": True,
    },
}

response = requests.post(
    "https://data.flashdata.dev/v1/queries/realtime",
    headers={"X-API-Key": api_key},
    json=payload,
    timeout=120,
)
response.raise_for_status()
print(json.dumps(response.json(), ensure_ascii=False, indent=2))
```

### Bash / cURL

```bash
api_key="YOUR_API_KEY"
curl --fail-with-body --max-time 120 --request POST "https://data.flashdata.dev/v1/queries/realtime" \
  --header "Content-Type: application/json" \
  --header "X-API-Key: $api_key" \
  --data-binary @- <<'FLASHDATA_JSON'
{
  "source": "youtube_metadata",
  "video_id": "dQw4w9WgXcQ",
  "params": {
    "include_formats": false,
    "include_chapters": true
  }
}
FLASHDATA_JSON
```

<a id="parameters"></a>

## Parametri

<a id="parameters-group-0"></a>

### Corpo della richiesta

| Parametro | Tipologia | Obbligatorio | Predefinito | Designazione |
| --- | --- | --- | --- | --- |
| <a id="parameter-source"></a> source | string | Sì | — | Impostare su youtube_metadata.  |
| <a id="parameter-video_id"></a> video_id | string | Sì | Non impostato | Il video 11-character YouTube video ID, come FUfGcZ092b0. Accetta lettere, numeri, sottolineature e trattini. Lunghezza minima: 11. Lunghezza massima: 11. Modello: ^[A-Za-z0-9_-]{11}$ |
| <a id="parameter-params"></a> params | object | No | {} | Settings per questa richiesta.  |
| <a id="parameter-callback_url"></a> callback_url | string · nullable | No | Non impostato | Async e solo lotto. Completamento HTTPS pubblico URL sulla porta 443, fino a caratteri 2,048. Nessuna credenziali utente o frammentazione URL. Omit, utilizzare null o una stringa vuota per nessuna notifica. In un lotto, impostare questo su ogni query, param esterni.  |

<a id="parameters-group-1"></a>

### Opzioni di risposta

| Parametro | Tipologia | Obbligatorio | Predefinito | Designazione |
| --- | --- | --- | --- | --- |
| <a id="parameter-params-include_formats"></a> params.include_formats | boolean | No | true | Includere i formati multimediali disponibili e il loro codec, la risoluzione e le informazioni bitrate.  |
| <a id="parameter-params-include_chapters"></a> params.include_chapters | boolean | No | true | Includi i capitoli quando il video li ha.  |

<a id="response"></a>

## Leggi il risultato

Salvare la risposta di successo JSON come response.json. Salvare questo come read-response.py ed eseguire pitone read-response.py. Utilizza solo la libreria standard di Python e non fa nuove richieste.

### read-response.py

```python
import json
from pathlib import Path

response = json.loads(Path("response.json").read_text(encoding="utf-8-sig"))
if response.get("status") not in ("done", "completed") or not isinstance(response.get("results"), list):
    raise SystemExit("Expected completed result JSON; inspect the response or job status.")
if not response["results"]:
    print("[]")
    raise SystemExit(0)
result = response["results"][0]

output = {name: result.get(name) for name in (
    "videoId", "title", "channel", "duration", "hasTranscripts", "transcriptLanguages"
)}
print(json.dumps(output, ensure_ascii=False, indent=2))
```

## Risposta di esempio

Esempio registrato; i campi e i conti dipendono dalla fonte e dall'ingresso richiesto.
```json
{
  "source": "youtube_metadata",
  "status": "done",
  "results": [
    {
      "videoId": "dQw4w9WgXcQ",
      "title": "Rick Astley - Never Gonna Give You Up (Official Video) (4K Remaster)",
      "description": "The official video for “Never Gonna Give You Up” by Rick Astley. \n\nNever: The Autobiography 📚 OUT NOW! \nFollow this link to get your copy and listen to Rick’s ‘Never’ playlist ❤️ #RickAstleyNever\nhttps://linktr.ee/rickastleynever\n\n“Never Gonna Give You Up” was a global smash on its release in July 1987, topping the charts in 25 countries including Rick’s native UK and the US Billboard Hot 100.  It also won the Brit Award for Best single in 1988. Stock Aitken and Waterman wrote and produced the track which was the lead-off single and lead track from Rick’s debut LP “Whenever You Need Somebody”.  The album was itself a UK number one and would go on to sell over 15 million copies worldwide.\n\nThe legendary video was directed by Simon West – who later went on to make Hollywood blockbusters such as Con Air, Lara Croft – Tomb Raider and The Expendables 2.  The video passed the 1bn YouTube views milestone on 28 July 2021.\n\nSubscribe to the official Rick Astley YouTube channel: https://RickAstley.lnk.to/YTSubID\n\nFollow Rick Astley:\nFacebook: https://RickAstley.lnk.to/FBFollowID \nTwitter: https://RickAstley.lnk.to/TwitterID \nInstagram: https://RickAstley.lnk.to/InstagramID \nWebsite: https://RickAstley.lnk.to/storeID \nTikTok: https://RickAstley.lnk.to/TikTokID\n\nListen to Rick Astley:\nSpotify: https://RickAstley.lnk.to/SpotifyID \nApple Music: https://RickAstley.lnk.to/AppleMusicID \nAmazon Music: https://RickAstley.lnk.to/AmazonMusicID \nDeezer: https://RickAstley.lnk.to/DeezerID \n\nLyrics:\nWe’re no strangers to love\nYou know the rules and so do I\nA full commitment’s what I’m thinking of\nYou wouldn’t get this from any other guy\n\nI just wanna tell you how I’m feeling\nGotta make you understand\n\nNever gonna give you up\nNever gonna let you down\nNever gonna run around and desert you\nNever gonna make you cry\nNever gonna say goodbye\nNever gonna tell a lie and hurt you\n\nWe’ve known each other for so long\nYour heart’s been aching but you’re too shy to say it\nInside we both know what’s been going on\nWe know the game and we’re gonna play it\n\nAnd if you ask me how I’m feeling\nDon’t tell me you’re too blind to see\n\nNever gonna give you up\nNever gonna let you down\nNever gonna run around and desert you\nNever gonna make you cry\nNever gonna say goodbye\nNever gonna tell a lie and hurt you\n\n#RickAstley #NeverGonnaGiveYouUp #WheneverYouNeedSomebody #OfficialMusicVideo",
      "channel": "Rick Astley",
      "channelId": "UCuAXFkgsw1L7xaCfnd5JJOw",
      "channelUrl": "https://www.youtube.com/channel/UCuAXFkgsw1L7xaCfnd5JJOw",
      "channelSubscriberCount": 4540000,
      "viewCount": 1816253015,
      "likeCount": 19394097,
      "commentCount": 2400000,
      "uploadDate": "2009-10-25T00:00:00Z",
      "duration": 213,
      "durationString": "3:33",
      "thumbnails": [
        {
          "url": "https://i.ytimg.com/vi/dQw4w9WgXcQ/3.jpg",
          "width": null,
          "height": null
        },
        {
          "url": "https://i.ytimg.com/vi_webp/dQw4w9WgXcQ/3.webp",
          "width": null,
          "height": null
        },
        {
          "url": "https://i.ytimg.com/vi/dQw4w9WgXcQ/2.jpg",
          "width": null,
          "height": null
        },
        {
          "url": "https://i.ytimg.com/vi_webp/dQw4w9WgXcQ/2.webp",
          "width": null,
          "height": null
        },
        {
          "url": "https://i.ytimg.com/vi/dQw4w9WgXcQ/1.jpg",
          "width": null,
          "height": null
        },
        {
          "url": "https://i.ytimg.com/vi_webp/dQw4w9WgXcQ/1.webp",
          "width": null,
          "height": null
        },
        {
          "url": "https://i.ytimg.com/vi/dQw4w9WgXcQ/mq3.jpg",
          "width": null,
          "height": null
        },
        {
          "url": "https://i.ytimg.com/vi_webp/dQw4w9WgXcQ/mq3.webp",
          "width": null,
          "height": null
        },
        {
          "url": "https://i.ytimg.com/vi/dQw4w9WgXcQ/mq2.jpg",
          "width": null,
          "height": null
        },
        {
          "url": "https://i.ytimg.com/vi_webp/dQw4w9WgXcQ/mq2.webp",
          "width": null,
          "height": null
        },
        {
          "url": "https://i.ytimg.com/vi/dQw4w9WgXcQ/mq1.jpg",
          "width": null,
          "height": null
        },
        {
          "url": "https://i.ytimg.com/vi_webp/dQw4w9WgXcQ/mq1.webp",
          "width": null,
          "height": null
        },
        {
          "url": "https://i.ytimg.com/vi/dQw4w9WgXcQ/hq3.jpg",
          "width": null,
          "height": null
        },
        {
          "url": "https://i.ytimg.com/vi_webp/dQw4w9WgXcQ/hq3.webp",
          "width": null,
          "height": null
        },
        {
          "url": "https://i.ytimg.com/vi/dQw4w9WgXcQ/hq2.jpg",
          "width": null,
          "height": null
        },
        {
          "url": "https://i.ytimg.com/vi_webp/dQw4w9WgXcQ/hq2.webp",
          "width": null,
          "height": null
        },
        {
          "url": "https://i.ytimg.com/vi/dQw4w9WgXcQ/hq1.jpg",
          "width": null,
          "height": null
        },
        {
          "url": "https://i.ytimg.com/vi_webp/dQw4w9WgXcQ/hq1.webp",
          "width": null,
          "height": null
        },
        {
          "url": "https://i.ytimg.com/vi/dQw4w9WgXcQ/sd3.jpg",
          "width": null,
          "height": null
        },
        {
          "url": "https://i.ytimg.com/vi_webp/dQw4w9WgXcQ/sd3.webp",
          "width": null,
          "height": null
        },
        {
          "url": "https://i.ytimg.com/vi/dQw4w9WgXcQ/sd2.jpg",
          "width": null,
          "height": null
        },
        {
          "url": "https://i.ytimg.com/vi_webp/dQw4w9WgXcQ/sd2.webp",
          "width": null,
          "height": null
        },
        {
          "url": "https://i.ytimg.com/vi/dQw4w9WgXcQ/sd1.jpg",
          "width": null,
          "height": null
        },
        {
          "url": "https://i.ytimg.com/vi_webp/dQw4w9WgXcQ/sd1.webp",
          "width": null,
          "height": null
        },
        {
          "url": "https://i.ytimg.com/vi/dQw4w9WgXcQ/default.jpg",
          "width": null,
          "height": null
        },
        {
          "url": "https://i.ytimg.com/vi_webp/dQw4w9WgXcQ/default.webp",
          "width": null,
          "height": null
        },
        {
          "url": "https://i.ytimg.com/vi/dQw4w9WgXcQ/mqdefault.jpg",
          "width": 320,
          "height": 180
        },
        {
          "url": "https://i.ytimg.com/vi_webp/dQw4w9WgXcQ/mqdefault.webp",
          "width": null,
          "height": null
        },
        {
          "url": "https://i.ytimg.com/vi/dQw4w9WgXcQ/0.jpg",
          "width": null,
          "height": null
        },
        {
          "url": "https://i.ytimg.com/vi_webp/dQw4w9WgXcQ/0.webp",
          "width": null,
          "height": null
        },
        {
          "url": "https://i.ytimg.com/vi/dQw4w9WgXcQ/hqdefault.jpg",
          "width": null,
          "height": null
        },
        {
          "url": "https://i.ytimg.com/vi/dQw4w9WgXcQ/hqdefault.jpg?sqp=-oaymwEfCKgBEF5IVfKriqkDEggBFQAAiEIYAXABwAEGuALzGA==&rs=AOn4CLAy5pvOfmmlRtbC9v1ptqnWgPympA",
          "width": 168,
          "height": 94
        },
        {
          "url": "https://i.ytimg.com/vi/dQw4w9WgXcQ/hqdefault.jpg?sqp=-oaymwEfCMQBEG5IVfKriqkDEggBFQAAiEIYAXABwAEGuALzGA==&rs=AOn4CLDnaw1sg9xedLybAaLCts8m3KNOlQ",
          "width": 196,
          "height": 110
        },
        {
          "url": "https://i.ytimg.com/vi/dQw4w9WgXcQ/hqdefault.jpg?sqp=-oaymwEgCPYBEIoBSFXyq4qpAxIIARUAAIhCGAFwAcABBrgC8xg=&rs=AOn4CLAz-h7jukeJwLXsm6EJZ_0FIhWWgw",
          "width": 246,
          "height": 138
        },
        {
          "url": "https://i.ytimg.com/vi/dQw4w9WgXcQ/hqdefault.jpg?sqp=-oaymwEgCNACELwBSFXyq4qpAxIIARUAAIhCGAFwAcABBrgC8xg=&rs=AOn4CLCqh65ZpY-1S9Y3vJeHWwXLcY0qUw",
          "width": 336,
          "height": 188
        },
        {
          "url": "https://i.ytimg.com/vi_webp/dQw4w9WgXcQ/hqdefault.webp",
          "width": null,
          "height": null
        },
        {
          "url": "https://i.ytimg.com/vi/dQw4w9WgXcQ/sddefault.jpg",
          "width": null,
          "height": null
        },
        {
          "url": "https://i.ytimg.com/vi_webp/dQw4w9WgXcQ/sddefault.webp",
          "width": null,
          "height": null
        },
        {
          "url": "https://i.ytimg.com/vi/dQw4w9WgXcQ/hq720.jpg",
          "width": 1280,
          "height": 720
        },
        {
          "url": "https://i.ytimg.com/vi_webp/dQw4w9WgXcQ/hq720.webp",
          "width": null,
          "height": null
        },
        {
          "url": "https://i.ytimg.com/vi/dQw4w9WgXcQ/maxresdefault.jpg",
          "width": 1280,
          "height": 720
        },
        {
          "url": "https://i.ytimg.com/vi_webp/dQw4w9WgXcQ/maxresdefault.webp",
          "width": 1920,
          "height": 1080
        }
      ],
      "categories": [
        "Music"
      ],
      "tags": [
        "rick astley",
        "Never Gonna Give You Up",
        "nggyu",
        "never gonna give you up lyrics",
        "rick rolled",
        "Rick Roll",
        "rick astley official",
        "rickrolled",
        "Fortnite song",
        "Fortnite event",
        "Fortnite dance",
        "fortnite never gonna give you up",
        "rick roll",
        "rickrolling",
        "rick rolling",
        "never gonna give you up",
        "80s music",
        "rick astley new",
        "animated video",
        "rickroll",
        "meme songs",
        "never gonna give u up lyrics",
        "Rick Astley 2022",
        "never gonna let you down",
        "animated",
        "rick rolls 2022",
        "never gonna give you up karaoke"
      ],
      "ageLimit": 0,
      "isLive": false,
      "wasLive": false,
      "hasTranscripts": true,
      "transcriptLanguages": [
        "fr",
        "no",
        "ab",
        "id",
        "ta",
        "yi",
        "es-419",
        "be",
        "ro",
        "su",
        "zu",
        "ko",
        "to",
        "mk",
        "az",
        "om",
        "dz",
        "ml",
        "gd",
        "nl",
        "sk",
        "bho",
        "ay",
        "or",
        "ceb",
        "bs",
        "new",
        "gn",
        "mn",
        "mg",
        "kha",
        "haw",
        "et",
        "fy",
        "gu",
        "ht",
        "ts",
        "ca",
        "ms",
        "ur",
        "uk",
        "sw",
        "af",
        "tg",
        "ba",
        "oc",
        "st",
        "tr",
        "fa",
        "ny",
        "lo",
        "ti",
        "fo",
        "pa",
        "co",
        "ig",
        "sl",
        "ee",
        "hy",
        "kk",
        "sv",
        "cs",
        "lt",
        "tn",
        "as",
        "ky",
        "ak",
        "ja",
        "eu",
        "mt",
        "de",
        "ar",
        "dv",
        "el",
        "pl",
        "es",
        "pt-BR",
        "lua",
        "vi",
        "ka",
        "sm",
        "jv",
        "os",
        "bo",
        "de-DE",
        "sr",
        "pam",
        "war",
        "sg",
        "kri",
        "ku",
        "ps",
        "xh",
        "ug",
        "lg",
        "te",
        "so",
        "th",
        "sa",
        "iw",
        "tt",
        "zh-Hant",
        "sq",
        "hu",
        "cy",
        "da",
        "yo",
        "en-orig",
        "qu",
        "ss",
        "am",
        "it",
        "bn",
        "gl",
        "kn",
        "bg",
        "ne",
        "hi",
        "my",
        "is",
        "hmn",
        "kl",
        "fil",
        "en",
        "lv",
        "fj",
        "sn",
        "luo",
        "iu",
        "mi",
        "br",
        "km",
        "sd",
        "rn",
        "pt",
        "mfe",
        "ru",
        "si",
        "ve",
        "ha",
        "pt-PT",
        "mr",
        "hr",
        "uz",
        "nso",
        "zh-Hans",
        "ln",
        "gv",
        "la",
        "gaa",
        "lb",
        "tum",
        "tk",
        "crs",
        "aa",
        "fi",
        "rw",
        "eo",
        "ga",
        "wo"
      ]
    }
  ],
  "usage": {
    "credits": 0.01
  },
  "created_at": "2026-09-16T07:45:41.114Z"
}
```

## Campi di risposta

| Campo di applicazione | Tipologia | Designazione |
| --- | --- | --- |
| source | string | La fonte API richiesta. |
| status | string | fatto quando la richiesta in tempo reale riesce. |
| created_at | string | Tempo di creazione di risposta in formato ISO 8601. |
| usage.credits | number | Crediti a carico della richiesta, in base al tuo piano. |
| results[0].videoId | string | YouTube video ID. |
| results[0].title | string | Titolo video. |
| results[0].description | string | Descrizione video completa. |
| results[0].channel | string | Nome del canale. |
| results[0].channelId | string | Canale ID. |
| results[0].channelUrl | string | Canale URL. |
| results[0].channelSubscriberCount | number · nullable | Conto di abbonati di canale. |
| results[0].viewCount | number · nullable | Vedi il conteggio. |
| results[0].likeCount | number · nullable | Come contare. |
| results[0].commentCount | number · nullable | Conto di commento. |
| results[0].uploadDate | string · nullable | Data di caricamento. |
| results[0].duration | number · nullable | Durata video in pochi secondi. |
| results[0].durationString | string · nullable | Durata formattata quando disponibile. |
| results[0].thumbnails | array | Thumbnail URLs e dimensioni. |
| results[0].categories | array | Le categorie video. |
| results[0].tags | array | Video tags. |
| results[0].ageLimit | integer | Limite di età, o 0 quando non limitato. |
| results[0].isLive | boolean | Se il video è attualmente in diretta. |
| results[0].wasLive | boolean | Che il video sia stato un flusso live. |
| results[0].hasTranscripts | boolean | Se sono disponibili le didascalie. |
| results[0].transcriptLanguages | array | Codici di lingue didascalia disponibili. |
| results[0].formats | array · optional | Formati multimediali disponibili quando include_formats è true. |
| results[0].chapters | array · optional | Titoli di capitolo, start_time e end_time in secondi, quando richiesto e disponibile. |

- I formati e i capitoli non disponibili possono essere null. dipendono dalle opzioni richieste e dai dati disponibili del video.

## Formati di risposta

Le risposte usano JSON per impostazione predefinita. Scegli un altro formato con queste intestazioni opzionali.

- Accept: application/json (predefinito) o text/plain. Testo normale presenta gli stessi campi in un layout leggibile e indentato.
- X-Respond-With: markdown. Lasciare unset per i campi originali. Markdown funziona con il formato di risposta.

Markdown è disponibile per domande in tempo reale e risultati completati.

I campi sottostanti descrivono la risposta predefinita JSON.

[Esempi di formato di richiesta e risposta](https://flashdata.dev/it/docs/guides/response-formats/reference.md#headers)

<a id="job-lifecycle"></a>

<a id="async-batch"></a>

## Nozioni di base sulle API

Il costruttore di richieste ed esempi sopra usano i parametri di questa fonte. Utilizzare gli esempi Python e cURL qui sotto per la presentazione condivisa, lo stato e i passaggi di risultato. Un corpo Batch è un oggetto JSON contenente query; ogni elemento restituisce il proprio lavoro ID.

- [Async richiesta e ricevuta](https://flashdata.dev/it/docs/reference/realtime-and-async/reference.md#async)

<a id="job-status"></a>

- [Controllare lo stato del lavoro](https://flashdata.dev/it/docs/reference/realtime-and-async/reference.md#status)

<a id="job-results"></a>

- [Recuperare i risultati completati](https://flashdata.dev/it/docs/reference/realtime-and-async/reference.md#results)
- [richieste Batch JSON](https://flashdata.dev/it/docs/reference/batch-and-bulk/reference.md#batch)
- [API di elaborazione Bulk](https://flashdata.dev/it/docs/reference/bulk-processing/reference.md)
- [Costruire un flusso di lavoro Bulk per questa sorgente](https://flashdata.dev/it/docs/reference/bulk-processing/reference.md?source=youtube_metadata#playground)
- [Clienti OpenAPI](https://flashdata.dev/docs/openapi.json)

<a id="webhooks"></a>

<a id="callbacks"></a>

## Notifiche di completamento

- [Ricevi e verifica il completamento webhooks](https://flashdata.dev/it/docs/guides/async-batch/reference.md#webhooks)

<a id="troubleshooting"></a>

## Risoluzione dei problemi

- [Errori e codici di stato](https://flashdata.dev/it/docs/errors/reference.md#status-codes)
- [Quando riprova](https://flashdata.dev/it/docs/errors/reference.md#retries)

## API correlate

- [YouTube Transcript API](https://flashdata.dev/it/docs/sources/youtube_transcript/reference.md)
- [YouTube Download API](https://flashdata.dev/it/docs/sources/youtube_download/reference.md)
