Quantcast
Channel: Active questions tagged youtube-api - Stack Overflow
Viewing all articles
Browse latest Browse all 3720

YouTube API search videos by topic id: showing implausibly few results

$
0
0

For my project, I want to get a list of youtube videos for different topic ids. However, searching via search: list returns a measly 343 video ids for the biggest topic on youtube (lifestyle) for the year 2020.I am restricting it to relevanceLanguage = 'en', but this sample just seems too small. Is my request wrong? Or are most videos on YouTube not categorised and that's why search doesn't return it?

matches = []next_page_token = None while True:    request = youtube.search().list(        maxResults = 50,         part = "snippet",        order= "date",        topicId = '/m/019_rr',        publishedAfter = '2020-01-01T00:00:00Z',        publishedBefore = '2021-01-01T00:00:00Z',        regionCode="US",        relevanceLanguage="en",        type="video",        pageToken = next_page_token        )    response = request.execute()    for item in response["items"]:        matches.append(item)    next_page_token = response.get('nextPageToken')    if not next_page_token:        break

Viewing all articles
Browse latest Browse all 3720

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>