---
title: "How to get YouTube data"
description: "Get YouTube channels, every video with views, search, comments and transcripts as JSON, without the Data API’s daily quota. What the official API allows, code, a real response and prices."
canonical_url: https://groundsocial.dev/guides/how-to-get-youtube-data
---
# How to get YouTube data

> Get YouTube channels, every video with views, search, comments and transcripts as JSON, without the Data API’s daily quota. What the official API allows, code, a real response and prices.

_Checked 2026-11-27._

The YouTube Data API is free but quota-bound: 10,000 units a day per project, and search has its own bucket of 100 calls a day. Transcripts of other people’s videos aren’t available at all. One GET returns a channel’s videos with view counts in the Data API’s own `youtube#…` shapes, 1 credit a page, with no quota.

> **Checked 27 November 2026** Every request on this page was run against the live API on that date, and the sample response is from that run. Official-API facts link to the platform’s own pages.

## The official YouTube API

The YouTube Data API v3 is the right choice at low volume. Its limits are quota, not money:

- Each Google Cloud project gets **10,000 units a day**, plus separate buckets of **100 `search.list` calls** and 100 uploads a day. Quotas reset at midnight Pacific Time; more needs Google’s quota extension form and audit.
- Most reads (`videos.list`, `channels.list`, `commentThreads.list`) cost 1 unit; `search.list` costs 100.
- `captions.download` costs 200 units and works only for videos you can edit, so it can’t return other channels’ transcripts.

Sources: [Quota costs](https://developers.google.com/youtube/v3/determine_quota_cost), [Getting started](https://developers.google.com/youtube/v3/getting-started), [captions.download](https://developers.google.com/youtube/v3/docs/captions/download).

## Quick start

1. **Get a key.** [Sign up](https://groundsocial.dev/app/sign-in?new=1) with an email code: 100 free credits, no card. An agent can sign itself up with `POST https://api.groundsocial.dev/v1/agent/signup`.
2. **Set it in your shell.** `export GROUNDSOCIAL_API_KEY=gs_live_…`
3. **Make the call.** A channel’s videos with views: `GET /v1/youtube/channels/@mkbhd/videos`, 1 credit.

cURL:

```bash
curl "https://api.groundsocial.dev/v1/youtube/channels/@mkbhd/videos?sort=popular" \
  -H "Authorization: Bearer $GROUNDSOCIAL_API_KEY"
```

TypeScript:

```ts
const res = await fetch('https://api.groundsocial.dev/v1/youtube/channels/@mkbhd/videos?sort=popular', {
  headers: { Authorization: `Bearer ${process.env.GROUNDSOCIAL_API_KEY}` },
})
if (!res.ok) throw new Error((await res.json()).error.hint)
const data = await res.json()
```

Python:

```python
import os, requests

res = requests.get(
    "https://api.groundsocial.dev/v1/youtube/channels/@mkbhd/videos?sort=popular",
    headers={"Authorization": f"Bearer {os.environ['GROUNDSOCIAL_API_KEY']}"},
)
res.raise_for_status()
data = res.json()
```

## Sample response

Trimmed from the real response on 27 November 2026: lists cut to their first items and long strings shortened. Every field is described in the [tutorial](https://groundsocial.dev/tutorials/youtube/channel-videos/python).

```json
{
  "kind": "youtube#videoListResponse",
  "items": [
    {
      "kind": "youtube#video",
      "id": "Oy8zSYKkczI",
      "snippet": {
        "publishedTimeText": "7 years ago",
        "publishedAt": "2019-11-29T02:19:39.176Z",
        "publishedAtIsApproximate": true,
        "channelId": "UCBJycsmduvYEL83R_U4JriQ",
        "channelTitle": "Marques Brownlee",
        "title": "Retro Tech: Game Boy",
        "liveBroadcastContent": "none"
      },
      "channel": {
        "id": "UCBJycsmduvYEL83R_U4JriQ",
        "title": "Marques Brownlee",
        "handle": "@mkbhd",
        "url": "https://www.youtube.com/@mkbhd"
      },
      "statistics": {
        "viewCount": "40000000"
      },
      "statisticsAreApproximate": true,
      "contentDetails": {
        "duration": "PT23M49S",
        "durationSeconds": 1429
      }
    }
  ],
  "nextPageToken": "WPL0Xo7UyeeVter_SotmDA",
  "pageInfo": {
    "resultsPerPage": 30
  }
}
```

## Get every page

`/v1/youtube/channels/@mkbhd/videos` returns videos a page at a time, and each page costs 1 credit. Pass the response’s `nextPageToken` back as `after` until it runs out.

TypeScript:

```ts
// Collect up to 5 pages of videos.
const first = 'https://api.groundsocial.dev/v1/youtube/channels/@mkbhd/videos?sort=latest'
const items: unknown[] = []
let cursor: string | undefined
for (let page = 0; page < 5; page++) {
  const url = new URL(first)
  if (cursor) url.searchParams.set('after', cursor)
  const res = await fetch(url, {
    headers: { Authorization: `Bearer ${process.env.GROUNDSOCIAL_API_KEY}` },
  })
  if (!res.ok) throw new Error((await res.json()).error.hint)
  const data = await res.json()
  items.push(...(data.items ?? []))
  cursor = data.nextPageToken ?? undefined
  if (!cursor) break
}
console.log(items.length, 'videos')
```

Python:

```python
import os, requests

# Collect up to 5 pages of videos.
FIRST = "https://api.groundsocial.dev/v1/youtube/channels/@mkbhd/videos?sort=latest"
headers = {"Authorization": f"Bearer {os.environ['GROUNDSOCIAL_API_KEY']}"}
items, cursor = [], None
for page in range(5):
    params = {"after": cursor} if cursor else {}
    res = requests.get(FIRST, params=params, headers=headers)
    res.raise_for_status()
    data = res.json()
    items += data.get("items") or []
    cursor = data.get("nextPageToken")
    if not cursor:
        break
print(len(items), "videos")
```

## What else you can get from YouTube

| What you get | Endpoint | Credits |
| --- | --- | --- |
| [A channel’s videos with views](https://groundsocial.dev/tutorials/youtube/channel-videos/python) | `GET /v1/youtube/channels/@mkbhd/videos` | 1 |
| [Subscribers, views, links](https://groundsocial.dev/tutorials/youtube/channel/python) | `GET /v1/youtube/channels/@mkbhd` | 1 |
| [Title, views, likes, duration](https://groundsocial.dev/tutorials/youtube/video/python) | `GET /v1/youtube/videos/dQw4w9WgXcQ` | 1 |
| [Any public video’s transcript](https://groundsocial.dev/tutorials/youtube/transcript/python) | `GET /v1/youtube/videos/dQw4w9WgXcQ/transcript` | 2 |
| [Comments, 20 a page](https://groundsocial.dev/tutorials/youtube/comments/python) | `GET /v1/youtube/videos/dQw4w9WgXcQ/comments` | 1 |
| [Search videos](https://groundsocial.dev/tutorials/youtube/search/python) | `GET /v1/youtube/search` | 1 |
| [A channel’s Shorts](https://groundsocial.dev/tutorials/youtube/channel-shorts/python) | `GET /v1/youtube/channels/@mkbhd/shorts` | 1 |

Each row links to its tutorial. Every YouTube endpoint and price: [YouTube API](https://groundsocial.dev/youtube-api).

## Tips

- Channels take a handle (`@mkbhd`), a `UC…` id or any channel URL; videos take an id or any URL form (watch, youtu.be, shorts, embed).
- Responses use the Data API’s field names (`snippet`, `statistics.viewCount`, `nextPageToken`), so existing parsing code keeps working.
- `details=true` on a channel’s videos adds exact counts and dates to every row.
- Transcripts come with `segments` (start, duration, text) for linking to the second, and `text` for summaries and embeddings.

## Use it from Claude or Cursor (MCP)

Every endpoint is also an MCP tool on the remote server `https://api.groundsocial.dev/mcp`. The `?platforms=youtube` below loads only the YouTube tools. The client signs in with OAuth, or send your key as a Bearer token. Tools used in this guide: `youtube_channel_videos`, `youtube_channel_get`, `youtube_video_get`, `youtube_video_transcript`, `youtube_video_comments`, `youtube_search_videos`, `youtube_channel_shorts`.

Claude Code:

```bash
claude mcp add --transport http groundsocial "https://api.groundsocial.dev/mcp?platforms=youtube"
```

Cursor:

```json
{
  "mcpServers": {
    "groundsocial": {
      "url": "https://api.groundsocial.dev/mcp?platforms=youtube"
    }
  }
}
```

Claude.ai:

```text
Customize → Connectors → + Add → Add custom connector
URL: https://api.groundsocial.dev/mcp?platforms=youtube
```

> **Then ask** “Compare the 20 most popular videos of @mkbhd and @LinusTechTips by views and upload year, then summarise the transcript of the top one.”

Setup for ChatGPT, VS Code, Windsurf, n8n and others: [MCP client setup](https://groundsocial.dev/mcp).

## Pricing

Pay per call from prepaid credits; no subscription. 100 free credits cover the examples on this page. Costs below are at the [credit packs](https://groundsocial.dev/pricing)’ highest and lowest rates.

| Job | Credits | Cost |
| --- | --- | --- |
| 500 channels with their latest 30 videos | 1,000 | $1.00 → $0.40 |
| 1,000 searches | 1,000 | $1.00 → $0.40 |
| Transcripts of a 300-video channel | 610 | $0.61 → $0.24 |

## FAQ

### Should I just use the official API?

If 10,000 units a day covers you and you don’t need transcripts, yes. Use this when you need more searches, other people’s transcripts, one key for several platforms, or an MCP tool for an agent.

### What if a video has no captions?

The transcript call answers `404 target_not_found` and is not charged. Asking for a language the video has no track in does the same, and the hint lists the languages it has.

### Are view counts exact?

List rows carry the counts YouTube shows on the page; `details=true` or the video endpoint gives exact `viewCount`, `likeCount` and `commentCount`.

### Are failed calls charged?

No. A target that does not exist answers `404 target_not_found`, an upstream failure answers `503`, and neither costs anything. Credits never expire.

### Is Groundsocial official?

No. Groundsocial is an independent API that reads what the platform shows a logged-out visitor. YouTube is a trademark of Google LLC. We are not affiliated with or endorsed by Google or YouTube.

## Go deeper

- [YouTube tutorials: 26 endpoints in six languages](https://groundsocial.dev/tutorials/youtube)
- [What is the YouTube API quota limit?](https://groundsocial.dev/answers/youtube-api-quota-limit)
- [Is the YouTube Data API free?](https://groundsocial.dev/answers/is-the-youtube-api-free)
- [How do I get YouTube transcripts with an API?](https://groundsocial.dev/answers/youtube-transcript-api)
- [Is there an MCP server for social media data?](https://groundsocial.dev/answers/social-media-mcp-server)
- [YouTube Data API alternatives](https://groundsocial.dev/alternatives/youtube-data-api)
- [Groundsocial vs the YouTube Data API](https://groundsocial.dev/compare/youtube-data-api)
- [Video transcript API](https://groundsocial.dev/use-cases/video-transcript-api)
- [Creator analytics API](https://groundsocial.dev/use-cases/creator-analytics-api)

## Related guides

- [How to get TikTok data](https://groundsocial.dev/guides/how-to-get-tiktok-data)
- [How to get Reddit data](https://groundsocial.dev/guides/how-to-get-reddit-data)

YouTube is a trademark of Google LLC. We are not affiliated with or endorsed by Google or YouTube.

_Canonical HTML: https://groundsocial.dev/guides/how-to-get-youtube-data_

## Site Navigation

### Global Hub
- [Home](https://groundsocial.dev/index.md)
- [Pricing](https://groundsocial.dev/pricing.md)
- [Endpoints](https://groundsocial.dev/endpoints.md)
- [For agents](https://groundsocial.dev/agents.md)
- [Docs](https://groundsocial.dev/docs.md)
- [Compare](https://groundsocial.dev/compare.md)
- [Blog](https://groundsocial.dev/blog.md)
- [Tutorials](https://groundsocial.dev/tutorials.md)
- [Changelog](https://groundsocial.dev/changelog.md)
- [llms.txt](https://groundsocial.dev/llms.txt)
- [Agent skill](https://groundsocial.dev/SKILL.md)

### On This Topic
- [Groundsocial: Social data in one API call](https://groundsocial.dev/index.md)
- [Pricing](https://groundsocial.dev/pricing.md)
- [Playground](https://groundsocial.dev/playground.md)
- [Use cases](https://groundsocial.dev/use-cases.md)
- [Brand monitoring API](https://groundsocial.dev/use-cases/brand-monitoring-api.md)
- [Social listening API](https://groundsocial.dev/use-cases/social-listening-api.md)
- [Comment scraping API](https://groundsocial.dev/use-cases/comment-scraping-api.md)
- [Influencer discovery API](https://groundsocial.dev/use-cases/influencer-discovery-api.md)
- [Video transcript API](https://groundsocial.dev/use-cases/video-transcript-api.md)
- [Ad library API](https://groundsocial.dev/use-cases/ad-library-api.md)
- [Review monitoring API](https://groundsocial.dev/use-cases/review-monitoring-api.md)
- [Trend detection API](https://groundsocial.dev/use-cases/trend-detection-api.md)
- [Social lead generation API](https://groundsocial.dev/use-cases/lead-generation-api.md)
- [Market research API](https://groundsocial.dev/use-cases/market-research-api.md)

## Structured data

```json
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://groundsocial.dev/"},{"@type":"ListItem","position":2,"name":"Guides","item":"https://groundsocial.dev/guides"},{"@type":"ListItem","position":3,"name":"How to get YouTube data","item":"https://groundsocial.dev/guides/how-to-get-youtube-data"}]}
```
