0

For instance,

//php code
  $client = new Google_Client();
  $client->setDeveloperKey($DEVELOPER_KEY);
  $youtube = new Google_Service_YouTube($client);
  $searchResponse = $youtube->search->listSearch('id', array(
    'part' => "snippet",
    'type' => "channel",
    'maxResults' => "50",
    'order' => "viewCount",
    'publishedAfter' => "2021-10-25T00:00:00Z",
    'publishedBefore' => "2021-10-25T23:59:59Z",
    'regionCode' => "JP",
));

This query return only 9 channels (and the regionCode of several channels are not JP). There should be more than 9 channels under this filter because channel id such as UCUJNWCiqMT_UudVRSSGZ3SA satisfy all conditions (proved by the information return by Channels API) but was not contained in those 9 channels. I have tried to add condition 'safeSearch' => "none", but it doesn't work either.

This is just an example to show that Youtube Data API Search: list seems only return a small piece of data (at least in the case of channels) which were unrealiable.

Was my code wrong or this API does only provide incomplete results? How could I get realiable results?

Best regards

Benjamin Loison
  • 3,782
  • 4
  • 16
  • 33
  • YouTube Data API v3 Search endpoint doesn't work properly, your question is similar to this one https://stackoverflow.com/questions/68970958/how-do-i-get-channel-ids-for-all-youtube-channels-in-japan where I shared the only (hardcore) way I know to try to get something. Note: regionCode, according to the documentation, is specific to videos but if I remember correctly, even for videos it doesn't work. And publishedBefore/After doesn't work quite fine too if I remember well. – Benjamin Loison Mar 11 '22 at 07:55
  • @Benjamin Loison Thanks for the reply. The method you mentioned in your answer (crawl & check channels manually through videos and YouTube-auto-created playlist) seems effective and I would like to try it. BTW I also noticed that Social Blade provides Top 100 Youtubers by country and appears to have a whole ranking by region in their database as you can browse any channel's COUNTRY RANK(don't know if they used the similar strategy with you or not). I've contacted Social Blade API support team and they mentioned that `lookup of country` feature may be published by the end of the year. – World Tiny Mar 11 '22 at 08:56
  • 1
    Social Blade database seem to be both done with algorithms and human help, for instance in the top 100 France we used to have bonnietylerVEVO (who isn't French). I don't think they have YouTube API privilege access in terms of private endpoints. I don't think they'll give you a big help, I still think (months after having it done) that my (hardcore) approach is still the most effective. And I personally used to have good results with it. – Benjamin Loison Mar 11 '22 at 09:44

0 Answers0