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

Expose total for paginated APIs #228

Open
timrae opened this issue Apr 3, 2023 · 2 comments
Open

Expose total for paginated APIs #228

timrae opened this issue Apr 3, 2023 · 2 comments
Labels
v10 Spotify-api.js v10
Milestone

Comments

@timrae
Copy link

timrae commented Apr 3, 2023

Feature Request

Some Spotify APIs use a paginated response model. For example in the ArtistManager class, the search() and getAlbums() functions take a limit and offset parameter which can be used to specify the page number and size.

Unfortunately these functions do not expose the total number of items, so in general the developer doesn't know whether or not there are more items able to be read. In this case it could be necessary to make one api call more than necessary to ensure that all items have been fetched.

In these instances it would be useful to return the raw response data (which includes the .total member) instead of the .items data member, to allow the developer to optimize performance.

@scientific-dev scientific-dev added the v10 Spotify-api.js v10 label Apr 5, 2023
@scientific-dev
Copy link
Member

The spotify-types, spotify-api.js and their documentation are outdated for a few functions. The updates will be made in the upcomming version which will take some time (probably more than a month).

@johnyvelho
Copy link

using user.getPlaylists() and would also be nice to have pagination metadata like .total, .next, etc.

@abh80 abh80 added this to the v10 milestone Feb 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
v10 Spotify-api.js v10
Projects
None yet
Development

No branches or pull requests

4 participants