Preface in stating that I have no idea how to approach this, I have no previous experience in IT/comp sci. Please explain everything as if I am a mentally impaired eight-year-old nephew.
Using youtube API to try and get a list of youtube channels with a range of subscribers but I get an error of “Paramater ‘order’ value ‘subscriberCount’ is not an allowed value.”
I am assuming that subscriberCount is not an actual parameter to search by in Youtube API? If this is the case how or what options would I have to try and get this information? I have the Youtube API with a key and have been trying to use jupyter and python to get data on individual YT channels (I am successful in this) but I am trying to compile lists of YT channels now by subscriber count and trying to get youtube ID.
I would not need the data to be organized by subscriber count (meaning small to large) just to return a list of YT channels that fit this one search field of having a subscriber count between x and x.
Have been trying the below sequence
api_service_name = "youtube"
api_version = "v3"
# Get credentials and create an API client
youtube = build(
api_service_name, api_version, developerKey=api_key)
# Create a request to the YouTube API
request = youtube.channels().list(
part='id,statistics',
maxResults=50,
order='subscriberCount',
minSubscribers=1500,
maxSubscribers=2000
)
# Execute the request and get the response
response = request.execute()
# Extract the channel IDs from the response
channel_ids = []
for item in response['items']:
channel_ids.append(item['id'])
# Print the channel IDs
print(channel_ids)
Navi is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.