Steve Carlson
Steve Carlson

Reputation: 1

Negative filter Youtube APIv3 search on TopicID

https://developers.google.com/youtube/v3/docs/search/list

How can I exclude all results for a given topic from my search?

For example,

topicId="-/m/04rlf" to exclude all results with Music as topic.

Upvotes: 0

Views: 47

Answers (1)

abielita
abielita

Reputation: 13469

You may refer with this documentation. The q parameter specifies the query term to search for.

Your request can also use the Boolean NOT (-) and OR (|) operators to exclude videos or to find videos that are associated with one of several search terms. For example, to search for videos matching either "boating" or "sailing", set the q parameter value to boating|sailing. Similarly, to search for videos matching either "boating" or "sailing" but not "fishing", set the q parameter value to boating|sailing -fishing. Note that the pipe character must be URL-escaped when it is sent in your API request. The URL-escaped value for the pipe character is %7C.

Upvotes: 1

Related Questions