Connect YouTube Public to Python
Bring YouTube Public data into Python with Windsor.ai, so your scripts read public channel and video data.
Pick the YouTube Public fields you need, such as Channel Title, Subscriber Count and Video View Count, and Windsor.ai loads them without a CSV export.
Forget CSVs. Stop copy/paste. Connect in minutes.
Get YouTube Public data into Python
YouTube Public is connected once in Windsor.ai, and these are the use cases the fields support:
Benchmark channels
Subscriber Count, View Count and Video Count per Channel Title show how the size of your channel compares with the channels you track.
Find competitors' top videos
Video View Count, Video Like Count and Video Comment Count per Video Title show which uploads got the most attention, and Video Published Date shows when they went out.
Compare video lengths
Video Length next to Video View Count per Channel Title shows whether short videos or long ones get more views on each channel.
Using Windsor.ai to connect data from YouTube Public to Python
Windsor.ai moves your YouTube Public fields into Python on a connection you set up once.
The code example in step 4 shows the request and the columns it returns.
How to connect YouTube Public to Python with Windsor.ai
Explore a step-by-step guide to integrate YouTube Public data into Python with the Windsor.ai connector.
Connect a data source
In your Windsor.ai dashboard, choose YouTube Public as your data source, sign in with any Google account, then type the @handle of each public channel you want to track (for example @windsorai) in Channel to follow and click Add Account. For data about your own channel, use the YouTube connector instead. Select the account(s) you want to pull data from and click Next.
Set Python as a data destination
Scroll down and choose Python from the data destination list. Copy the API Key URL provided in the instructions below.
Integrate the API Key URL into your Python code
Use Python’s requests library to call the API Key URL and load the rows into pandas. This example compares the channels you track:
import requests
import pandas as pd
url = "https://connectors.windsor.ai/youtube_public"
params = {
"api_key": "YOUR_API_KEY",
"fields": "channel_title,subscriber_count,view_count,video_count",
}
rows = requests.get(url, params=params, timeout=60).json()["data"]
df = pd.DataFrame(rows)
print(df.sort_values("subscriber_count", ascending=False))
The DataFrame has one column per field: channel_title, subscriber_count, view_count and video_count. Add video_title, video_view_count and published_at to the fields list to work with videos instead of channels.
FAQs
What YouTube Public data can I load into Python?
Windsor.ai gives access to 38 YouTube Public fields: 17 about channels and videos, and 21 account and date fields such as Account Name, Date and Week. These are the groups; the YouTube Public field reference lists all of them:
- Channels: Channel Title, Channel Handle, Channel ID, Channel Country, Channel Created Date.
- Channel totals: Subscriber Count, View Count, Video Count.
- Videos: Video Title, Video ID, Video Published Date, Video Length, Video Tags, Video Thumbnail URL.
- Video totals: Video View Count, Video Like Count, Video Comment Count.
How does Windsor.ai load YouTube Public data into Python?
Windsor.ai gives you an API URL for your selected YouTube Public fields. Call it from Python with requests or a similar library and load the response into pandas or your own code.
Can I combine YouTube Public data with other sources in my scripts?
Yes. Windsor.ai supports 350+ data sources, so YouTube Public data can sit next to other connected sources in the same scripts. For example, put YouTube Public Subscriber Count and View Count by Channel Title next to the views and subscribers your own channel reports through the YouTube connector, to see how your channel compares with the ones you track.
Do I need to code to connect YouTube Public to Python?
Yes, but only a few lines. Connecting YouTube Public and choosing fields happens in the Windsor.ai dashboard with no code. Loading the data into Python takes one request, as in the example in step 4.
How much does it cost to integrate YouTube Public with Python using Windsor.ai?
The free forever plan covers 1 data source, so connecting YouTube Public on its own costs nothing and needs no credit card. Combining YouTube Public with other sources needs a paid plan: $19/month for 3 sources or $99/month for 7. See the pricing page.
Can I see watch time or traffic sources for a competitor's channel?
No. YouTube shares watch time, retention, traffic sources and audience demographics only with the people who own or manage a channel. YouTube Public reports what any viewer can see: subscribers, total views, video count, and each video’s views, likes, comments, tags and length. For those numbers on your own channel, use the YouTube connector.
Does YouTube Public show how a channel grew over time?
No, not on its own. Each request returns the totals as they are at that moment, not a daily history, so a comparison over time needs the results of earlier requests saved, for example in a spreadsheet or a warehouse.
Do you have helpful links to get started with YouTube Public and Python?
Yes. Start with the YouTube Public field reference, the Python integration documentation and the Windsor.ai connectors for Python. The YouTube Public connector page lists every destination for this data.
For watch time, traffic sources and retention on your own channel, read how to connect YouTube Analytics to Claude. The guide on Instagram competitor analysis with Claude uses the same competitor comparison for another platform.
For a tested walkthrough with prompts, see YouTube competitor analysis with Claude.
Tired of manual YouTube Public data exports? Try Windsor.ai today to work on current data

