Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API Call 'youtube#searchListResponse' return inconsistent results #2451

Open
dudio92 opened this issue Jul 29, 2024 · 1 comment
Open

API Call 'youtube#searchListResponse' return inconsistent results #2451

dudio92 opened this issue Jul 29, 2024 · 1 comment
Labels
priority: p2 Moderately-important priority. Fix may not be included in next release. type: question Request for information or clarification. Not an issue.

Comments

@dudio92
Copy link

dudio92 commented Jul 29, 2024

Hi All,
I'm having an issue querying 'searchListResponse' with the same argument each call

Environment details

  • OS type and version: MacOS 14.5 (23F79)
  • Python version: Python 3.10.11
  • pip version: pip 21.3.1
  • google-api-python-client version: 2.138.0

Steps to reproduce

  1. Run search() list as follows:
 search().list(
            part="snippet",
            q='my search query',
            type="video",
            pageToken=None,
            order='date',
            publishedAfter=earliest_date,
            publishedBefore=latest_date,
            maxResults=1
        )
        response = request.execute()
  1. Observe results count
  2. Run step 1 again
  3. Observe again

Code example

for i in range(10):
    request = self.youtube.search().list(
        part="snippet",
        q=query,
        type="video",
        pageToken=None,
        order='date',
        publishedAfter=earliest_date,
        publishedBefore=latest_date,
        maxResults=1
    )
    response = request.execute()
    print(response['pageInfo'])
    
{'totalResults': 57238, 'resultsPerPage': 1}
{'totalResults': 81, 'resultsPerPage': 0}
{'totalResults': 57238, 'resultsPerPage': 1}
{'totalResults': 57238, 'resultsPerPage': 1}
{'totalResults': 57570, 'resultsPerPage': 1}
{'totalResults': 52429, 'resultsPerPage': 1}
{'totalResults': 81, 'resultsPerPage': 0}
{'totalResults': 57356, 'resultsPerPage': 1}
{'totalResults': 81, 'resultsPerPage': 0}
{'totalResults': 57849, 'resultsPerPage': 1}

Making sure to follow these steps will guarantee the quickest resolution possible.

Thanks!

@vchudnov-g
Copy link
Contributor

Hi @dudio92 ! Thanks for reporting this. This does not look like a client library issue, but rather an issue with the YouTube service API. Could you report your issue with search.list to the service team as suggested in https://developers.google.com/youtube/v3/support? Thanks!

@vchudnov-g vchudnov-g added priority: p2 Moderately-important priority. Fix may not be included in next release. type: question Request for information or clarification. Not an issue. labels Sep 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: p2 Moderately-important priority. Fix may not be included in next release. type: question Request for information or clarification. Not an issue.
Projects
None yet
Development

No branches or pull requests

4 participants