[GH-ISSUE #269] Search limit #209

Closed
opened 2026-02-27 22:08:36 +03:00 by kerem · 2 comments
Owner

Originally created by @Drimkaa on GitHub (Apr 15, 2022).
Original GitHub issue: https://github.com/sigma67/ytmusicapi/issues/269

Hi, can you explain how the search works with setting a limit? (I'm just trying to do something similar to node.js)

Originally created by @Drimkaa on GitHub (Apr 15, 2022). Original GitHub issue: https://github.com/sigma67/ytmusicapi/issues/269 Hi, can you explain how the search works with setting a limit? (I'm just trying to do something similar to node.js)
kerem 2026-02-27 22:08:36 +03:00
  • closed this issue
  • added the
    question
    label
Author
Owner

@sigma67 commented on GitHub (Apr 16, 2022):

Limit only works if you have some kind of filter (i.e. songs). The default number of songs being returned is 20. If you set the limit value to a value higher than that, ytmusicapi will keep asking the server for continuations until your limit parameter is reached. So say you put limit=50, it will return 60 song results.

You can check the code below. get_continuations is a generic function that's being used by all methods that have continuation logic, so check that if you want to know how continuations work in general.
github.com/sigma67/ytmusicapi@1d30910e23/ytmusicapi/mixins/browsing.py (L289-L298)

<!-- gh-comment-id:1100618377 --> @sigma67 commented on GitHub (Apr 16, 2022): Limit only works if you have some kind of filter (i.e. `songs`). The default number of songs being returned is 20. If you set the limit value to a value higher than that, ytmusicapi will keep asking the server for continuations until your limit parameter is reached. So say you put `limit=50`, it will return 60 song results. You can check the code below. `get_continuations` is a generic function that's being used by all methods that have continuation logic, so check that if you want to know how continuations work in general. https://github.com/sigma67/ytmusicapi/blob/1d30910e23f24a77755a46c59f14382bebb32eb5/ytmusicapi/mixins/browsing.py#L289-L298
Author
Owner

@Drimkaa commented on GitHub (Apr 16, 2022):

Thanks, it helped.

<!-- gh-comment-id:1100674278 --> @Drimkaa commented on GitHub (Apr 16, 2022): Thanks, it helped.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/ytmusicapi#209
No description provided.