Complex YouTube search query - youtube

I have to search in a subset of YouTube results. For example, the query should search for some song title that belongs to a set of artists. Is it possible to group expressions?
For example, I would like to find all videos titled Vogue by either Madonna or Rihanna. So the required query should like something like this:
(Madonna|Rihanna)+Vogue.
The problem with this query is that the results returned will include all the songs by Rihanna and Madonna and all the videos that have Vogue in the title. And this I don't want.
Is there any way to specify complex logical expression to YouTube search API?

Just be more precise with your logic and use:
madonna+vogue|rihanna+vogue

Related

Finding random youtube videos of a specific language with subtitles

i would like to crawl Youtube for videos of a specific language that contains subtitles/closed-captions(CC).
For example,
I want to crawl for 200 random English videos with English subtitles/(CC).
I want to crawl for 300 random Chinese videos with Chinese subtitles/(CC).
I want to crawl for 550 random Malay videos with Malay subtitles/(CC).
There's an api here that helps to extract transcripts, but the main bottleneck right now is that i have to go youtube to search for these videos and watch one by one to find out if they are indeed in the correct language, and if they really contain subtitles/CC.
An option is:
Use YouTube Data API - search request for search videos that contains subtitles; for that, use videoCaption parameter with value: closedCaption.
You might need use another parameters for reduce the search terms to specific topics or get certain desired results; for example, for the q parameter, use a search term that retrieves the desired results; also all parameters like: videoDuration, type = video, relevanceLanguage.
Once you got such results, copy/paste the videoId you got from the results of the request and use your web-crawler for get more videos and the related ones.
For anyone still struggling with this, and as per the YouTube Data API for videoCaption to work, you need to also set the type parameter's value to video:
If you specify a value for this parameter, you must also set the type
parameter's value to video.

Youtube data API, query within channel lead to unexcpected results

I'm trying to use Youtube Data API for a project, the goal is seeking for a keyword in a channel and show the response to the user. I used the Search for "snippet" part and launched it querying for a specific keyword and specifing the channel id but the response didn't include all the videos that I was expecting. For instance, let's say that the channel has 10 videos with "c" charachter in the title, setting the q field with "c" value will return only one video.
On the other side, if I search for a whole word it returns some videos with that word on title and some other videos that doesn't have it, neither in description. The order criteria in this case seems to be ok (from the strongest match to the most weak), but I don't know if all of this is working fine.
Is this a normal behaviour or am I doing something wrong?
Setting an order on the search, the issue seems to be solved.

Dailymotion Graph API Search string

I am unable to get Dailymotion Graph API to do a search on a multiple word term. For example:
https://api.dailymotion.com/videos/?search=%22glacier+national+park%22&page=1&limit=3
Will still search on each word separately.
If I &sort=relevance, then it is fine, but if I'd like to sort differently, it will pull titles with only the word "national" in them, and not restrict to the full term.
Their own Graph API tool mimics this:
https://www.dailymotion.com/doc/api/explorer#/video/list
It almost seems like it is a bug, but prolly I'm just not finding the right syntax.
TIA!
Good news, you can do a search on multiple terms by using quotes around words.
Hence your request:
https://api.dailymotion.com/videos/?search=%22glacier+national+park%22&page=1&limit=3
should return what you're looking for!

Top 100 youtube videos

Is there any way to have updated lists of top 100 videos of youtube by genre and/or by country!
Any kind of resources like json files or xml.
You'll want to use the chart parameter of the videos.list endpoint. Set the chart to mostPopular, and then include a regionCode parameter and videoCategoryId parameter for further narrowing down. For example,
GET https://www.googleapis.com/youtube/v3/videos?part=snippet&chart=mostPopular&regionCode=UA&key={YOUR_API_KEY}
Will retrieve the 5 most popular videos in the Ukraine.
GET https://www.googleapis.com/youtube/v3/videos?part=snippet&chart=mostPopular&maxResults=25&regionCode=DE&videoCategoryId=1&key={YOUR_API_KEY}
Will retrieve the 25 most popular videos in Germany that relate to Film/Animation. And so on.
Note that if you don't include a videoCategoryId parameter, it will return results from all categories. If you don't include a regionCode, it returns the most popular videos across all regions. You can only set videoCategoryId to a value that's valid in the region you're searching in (you can use the videoCategories.list endpoint to find valid categories for regions, languages, etc.)

Twitter hashtag search in user id list

I'd like to find mentions of a hashtag from my friends on Twitter.
At the moment I'm doing:
https://api.twitter.com/1/friends/ids.json?cursor=-1&screen_name=(name)
This returns a list of ids. What I'm then looking at doing is searching for a hashtag mention within that list of ids. Something like:
http://search.twitter.com/search.json?q=#hashtag IN user_id=(1,2,3,4)
One possible (and undesirable) workaround would be to do batch processing of:
http://api.twitter.com/1/users/lookup.json?user_id=(1,2,3,4 ~ 100)
And then construct a query based on the screen names.
Thanks

Resources