0

I'm trying to use youtube data search and video API in my web application to display top view-counted videos related with several keywords. I'm planing to use totally two calls: the first call get id list with search API, and the second call get details for the ids hit on the first call, with video API.

My question is with regard to search API. Based on my trial and error, If I input multiple keyword with space separation in the parameter q for search API, it's looks behaves as AND condition it's not same as common behavior such as google. To search with multiple keywords with OR condition, As far as I tried, it's looks working if I Include the OR between keywords, but I would like to confirm my assumption correct, officially if possible.

I should be able to find this kind of specification in the official documentation, but finally I have no luck. It's very helpful if you could share these links if exists or give me the official answer.

By the way, it is my first post to stackoverflow. If there is missing point of my question, please kindly advice.

4
  • Welcome to Stack Overflow, @yuichi.iwashita! Unfortunately, as far as I know, there's no official documentation of the syntax of the q parameter of the Search.list API endpoint other than this short one. Nevertheless, do experiment using it.
    – stvar
    May 25, 2021 at 14:29
  • @stvar Thank you for your answer. I can experiment, but my client requested to confirm the specification of my assumption is correct. My experiment might become Inductive experience but not always truth. It's very helpful if you confirm the specs for OR condition, but is it difficult? May 26, 2021 at 5:52
  • As per the (short) documentation quoted, @yuichi.iwashita, the operators are | and -, for the boolean OR and boolean NOT respectively. With respect to OR, I can only derive from the spec that the query term for searching for videos matching either boating or sailing is not boating OR sailing, but boating|sailing. Thus don't use in your query terms OR but |; don't use NOT but -.
    – stvar
    May 26, 2021 at 9:29
  • @stvar Thank you for your kind support! I understand. May 27, 2021 at 3:21

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.