Dailymotion API fulltext search : exclude keywords - dailymotion-api

Is there a way to search videos and exclude a list of keywords?
I tried to exclude terms through the API by passing the search foo -bar :
https://api.dailymotion.com/videos?search=foo+-bar
But the response contains video that matches both foo and bar.
The behaviour seems to be the same on the website's main search bar.

no, unfortunately Dailymotion doesn't offer a way to search for videos by exclude a list of keywords, -bar won't work on the API nor on the webbsite.
What you can do though is to filter reponses on your side after you get them through the api.

Related

Boolean OR doesn't seem to work in Youtube APIv3 list search

I am trying to search videos with different keywords. When I use multiple keywords with OR then it is showing empty results.
GET https://www.googleapis.com/youtube/v3/search?part=id%2Csnippet&publishedAfter=2017-07-07T00%3A00%3A00Z&q=Social+Media+Artificial+Intelligence+Assistant%7CSocial+Media+Artificial+Intelligence+Automation%7CDigital+Marketing+Artificial+Intelligence+Assistant&relevanceLanguage=en&type=video&key={YOUR_API_KEY}
When I try individual keywords, it is showing results. Say,
GET https://www.googleapis.com/youtube/v3/search?part=id%2Csnippet&publishedAfter=2017-07-07T00%3A00%3A00Z&q=Social+Media+Artificial+Intelligence+Assistant&relevanceLanguage=en&type=video&key={YOUR_API_KEY}
I tried multiple ways "A|B" , "A | B" nothing worked. Im checking directly on their API explorer here
Any clues?
Let me explain with example when 2 phrases are to be ORed.
For e.g.: "When Harry met Sally" OR "Jab We met"
This will be URL encoded as: %22When+Harry+met+Sally%22+OR+%22Jab+We+met%22
You can look in API explorer for the above example: https://developers.google.com/apis-explorer/#p/youtube/v3/youtube.search.list?part=id%252Csnippet&publishedAfter=2017-07-07T00%253A00%253A00Z&q=%2522When+Harry+met+Sally%2522+OR+%2522Jab+We+met%2522&relevanceLanguage=en&type=video&_h=6&

You Tube Search List Api searches on title or description or tag field?

As mentioned in the doc, search list api returns a collection of search results that match the query parameters specified in the API request. By default, a search result set identifies matching video, channel, and playlist resources, is this searching done on title, description and tag fields or only on title or tag field of the video, channel and playlist resource?
you can simply use allintitle operator to search youtube videos on title
so your query will look like
allintitle:"How to dance"
You can read more about this here and here
You can do the same using youtube API
According to the Document :
Required parameters:
part
string
The part parameter specifies a comma-separated list of one or more
search resource properties that the API response will include. Set the
parameter value to snippet.
You can try it in YouTube Search List API Try It. Remember to be authorized first before you execute it.
The other parameters like you mentioned earlier: title can be replaced with the q parameter to be specific with your search. The q parameter can be found in the Search For Files document.
You can search or filter files with the files.list method of the Drive
API. These methods accept the q parameter which is a search query
combining one or more search clauses. Each search clause is made up of
three parts.
Unfortunately, you cannot select where the q will look into e.g. title, tag, description.
Hope this helps.

Google youtube API, how do i search for specific keyword?

I want to search for keyword related youtube videos, I'm using youtube getdata API.
Reading documentation I came up with this:
http://gdata.youtube.com/feeds/api/videos/-/". urlencode($kwd) ."?orderby=viewCount&max-results=". $max ."&alt=json
But this is not a real search, it gives urls taged with keyword... Youtubes internal search works quite differently I imagine, because comparing results don't match at all.
Any ideas?
The URL you offer does a search for any videos in a category where the category includes your keyword. What you want to do instead is to send a query string:
"https://gdata.youtube.com/feeds/api/videos?q=". urlencode($kwd) ."&orderby=viewCount&max-results=". $max ."&alt=json"
This way the feed will match right on the videos rather than the categories.
In the newer v3 of the API, your call would look like:
"https://www.googleapis.com/youtube/v3/search?part=snippet&q=".urlencode($kwd)."&maxResults=".$max."&order=viewCount&key={YOUR_API_KEY}"
Use Data API v3, search->list method.
GET https://www.googleapis.com/youtube/v3/search?part=snippet&q=term&key={YOUR_API_KEY}
In my opinion, I would use the "q" parameter, for example to search for "dog"
var request = gapi.client.youtube.search.list({
part: 'snippet',
q: "dog"
});
But I'm just a noob the others guys answers are probably better.

Tags (keywords) are missing from the Youtube API video feed when using category search

When I make an authorized call for Youtube videos, I get all the tags/keywords in the feed.
http://gdata.youtube.com/feeds/api/users/default/uploads?alt=jsonc&v=2
However, if I want to filter this result by a single keyword/category, the tags are not returned by the API. Example, I want to reduce the number of videos in the feed by tag "English"/"French".
http://gdata.youtube.com/feeds/api/users/default/uploads/-/English?alt=jsonc&v=2
Is this expected behavior or a bug?
It's expected behavior; this blog post explains how your second request is going against the search index, which will never return keywords/tags in the response.

Retrieving youtube most_viewed url

How to apply filter in the youtube most_viewed video .
Like url for most_viewed videos is :
http://gdata.youtube.com/feeds/api/standardfeeds/most_viewed?v=2
i wanted to apply filters inside the above url .
like how to search the videos by keywords inside the most_viewed category .
Request :Please don't refer Youtube Developer Guide
The only filter I know of is the category keyword. For example, to filter most viewed "Games" videos, you would use :
http://gdata.youtube.com/feeds/api/standardfeeds/most_viewed_Games?v=2
The complete categories list is made available by Google.
[EDIT :]
The manual page statement makes it clear :
In general, parameters that are used for filtering and ordering
results are only supported for search requests.
Here is the full manual page
Hope this helps !

Resources