You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jun 28, 2023. It is now read-only.
...you can return as many or as few as you like from the api...
Therefore, I did think that simply querying the base URL would return all beers. However, this:
curl https://api.punkapi.com/v2/beers
Returns only twenty five results, which seems to be the default per_page number.
Using the per_page parameter seems to max out at 80
curl https://api.punkapi.com/v2/beers?per_page=81
{"statusCode":400,"error":"Bad Request","message":"Invalid query params","data":[{"location":"query","param":"per_page","msg":"Must be a number greater than 0 and less than 80","value":"81"}]}
I've just started writing a wrapper for the API and am trying to handle the case where the user inputs no parameters.
Yeah I think as the db grows I would prefer to return a default amount (currently 25). I need to rewrite the server to be honest and it’s been on my todo list for a while. I ideally want to make this one massive mono repo as things are spread over several repos currently
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
The API V2 documentation page says:
All parameters are optional and without them the API will just return the beers in ascending order from their ID.
You also mentioned in this issue that:
...you can return as many or as few as you like from the api...
Therefore, I did think that simply querying the base URL would return all beers. However, this:
Returns only twenty five results, which seems to be the default
per_page
number.Using the
per_page
parameter seems to max out at 80I've just started writing a wrapper for the API and am trying to handle the case where the user inputs no parameters.
This could also be linked to Issues #44 and #52
The text was updated successfully, but these errors were encountered: