How to list a YouTube channel's live and past-live streams
Get a paginated list of a YouTube channel's live and past-live streams with titles, approximate views, lengths, publish times, and URLs
On this page
You have 25 YouTube creator channels to scan for current and past live streams before you pick a short sponsorship slate. Each call to anyapi.youtube.channel_lives returns one page of a channel's live and past-live streams, and you follow the cursor until that channel runs out of pages
The worksheet is the deliverable: one row per stream, tagged with the channel it came from, so you can compare titles, approximate views, lengths and publish times across the slate. No run was executed for this article, so the values below are placeholders that fix the shape of the table
Example input and the worksheet design
The example channel is @CreatorMetricsLab, invented for this guide. Take a real handle or channel ID from the channel's YouTube URL or identifier and swap it in
| channel | title | views | lengthText | publishedTime | url |
|---|---|---|---|---|---|
| @CreatorMetricsLab | (stream title) | 12000 | 3:29:31 | (publish time string) | (returned url) |
| @CreatorMetricsLab | (stream title) | 840 | LIVE | (publish time string) | (returned url) |
Values here are placeholders showing the shape. The first row is a past stream with a length; the second is a stream running now, where views counts people watching at the moment of the call. The output schema has no channel name field, so the channel column is filled from the input you sent, not from the response
What the tool takes
handle is the channel handle such as @name, and channelId is the YouTube channel ID. The schema requires one of the two. cursor is optional and comes from a previous response's nextCursor. requireFields is optional and can name lengthText
That last option can change what you pay. When the cheapest source cannot return a named field, a dearer source serves and you are quoted and charged its price. A named field can still be absent on a live stream that genuinely lacks it, and a combination that no single source returns together is refused as invalid input, with no charge
So if lengthText matters to your comparison, and it does here, name it on the first call and accept that the quote may sit above the cheapest source. The tool runs through POST /v1/runs with toolId anyapi.youtube.channel_lives
Reading the output fields that drive the decision
found is the first field to check. When it is false, reason is present with the value not_found: the source states the target does not exist, or returned nothing for it. The contract calls that a successful call, not an error. Mark the channel empty and move to the next one
When found is true, data.lives holds the stream records. lengthText is the field that splits the two kinds of row: it reads LIVE while a stream is running and carries a length such as 3:29:31 for a past stream. It can also be null when the serving source does not report it, which is the reason to name it in requireFields
views is approximate by design. The contract says sources read it from YouTube's rounded label, so 60K watching arrives as 60000. Compare channels on the rounded figure and do not read small gaps as a difference in audience
title, url, id and publishedTime are populated whenever the provider has data for the entity. url is the field you paste into the shortlist, and image carries the thumbnail with tracking query parameters stripped
Paginate until nextCursor is null
nextCursor is an opaque cursor for the next page of live streams, or null when this lane has no more. Pass it back as cursor to continue. That is the limit that shapes the loop: one call is one page, so a channel with a long back catalogue needs several calls before its row set is finished
Finish one channel before starting the next, and stop when nextCursor comes back null. A null cursor is the end signal, not a missing value to retry
The agent prompt
Set up https://purrkey.app/SKILL.md, then use Purrkey to list live and
past-live streams for the channels below, one channel at a time. Check
the current inputs and price of anyapi.youtube.channel_lives before
running anything. Send handle for each channel with requireFields set
to ["lengthText"], then follow nextCursor: pass it back as cursor until
it returns null. Return one table with the columns channel, title,
views, lengthText, publishedTime and url. Keep LIVE rows visible as LIVE
and leave a value empty rather than inventing one. Do not drop rows.
@CreatorMetricsLab
@SecondExampleChannelBoth handles above are invented. Replace the list with your 25 channels and keep the first run to one channel and its first page, so you can inspect the row shape before spending calls on the full slate
Estimated tool cost
Prices read from the Purrkey catalog on November 12, 2026. The tool is listed as max_call, which the catalog explains as "Maximum per call. Successful runs settle at the actual AnyAPI charge." The totals below are ceilings, not settled charges
| Step | Formula | Unit price | Planned quantity | Total |
|---|---|---|---|---|
| First page for one channel | calls x max price | $0.0036 per call | 1 | $0.0036 |
| Five pages for one channel | calls x max price | $0.0036 per call | 5 | $0.018 |
| First page for 25 channels | calls x max price | $0.0036 per call | 25 | $0.09 |
A 25 channel scan at one page each is at most $0.09. If three of those channels need five pages apiece, that adds 12 calls at most $0.0432 and lifts the plan to at most $0.1332. Model fees for the agent are not counted
Run the first channel
Open the YouTube tools page, confirm the current price of anyapi.youtube.channel_lives, and run the example handle once before you commit the 25 channel scan
Get started by giving this to your agent
- Claude Code
- Codex
- Gemini CLI
- Cursor
- GitHub Copilot
Set up https://purrkey.app/SKILL.md, then use Purrkey to show me what I can do with YouTube.FAQ
How do I list a YouTube channel's live and past-live streams?
Send the channel handle or channel ID to the YouTube channel live streams tool to get one page of streams with titles, views, lengths, publish times and URLs. Pass nextCursor back as cursor until it returns null to walk the rest of the list.
What input does the YouTube channel live streams tool take?
It requires either handle, such as a handle beginning with the at sign, or channelId, and accepts an optional cursor from a previous response plus an optional requireFields list that can name lengthText.
What does lengthText show for a live stream?
It shows the stream length as YouTube displays it, such as 3:29:31, or LIVE while the stream is running. It is null when the serving source does not report it.
Are the view counts exact?
No. The contract says views are read from YouTube's rounded label, so a figure like 60K watching arrives as 60000 and is approximate.
How much does it cost to scan 25 YouTube channels for live streams?
At one page per channel, at most $0.09 at the listed max price of $0.0036 per call. Extra pages cost the same per call, and agent model fees are not included.
What happens if a channel handle does not exist?
The response returns found as false with a reason of not found. The contract describes that answer as a successful call, not an error.
Does naming lengthText raise the price?
It can. When the cheapest source cannot return a named field, a dearer source serves and you are quoted and charged its price, and on a paginated walk the request applies to the first page only.
Next step
Try this with YouTube
The tool directory lists every endpoint with its current price. Inspect the inputs there, then let your agent run a small batch before scaling up.