Skip to content
OSINTtools.io

YouTube Data API API

Google's API for YouTube: send a channel handle, video ID or search query, get public channel, video and comment data as JSON.

Base URL
https://www.googleapis.com/youtube/v3
Sign-in
API key
Format
REST
Endpoints
3

Compiled by OSINTtools.io editors from developers.google.com · updated Nov 29, 2026Work on this API? Claim it to keep these docs currentReport a mistake

Introduction

The YouTube Data API v3 returns YouTube channels, videos, playlists, comments and search results as JSON. An investigator uses it to look up a channel by handle or ID, read a video's title, description, tags and statistics, and search for videos, channels and playlists by keyword.

Calls are GET requests under https://www.googleapis.com/youtube/v3. Public data needs an API key, sent as the key query parameter; changes and private data need an OAuth 2.0 token. Each request costs quota units; the three read methods below cost 1 unit each.

Only the read methods most useful for lookups are described here. The API also covers captions, comments, playlists, subscriptions and uploads.

Quick start

  1. Get a key

    Create an account with YouTube Data API and copy your api key. Where to get it

  2. Make your first request

    Search for videos, channels and playlists.. Replace YOUR_API_KEY and run it in a terminal, or use Try it on the endpoint.

    curl 'https://www.googleapis.com/youtube/v3/search?part=snippet&key=YOUR_API_KEY'
  3. Read the response

    A 200 response looks like this.

    {
      "kind": "youtube#searchListResponse",
      "nextPageToken": "NEXT_PAGE_TOKEN",
      "regionCode": "NL",
      "pageInfo": {
        "totalResults": 1,
        "resultsPerPage": 1
      },
      "items": [
        {
          "kind": "youtube#searchResult"
        }
      ]
    }

Authentication

Send your API key in the key query parameter of every request.

Created in the Google Cloud console. Write requests and private data need OAuth 2.0 instead.

Get a key from YouTube Data API

Try it on this page keeps your key in your browser; it is never sent to OSINTtools.io.

Rate limits and pricing

Quota units per request, not requests per second; the daily allowance is not stated on the method pages

Errors

StatusMeaning
400Bad request, for example invalidCriteria or invalidSearchFilter
403Forbidden: not authorized for the request
404Not found, for example channelNotFound or videoNotFound

Videos

  • Takes: URL
  • Passive: the target is not contacted
  • Cost: 1 quota unit

Exactly one filter is required: id, chart or myRating (needs authorization). part picks which resource sections are returned, for example snippet and statistics. maxResults and pageToken are not supported with id.

Query parameters

partstringrequired

Comma-separated resource parts to return

Example: snippet,statisticsOne of: contentDetails, id, liveStreamingDetails, localizations, player, recordingDetails, snippet, statistics, status, topicDetails
idstringtakes your url

Comma-separated video IDs

Example: VIDEO_ID
chartstring

Chart to return

Example: mostPopularOne of: mostPopular
regionCodestring

ISO 3166-1 alpha-2 code; only used with chart

Example: NL
hlstring

Language for localized snippet values

Example: en
Response fields · 11Show

kindstring

Always youtube#videoListResponse

nextPageTokenstring

Token for the next page

totalResultsinteger

Total results in the set

resultsPerPageinteger

Results in this response

items[]object

Video resources

idstring

Video ID

channelIdstring

Channel that uploaded the video

titlestring

Video title

descriptionstring

Video description

tags[]string

Video tags

categoryIdstring

Video category ID

curl 'https://www.googleapis.com/youtube/v3/videos?part=snippet%2Cstatistics&key=YOUR_API_KEY'
Replace YOUR_API_KEY with your key
Response
{
  "kind": "youtube#videoListResponse",
  "pageInfo": {
    "totalResults": 1,
    "resultsPerPage": 1
  },
  "items": [
    {
      "id": "VIDEO_ID",
      "snippet": {
        "channelId": "UCexample0000000000000000",
        "title": "Example video",
        "description": "Example description",
        "tags": [
          "example"
        ],
        "categoryId": "22"
      }
    }
  ]
}

Channels

Exactly one filter is required: forHandle, forUsername, id, mine or managedByMe. mine and managedByMe need authorization.

Query parameters

partstringrequired

Comma-separated resource parts to return

Example: snippet,statisticsOne of: brandingSettings, contentDetails, id, localizations, snippet, statistics, status, topicDetails
forHandlestringtakes your username

YouTube handle, with or without @

Example: @example
forUsernamestringtakes your username

YouTube username

Example: exampleuser
idstring

Comma-separated channel IDs

Example: UCexample0000000000000000
maxResultsinteger

0 to 50

Example: 5Default: 5
Response fields · 6Show

kindstring

Always youtube#channelListResponse

nextPageTokenstring

Token for the next page

totalResultsinteger

Total results in the set

resultsPerPageinteger

Results in this response

items[]object

Channel resources

idstring

Channel ID

curl 'https://www.googleapis.com/youtube/v3/channels?part=snippet%2Cstatistics&key=YOUR_API_KEY'
Replace YOUR_API_KEY with your key
Response
{
  "kind": "youtube#channelListResponse",
  "pageInfo": {
    "totalResults": 1,
    "resultsPerPage": 1
  },
  "items": [
    {
      "kind": "youtube#channel",
      "id": "UCexample0000000000000000"
    }
  ]
}