# Pull a YouTube channel's videos into Python with one API call

Instead of a youtube-scraper package or the YouTube Data API and its quota, a Python script can POST social.posts with platform youtube and the channel handle to the RouterGrowth API. The JSON lists the channel's videos with link, upload date, views, likes, comment count and description.

HTML page: https://www.routergrowth.com/tools/youtube/scraper-python
Part of: [YouTube tools](https://www.routergrowth.com/tools/youtube.md)

## The call

[`social.posts`](https://www.routergrowth.com/catalog/social.posts): Recent public posts for a social handle.

Price on this network: $0.00525 per post, $0.002 minimum a call. The exact quote is shown before every run.

## What a real run returned

Run on 2026-10-19: 6 records in 52.9 s for $0.0315. Personal fields are masked. Six videos from Figma's channel, all from the week of the run, with views from about 6,000 to 34,000.

| url | created_at | views | likes | replies |
|---|---|---|---|---|
| https://www.youtube.com/watch?v=Sdh_I7PSuew | 2026-10-15 | 19496 | 149 | 17 |
| https://www.youtube.com/watch?v=ThXrNXxpS-o | 2026-10-17 | 9023 | 74 | 2 |
| https://www.youtube.com/watch?v=WEJ2cZBT3PA | 2026-10-17 | 7752 | 45 | 0 |

## How to do it

1. **Store the key.** Set ROUTERGROWTH_API_KEY in the environment and send it as a Bearer token.
2. **POST the run.** Send capability social.posts, input platform youtube, handle @figma and a limit to /v1/run.
3. **Wait for the result.** A channel read can take under a minute; this one took about 53 seconds. Poll the run id if your script should not block.
4. **Use the list.** result.posts holds one dict per video with url, text, created_at and engagement.

## Ask it like this

- Write a Python script that reads the last ten uploads of five design tool channels and charts views per video. (`social.posts`)
- From Python, get Figma's newest videos and then the comments under the one with the most views. (`social.posts`, `social.comments`)

## Connect

MCP server: `https://api.routergrowth.com/mcp`

```bash
claude mcp add --transport http routergrowth https://api.routergrowth.com/mcp
```

```bash
npm install -g routergrowth && routergrowth setup
routergrowth run -c social.posts -i '{"platform": "youtube", "handle": "@figma", "limit": 6}'
```

```bash
curl -X POST https://api.routergrowth.com/v1/run \
  -H "Authorization: Bearer $ROUTERGROWTH_API_KEY" \
  -d '{"capability": "social.posts", "input": {"platform": "youtube", "handle": "@figma", "limit": 6}}'
```

## Worth knowing

- **No quota math.** There are no YouTube API units to budget; each call is billed per video returned.
- **Handle or URL.** The handle accepts @name or the channel URL.
- **Async when slow.** Submit, keep the run id and poll /v1/runs/<id> so a long channel read does not hold the script.

## Questions

### Do I need the YouTube Data API?

No. The call runs on RouterGrowth's providers; there is no Google key or quota.

### Which Python libraries do I need?

requests or httpx for the call, and pandas if you want a DataFrame.

### Does it return the transcript?

No. It returns the video records; transcripts are not part of social.posts.

### Can I get the comments as well?

Yes. Pass a video URL from the result to social.comments.

## Related

- [Scrape the comments under a YouTube video into rows for your agent](https://www.routergrowth.com/tools/youtube/comment-scraper.md)
- [Scrape a YouTube channel's uploads with views, likes and comments](https://www.routergrowth.com/tools/youtube/channel-scraper.md)
- [Scrape YouTube search results for a keyword, without a scraper](https://www.routergrowth.com/tools/youtube/scraper.md)
- [Search YouTube comments with your AI agent](https://www.routergrowth.com/tools/youtube/comments-search.md)
