kishore venna
kishore venna

Reputation: 1

YouTube API is not giving accurate video results

  1. Getting video in the results even though it didn't match query parameter(q)

    The parameter i passed didn't exists in body,title,tags, But the video is relavant. Is API looks any other metadata of video.

    For Example: i have given parameter as "mobile", this video https://www.youtube.com/watch?v=j8UNo3vRIB0 is coming as result, here video title and description not contain mobile as parameter

  2. Latest data not coming consistently in youtube api

    Some times latest data not coming in youtube data api.

    For Example: i have given rule as "amazon". This video https://www.youtube.com/watch?v=6zygd1iW-f4 is showing in youtube website's latest videos but not coming in youtube api result.

Example query: https://www.googleapis.com/youtube/v3/search?part=snippet&order=date&q=amazon&maxResults=50&type=video&key=xyz

Upvotes: 0

Views: 915

Answers (2)

analog-nico
analog-nico

Reputation: 2780

You are actually stumbling on a very tricky scenario. Your goal is to get the same results via the API that you also see on YouTube’s website, right?

First, make sure that you configured the search endpoint as identical to your YouTube user account as possible:

  • order: relevance
  • relevanceLanguage: Same as the language that you set in the menu of YouTube’s website (Use a ISO 639-1 2-letter Code)
  • regionCode: Same as the country that you set in the menu of YouTube’s website (Use a ISO 3166-1 2-letter Code)

With these settings you will see that the results will be quite similar. But still not identical. Not because the API is not working or is still not properly configured but rather because YouTube’s search results change all the time. Just do the same exact search on YouTube’s website just 10 seconds apart. You’ll see that you get different search results.

Upvotes: 0

stvar
stvar

Reputation: 6955

W.r.t. point (1), Youtube is working OK, since the content of that video is related to the keyword mobile (please convince yourself by watching the first couple of minutes of that video).

For what concerns your point (2), I cannot in any way make the Youtube site to produce the video 6zygd1iW-f4 near the top of its search result set for the query term amazon.

All in all, I deem your claims above unsustainable.

Please note that one cannot expect crisp results from Youtube when queried with such general terms as yours is. One should not expect Youtube's searching feature to work similarly to say a full-text search in single computer-stored database. There will always be a degree of fuzziness associated to querying Youtube for broad terms.

Upvotes: 1

Related Questions