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

Pagination on a search result #416

Closed
emmanuelvargas opened this issue Dec 20, 2021 · 5 comments
Closed

Pagination on a search result #416

emmanuelvargas opened this issue Dec 20, 2021 · 5 comments
Labels
answered Automatically closes as answered after a delay

Comments

@emmanuelvargas
Copy link

Hello,

sorry if it's not the good place to ask this but I didn't find anything on the documentation about it.

I'm a bit lost how to have more than 100 results in a search

how work the pagination with a search result?

Thank in advance

@browniebroke
Copy link
Owner

You can iterate through the results using the limit and index keyword arguments of the search function:

from deezer import Client

cli = Client()
# default search: fetch the first results with the default length (25)
cli.search("Black Eyed Peas")

# fetch the first results with the with a page length of 50
cli.search("Black Eyed Peas", limit=50)

# fetch 20 results, starting from the one at index 21
cli.search("Black Eyed Peas", limit=20, index=21)

@browniebroke browniebroke added the answered Automatically closes as answered after a delay label Dec 20, 2021
@github-actions
Copy link
Contributor

Assuming the original issue was solved, it will be automatically closed now.

@yakuv0
Copy link

yakuv0 commented Oct 3, 2022

You can iterate through the results using the limit and index keyword arguments of the search function:

from deezer import Client

cli = Client()
# default search: fetch the first results with the default length (25)
cli.search("Black Eyed Peas")

# fetch the first results with the with a page length of 50
cli.search("Black Eyed Peas", limit=50)

# fetch 20 results, starting from the one at index 21
cli.search("Black Eyed Peas", limit=20, index=21)

@browniebroke
was that removed later ? getting this error

TypeError: search() got an unexpected keyword argument 'limit'

cheers

@browniebroke
Copy link
Owner

Yes this was changed when the pagination was reworked to work transparently. See the documentation for and example: https://deezer-python.readthedocs.io/en/stable/usage.html#first-steps

This page links to the section about pagination where it explains in detail the various use cases that were asked about here.

@yakuv0
Copy link

yakuv0 commented Oct 3, 2022

Yes this was changed when the pagination was reworked to work transparently. See the documentation for and example: https://deezer-python.readthedocs.io/en/stable/usage.html#first-steps

This page links to the section about pagination where it explains in detail the various use cases that were asked about here.

Crystal clear, really appreciate it @browniebroke

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
answered Automatically closes as answered after a delay
Projects
None yet
Development

No branches or pull requests

3 participants