Open zoldar opened 2 days ago
100 seems quite low as a maximum limit and 10 as a default - why not 100 as default and 1000 as maximum? The query and response sizes are quite minimal and we're just inconveniencing users.
100 seems quite low as a maximum limit and 10 as a default - why not 100 as default and 1000 as maximum? The query and response sizes are quite minimal and we're just inconveniencing users.
Yes, I guess those could be bumped. The current limits are what's currently in effect for Plugin API.
Bumped pagination limits in https://github.com/plausible/analytics/pull/4302/commits/93b3c571491f1571f741620ad6814663d434a59e
Changes
This PR extends Sites API in following ways:
GET /api/v1/sites
endpoint listing all sites the API key owner has access toGET /api/v1/sites/goals
endpoint listing all goals for a givensite_id
GET /api/v1/sites/:site_id
endpoint withallowed_custom_props
field listing all custom properties allowed for a given siteThe list endpoints implement cursor based pagination. They accept following parameters:
before
,after
andlimit
(defaults to 10, capped at 100 as max). The response payload always contains pagination metadata:After the initial request, previous and next pages can be retrieved by repeating the same request with
before
orafter
query parameter added from the last response. Thelimit
parameter must remain the same when paginating (either at default or the same value must be passed each time explicitly). Thenull
value inbefore
orafter
means there are no more either previous or next pages to navigate to.There are no breaking changes to the API and the new extensions follow existing path and data shape conventions.
Tests
Changelog
Documentation
Dark mode