Tutorial · curl
How to scrape YouTube channels with curl (2026)
A curl walkthrough for GET /v1/youtube/channel. Copy the snippet, run it, then read the JSON.
GET /v1/youtube/channel · 1 credit
In this tutorial
You'll pull a public YouTube channel and see the fields you get back.
Typical job: a sponsorship list. Look up each channel by @handle, channel id (UC…) or public URL, store its name and subscriber count, then list uploads with /channels/videos or /channels/shorts. Send one identifier per request, not a handle and a channel id together.
Step 1
Get ready
Create a Social Fetch API key and get curl ready. New accounts include 100 free credits.

API key. Create a Social Fetch account, open API Keys and create a key. New accounts include 100 free credits.
curl setup. Any shell with curl. Set SOCIALFETCH_API_KEY to your key (export SOCIALFETCH_API_KEY=sfk_…) before you run the sample.
When you're done, SOCIALFETCH_API_KEY is set in your shell.
Step 2
Make the request
Copy the curl sample and run it. It calls GET /v1/youtube/channel with your key in the x-api-key header, using this example: /v1/youtube/channel?handle=%40mkbhd.
It prints the JSON response. With -sS, curl stays quiet on success but still prints connection errors.
Step 3
Read the response
The response is JSON with two parts: data holds the channels and meta holds creditsCharged and requestId. The sample below is a trimmed copy of a real response; the endpoint page lists every field. Credits are charged on completed lookups, not on failed requests.

Check data.lookupStatus first when the response has one. Keep meta.requestId in case a row looks wrong.
Watch out
this returns the channel only; uploads come from channels/videos and channels/shorts. Sending two different identifiers in one request is a mistake in your code. data.channel.platformUserId is the stable channel id to store.
Step 4
You finished
The Playground, the docs and your code all call the same endpoint at the same price. Pick a next step below.
FAQ
Common questions
Do I need an official YouTube developer account?
No. Social Fetch authenticates with your Social Fetch API key. You call GET /v1/youtube/channel and we handle the lookup. You still need to follow each platform's terms for how you use public data.
What does the YouTube channels endpoint return?
JSON with two parts: data holds the channels and meta holds creditsCharged and requestId. The endpoint page and the API docs describe every field.
What identifiers does YouTube channel lookup accept?
A @handle, a channel id (starting UC) or a public channel URL. Send one per request. This route returns the channel only; use channels/videos or channels/shorts to list uploads.
Can I list a channel's videos from the YouTube channel lookup response?
No. Channel lookup returns the channel's details in data.channel and its counts in data.metrics. For uploads, use GET /v1/youtube/channels/videos or GET /v1/youtube/channels/shorts.
How much does a successful request cost?
1 credit. Failed requests are free.
Is this okay for production?
Yes. It's the same API the Playground and the docs use: typed errors, a requestId on every response, and credits charged only on completed lookups. New accounts get 100 free credits.
Any curl-specific tips for this request?
Yes. Pass the key with -H "x-api-key: $SOCIALFETCH_API_KEY", and wrap the full URL in double quotes so the shell doesn't split it at the & between query parameters. -sS hides the progress meter but still shows connection errors. curl doesn't treat an HTTP error status as a failure, so read the error JSON it prints, or add --fail-with-body.
Related