YouTube
The YouTube namespace is a good fit when you know the channel or video you want and need structured data back.
Live route family
/v1/crawl/youtube/channel/v1/crawl/youtube/channel_videos/v1/crawl/youtube/video- raw REST routes also cover
channel_shorts,transcript,search,search_hashtag,comments,trending_shorts,playlist, andcommunity_post
Example
Read a channel
```bash
curl 'https://api.faircompany.ai/v1/crawl/youtube/channel?handle=vercel' \
-H "Authorization: Bearer fc_live_xxx"
```
```ts
const channel = await fc.youtube.channel({
handle: "vercel",
});
console.log(channel.handle);
console.log(channel.title);
```
```python
import httpx
import os
api_key = os.environ.get("FAIRCRAWL_API_KEY", "fc_live_xxx")
response = httpx.get(
"https://api.faircompany.ai/v1/crawl/youtube/channel",
headers={"Authorization": f"Bearer {api_key}"},
params={"handle": "vercel"},
timeout=30,
)
response.raise_for_status()
print(response.json()["title"])
```
```json
{
"tool": "faircrawl_research",
"arguments": {
"query": "Vercel YouTube channel",
"sources": ["youtube"],
"limit": 5
}
}
```
Notes
- the TypeScript SDK wraps
channel,videos, andvideo - use
/researchwithsources: ["youtube"]when the question is topical rather than channel-specific - transcripts stay available on the raw REST path today