{
 "kind": "api",
 "slug": "youtube-data-api",
 "path": "apis/youtube-data-api/",
 "name": "YouTube Data API v3",
 "logo": "https://agentgid.com/media/avatars/googleapis.png",
 "maker": "Google",
 "density": "full",
 "crumbs": [
  [
   "APIs",
   "apis/"
  ],
  [
   "Web search APIs",
   "apis/web-search/"
  ]
 ],
 "lead": "Search and read YouTube from your app.",
 "chips": [
  {
   "label": "Web search APIs",
   "path": "apis/web-search/"
  }
 ],
 "primary": {
  "label": "Copy prompt for your agent",
  "copy": "Use the YouTube Data API v3 with google-api-python-client on the server: read YOUTUBE_API_KEY from .env, prefer videos.list over search.list to save quota, and cache results for at most 30 days."
 },
 "links": [
  {
   "label": "Website",
   "href": "https://developers.google.com/youtube/v3"
  },
  {
   "label": "Pricing",
   "href": "https://developers.google.com/youtube/v3/determine_quota_cost"
  },
  {
   "label": "GitHub",
   "href": "https://github.com/googleapis/google-api-python-client"
  }
 ],
 "track": "Outages, price changes and new versions on your dashboard",
 "verdicts": [
  {
   "key": "price",
   "label": "Price",
   "value": "Free credits",
   "status": "cond",
   "sub": "One-time or needs a card",
   "quote": null,
   "note": "Free tier: Default quota: 10,000 units per day, plus 100 search.list calls and 100 videos.insert calls per day. As reported on the official pricing page, checked Oct 10, 2026.",
   "src": "https://developers.google.com/youtube/v3/determine_quota_cost"
  },
  {
   "key": "commercial",
   "label": "Commercial use",
   "value": "With conditions",
   "status": "cond",
   "sub": null,
   "quote": "You may distribute or sell API Clients subject to the restrictions defined in the following \"Prohibited Actions\" subsection and, of course, to the other terms of the Agreement .",
   "note": "You may sell an app that uses the API, but not the API access itself, and ads next to YouTube data need other content of real value on the same page.",
   "src": "https://developers.google.com/youtube/terms/developer-policies"
  },
  {
   "key": "key",
   "label": "Key & sign-up",
   "value": "API key, server only",
   "status": "info",
   "sub": "Env var YOUTUBE_API_KEY",
   "quote": "A request that doesn't provide an OAuth 2.0 token must send an API key .",
   "note": "API key in the key query parameter for public data; OAuth 2.0 access token for uploads, edits and private data",
   "src": "https://developers.google.com/youtube/registering_an_application"
  },
  {
   "key": "agent",
   "label": "Agent access",
   "value": "Community MCP server",
   "status": "cond",
   "sub": "SDK",
   "quote": null,
   "note": " Our agent check: 2 of 6 (Nov 13, 2026).",
   "src": "https://developers.google.com/youtube/v3"
  }
 ],
 "vfoot": "Checked against the maker's official pages, pricing on Oct 10, 2026.",
 "blocks": [
  {
   "id": "overview",
   "nav": "Overview",
   "h2": "What YouTube Data API v3 does",
   "parts": [
    {
     "t": "prose",
     "text": "The YouTube Data API is Google's official way for your app to work with YouTube. It can search videos, read titles, view counts and comments, and, with the channel owner's permission, upload videos or change playlists. There is no price list; instead each project gets a free daily allowance of requests."
    },
    {
     "t": "list",
     "items": [
      "YouTube Data API v3 is one of 27 APIs in the Web search APIs category on AgentGid.",
      "It is one of 20 that can be started for free.",
      "13 of them ship an official MCP server; YouTube Data API v3 does not.",
      "Its official SDK is the 1st most downloaded in the category (43.3M a week)."
     ],
     "muted": true
    },
    {
     "t": "h3",
     "text": "What people build with it"
    },
    {
     "t": "uses",
     "items": [
      {
       "title": "Video search on your site",
       "text": "Let visitors search YouTube from your page, for example cooking videos for a recipe, and show the results as a list.",
       "idea": false
      },
      {
       "title": "Show view and like counts",
       "text": "Display up-to-date views, likes and duration next to the videos you feature, such as your own course videos.",
       "idea": false
      },
      {
       "title": "Read comments under a video",
       "text": "Collect the comments on your videos to answer questions, spot common requests or flag spam.",
       "idea": false
      },
      {
       "title": "Upload videos from your app",
       "text": "Publish videos and set thumbnails on a channel from your own tool, after the channel owner signs in and allows it.",
       "idea": false
      },
      {
       "title": "A channel's videos on your website",
       "text": "List the latest videos of your channel or a playlist on your homepage, updated automatically.",
       "idea": true
      },
      {
       "title": "Weekly stats for your channel",
       "text": "Send yourself a short weekly summary of views and comments on your newest videos.",
       "idea": true
      }
     ]
    }
   ]
  },
  {
   "id": "popularity",
   "nav": "Popularity",
   "h2": "YouTube Data API v3 popularity",
   "parts": [
    {
     "t": "stats",
     "items": [
      {
       "n": "44.3M",
       "l": "SDK downloads a week",
       "d": "+9.6% on the 4-week average",
       "up": true
      },
      {
       "n": "220",
       "l": "public agent repos use its SDK"
      },
      {
       "n": "8,981",
       "l": "GitHub stars, googleapis/google-api-python-client"
      }
     ]
    },
    {
     "t": "small",
     "text": "SDK downloads from npm and PyPI, weekly. Numbers as of Nov 17, 2026."
    }
   ]
  },
  {
   "id": "pricing",
   "nav": "Pricing and limits",
   "h2": "Pricing",
   "parts": [
    {
     "t": "rows",
     "rows": [
      {
       "l": "Free tier",
       "v": "Default quota: 10,000 units per day, plus 100 search.list calls and 100 videos.insert calls per day"
      },
      {
       "l": "Cheapest plan",
       "v": "No monthly plan"
      },
      {
       "l": "Usage price",
       "v": "search.list: 1 quota per call (100/day); videos.list: 1 unit"
      },
      {
       "l": "Plans",
       "v": "Quota-based, no paid tier listed; more quota requires a Quota extension request form."
      }
     ]
    },
    {
     "t": "small",
     "text": "As reported on the official pricing page, checked Oct 10, 2026. Prices change: confirm before you buy.",
     "link": "developers.google.com/youtube/v3/determine_quota_cost",
     "href": "https://developers.google.com/youtube/v3/determine_quota_cost"
    }
   ]
  },
  {
   "id": "limits",
   "nav": null,
   "spy_as": "pricing",
   "h2": "Limits",
   "parts": [
    {
     "t": "rows",
     "rows": [
      {
       "l": "Default (every project)",
       "v": "100 search.list calls, 100 videos.insert calls and 10,000 units a day for all other methods; reset at midnight Pacific Time",
       "src": "https://developers.google.com/youtube/v3/determine_quota_cost"
      },
      {
       "l": "Search results with channelId and type=video",
       "v": "At most 500 videos",
       "src": "https://developers.google.com/youtube/v3/docs/search/list"
      }
     ]
    },
    {
     "t": "small",
     "text": "From the official docs.",
     "link": "developers.google.com/youtube/v3/determine_quota_cost",
     "href": "https://developers.google.com/youtube/v3/determine_quota_cost"
    }
   ]
  },
  {
   "id": "access",
   "nav": "Access and terms",
   "h2": "Key and access",
   "parts": [
    {
     "t": "rows",
     "rows": [
      {
       "l": "How it signs in",
       "v": "API key in the key query parameter for public data; OAuth 2.0 access token for uploads, edits and private data"
      },
      {
       "l": "Environment variable",
       "v": "YOUTUBE_API_KEY",
       "code": true
      },
      {
       "l": "Safe in browser code",
       "v": "No, keep it on your server",
       "status": "no"
      },
      {
       "l": "Card at sign-up",
       "v": "No"
      }
     ]
    },
    {
     "t": "h3",
     "text": "Steps only a person can do"
    },
    {
     "t": "list",
     "items": [
      "Sign in to Google Cloud, create a project, enable YouTube Data API v3 and create an API key (restricted). Put the key in .env as YOUTUBE_API_KEY and read it on the server.",
      "For uploads or private data, set up an OAuth consent screen and an OAuth client ID. Use the client library's OAuth flow; each channel owner signs in once.",
      "If 10,000 units or 100 searches a day are not enough, apply for a quota extension (with a compliance audit). Keep the same key; the new quota applies only to the approved use case.",
      "Publish a privacy policy that says the app uses YouTube API Services and links to Google's privacy policy. Link it in the app before users reach YouTube features."
     ]
    }
   ]
  },
  {
   "id": "terms",
   "nav": null,
   "spy_as": "access",
   "h2": "Commercial use and your data",
   "parts": [
    {
     "t": "prose",
     "text": "The service is free to use within its daily allowance, under YouTube's terms and developer policies. You may sell an app that uses it, but you may not download YouTube videos or resell the service."
    },
    {
     "t": "rows",
     "rows": [
      {
       "l": "In a paid app",
       "v": "With conditions",
       "status": "cond",
       "sub": "You may sell an app that uses the API, but not the API access itself, and ads next to YouTube data need other content of real value on the same page.",
       "quote": "You may distribute or sell API Clients subject to the restrictions defined in the following \"Prohibited Actions\" subsection and, of course, to the other terms of the Agreement .",
       "src": "https://developers.google.com/youtube/terms/developer-policies"
      },
      {
       "l": "redistribute-files",
       "v": "No",
       "status": "no",
       "sub": "Videos may not be downloaded, cached or stored; show them through the YouTube player.",
       "quote": "download, import, backup, cache, or store copies of YouTube audiovisual content without YouTube's prior written approval,",
       "src": "https://developers.google.com/youtube/terms/developer-policies"
      },
      {
       "l": "client-work",
       "v": "With conditions",
       "status": "cond",
       "sub": "Allowed when the client's app follows the policies, including its own privacy policy and the 30-day data rule.",
       "quote": "Each API Client must require users to agree to a privacy policy before users can access the API Client's features and functionality.",
       "src": "https://developers.google.com/youtube/terms/developer-policies"
      },
      {
       "l": "Keeps your data",
       "v": "Your app may keep YouTube data at most 30 days before refreshing or deleting it.",
       "quote": "After 30 calendar days, the API Client must either delete or refresh the stored data.",
       "src": "https://developers.google.com/youtube/terms/developer-policies"
      }
     ]
    }
   ]
  },
  {
   "id": "errors",
   "nav": null,
   "spy_as": "access",
   "h2": "Errors to handle",
   "parts": [
    {
     "t": "rows",
     "rows": [
      {
       "l": "403 quotaExceeded",
       "v": "The daily quota is used up.",
       "sub": "Stop and retry after midnight Pacific Time; cache results, or apply for a quota extension."
      },
      {
       "l": "403 forbidden",
       "v": "Access forbidden; the request may not be properly authorized.",
       "sub": "Check the key, its restrictions and that the API is enabled; use OAuth for private data."
      },
      {
       "l": "400 missingRequiredParameter",
       "v": "A required parameter, such as part, is missing.",
       "sub": "Fix the request; do not retry unchanged."
      },
      {
       "l": "403 commentsDisabled",
       "v": "The video has comments turned off.",
       "sub": "Skip this video; no retry."
      },
      {
       "l": "404 videoNotFound",
       "v": "The video ID does not exist or is not available.",
       "sub": "Check the ID; remove the video from your stored list."
      }
     ]
    }
   ]
  },
  {
   "id": "agent",
   "nav": "For agents",
   "h2": "Use it from an agent",
   "parts": [
    {
     "t": "rows",
     "rows": [
      {
       "l": "Our agent check",
       "v": "2 of 6: llms.txt no, OpenAPI no, SDK yes, MCP no, status page no, AI assistants allowed yes",
       "sub": "Checked Nov 13, 2026."
      },
      {
       "l": "MCP server",
       "v": "Community servers only",
       "sub": null
      },
      {
       "l": "npm",
       "v": "npm install googleapis",
       "code": true
      },
      {
       "l": "PyPI",
       "v": "pip install google-api-python-client",
       "code": true
      }
     ]
    }
   ]
  },
  {
   "id": "alternatives",
   "nav": "Alternatives",
   "h2": "Alternatives",
   "parts": [
    {
     "t": "alts",
     "items": [
      {
       "name": "YouTube Data API v3",
       "me": true,
       "facts": [
        "Free plan",
        "Free tier"
       ]
      },
      {
       "name": "SerpApi",
       "why": "Pick SerpApi when you need results from Google and other search engines as structured data, at $25 per 1,000 searches in our catalog (list price on 2026-11-10).",
       "path": "apis/serpapi/",
       "facts": [
        "See its page",
        "No free tier"
       ]
      },
      {
       "name": "Exa",
       "why": "Pick Exa when you need web search with page contents for an AI agent, at $4 per 1,000 requests in our catalog (list price on 2026-11-10).",
       "path": "apis/exa/",
       "facts": [
        "See its page",
        "No free tier"
       ]
      },
      {
       "name": "Tavily",
       "why": "Pick Tavily when an agent needs web search, extract and crawl results ready for a language model.",
       "path": "apis/tavily/",
       "facts": [
        "See its page",
        "No free tier"
       ]
      }
     ],
     "more": "All web search apis APIs",
     "more_path": "apis/web-search/"
    }
   ]
  },
  {
   "id": "start",
   "nav": "Get started",
   "h2": "Get started",
   "parts": [
    {
     "t": "prompt",
     "text": "Use the YouTube Data API v3 with google-api-python-client on the server: read YOUTUBE_API_KEY from .env, prefer videos.list over search.list to save quota, and cache results for at most 30 days."
    },
    {
     "t": "steps",
     "items": [
      {
       "text": "Create a project in the Google Cloud console and enable the YouTube Data API v3.",
       "code": null,
       "src": "https://developers.google.com/youtube/v3/getting-started"
      },
      {
       "text": "Create an API key for public data and restrict it before production; reading private data or uploading needs an OAuth client instead.",
       "code": null,
       "src": "https://developers.google.com/youtube/registering_an_application"
      },
      {
       "text": "Install the Google client library for your language and make a first read request.",
       "code": "pip install --upgrade google-api-python-client",
       "src": "https://developers.google.com/youtube/v3/quickstart/python"
      }
     ]
    },
    {
     "t": "h3",
     "text": "First request"
    },
    {
     "t": "tabs",
     "label": "First request",
     "items": [
      {
       "tab": "Request",
       "code": "GET https://www.googleapis.com/youtube/v3/videos?id=7lCDEYXw3mM&key=YOUR_API_KEY&part=snippet,statistics&fields=items(id,snippet,statistics)",
       "intro": "Trimmed from Example 3 in the docs (description and thumbnails left out)."
      },
      {
       "tab": "Response",
       "code": "{\n \"videos\" : [\n {\n \"id\" : \"7lCDEYXw3mM\" ,\n \"snippet\" : {\n \"publishedAt\" : \"2012-06-20T22:45:24.000Z\" ,\n \"channelId\" : \"UC_x5XG1OV2P6uZZ5FSM9Ttw\" ,\n \"title\" : \"Google I/O 101: Q&A On Using Google APIs\" ,\n \"categoryId\" : \"28\"\n },\n \"statistics\" : {\n \"viewCount\" : \"3057\" ,\n \"likeCount\" : \"25\" ,\n \"commentCount\" : \"12\"\n }\n }\n ]\n}"
      }
     ]
    },
    {
     "t": "h3",
     "text": "Mistakes to avoid"
    },
    {
     "t": "mistakes",
     "items": [
      {
       "dont": "Calling search.list for every page view or to look up videos you already know.",
       "fix": "Cache search results and use videos.list or playlistItems.list with known IDs (1 unit each, from the large daily pool).",
       "why": "Search has its own small pool of 100 calls a day, and every extra results page costs another call."
      },
      {
       "dont": "Keeping view or subscriber counts in your database for months.",
       "fix": "Refresh or delete stored YouTube data within 30 days.",
       "why": "The developer policies forbid keeping such statistics longer than 30 days without the owner's authorization."
      },
      {
       "dont": "Trying to upload or edit with only an API key.",
       "fix": "Use an OAuth 2.0 client and let the channel owner sign in and grant access.",
       "why": "Insert, update and delete always need the user's authorization."
      },
      {
       "dont": "Downloading videos or audio to process or replay them.",
       "fix": "Embed the YouTube player and work only with the metadata the API returns.",
       "why": "The policies forbid downloading or storing copies of YouTube content without written approval."
      },
      {
       "dont": "Shipping an unrestricted API key in a public web page.",
       "fix": "Call the API from your server, or at least restrict the key to your site and to the YouTube Data API.",
       "why": "Anyone who copies the key can use up your project's daily quota."
      }
     ]
    }
   ]
  },
  {
   "id": "faq",
   "nav": "Questions",
   "h2": "Questions",
   "parts": [
    {
     "t": "faq",
     "items": [
      {
       "q": "Does it cost money?",
       "a": "The docs list no prices; each project gets a daily allowance, and more can be requested through a form and review.",
       "evidence": {
        "url": "https://developers.google.com/youtube/v3/getting-started",
        "quote": "If you reach the quota limit, you can request additional quota by completing the Quota extension request form for YouTube API Services."
       }
      },
      {
       "q": "Do I need users to sign in with Google?",
       "a": "Not for public data such as search results and video details; an API key is enough. Uploads, edits and private data need the user's sign-in.",
       "evidence": {
        "url": "https://developers.google.com/youtube/registering_an_application",
        "quote": "Use an API key for requests that only retrieve public data, such as public video metadata or search results."
       }
      },
      {
       "q": "Can I save videos for offline viewing?",
       "a": "No. The policies forbid downloading or storing copies of YouTube videos and offering offline playback without YouTube's written approval.",
       "evidence": {
        "url": "https://developers.google.com/youtube/terms/developer-policies",
        "quote": "make content available for offline playback, or"
       }
      },
      {
       "q": "When does the daily allowance reset?",
       "a": "At midnight Pacific Time.",
       "evidence": {
        "url": "https://developers.google.com/youtube/v3/determine_quota_cost",
        "quote": "Daily quotas reset at midnight Pacific Time"
       }
      }
     ]
    }
   ]
  }
 ],
 "glance": [
  [
   "Maker",
   "Google"
  ],
  [
   "Category",
   "Web search APIs"
  ],
  [
   "Price",
   "Free plan"
  ],
  [
   "Official SDK",
   "npm googleapis, PyPI google-api-python-client"
  ],
  [
   "Latest SDK",
   "2.201.0 on npm"
  ],
  [
   "Agent check",
   "2 of 6"
  ],
  [
   "Pricing checked",
   "Oct 10, 2026"
  ]
 ],
 "good": [
  "Search is the scarce part; by default only 100 searches a day, so look up known videos by ID instead when you can.",
  "Every request counts against the allowance, even one that fails.",
  "Data you save from YouTube must be refreshed or deleted after 30 days."
 ],
 "checked_line": "Read by AgentGid from 14 official pages, card checked Nov 10, 2026; usage numbers update daily."
}