Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to find videos by country and keyword?

Tags:

youtube-api

I want to find Youtube videos by country and keyword. For example: All videos about Obama that were uploaded in Norway.

Things that I have already tried:

1, Standard feeds allow country specific results but no keyword search. Example: http://gdata.youtube.com/feeds/api/standardfeeds/NO/top_rated?v=2

2, Regional settings for custom feeds isn't even accurate. This pulls up videos from anywhere in the world in spite of the fact that the region is specified. Example: http://gdata.youtube.com/feeds/api/videos?q=Obama&region=NO

3, Custom feeds with location coordinates and radius worked poorly. I had to add the coordinates of all the major cities of a country. This would have worked ok except that the youtube videos don't appear in the feed unless they have location meta data, which needs to be inputted by the youtube uploader. Not many people include this data when they upload a video. Example: http://gdata.youtube.com/feeds/api/videos?q=Obama&location=59.9494,10.7564

If I am overlooking something then please let me know. Am I trying to put a square peg in a round hole?

like image 586
Qwertyfshag Avatar asked Sep 22 '12 04:09

Qwertyfshag


1 Answers

Notes regarding your approaches:

  1. The standard feeds for a specific country do not only include videos that were uploaded in that country. They just reflect videos that meet some criterion (popularity, etc.) among viewers in a given country.

  2. The region parameter only applies to movie charts, and is not something that works as a parameter for general searches: https://developers.google.com/youtube/2.0/reference#regionsp

  3. This is the only thing that could possibly work. Unfortunately, you can only specify circular areas in location restrictions, but you can try to approximate the region you're looking for with a series of circles. The fact that only videos that have location metadata appear in search results is a feature, not a bug—data about where the video is taken is only publicly visible if the uploader wants it to be.

like image 58
Jeff Posnick Avatar answered Oct 21 '22 09:10

Jeff Posnick