Closed Bug 809528 Opened 12 years ago Closed 12 years ago

Limit parameter for feed API, with a value of 50 by default

Categories

(developer.mozilla.org Graveyard :: API, defect, P1)

defect

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: openjck, Unassigned)

References

()

Details

(Whiteboard: c=API)

Our feed API should provide an optional parameter for limiting the number of results, with a value of 50 by default.
Priority: P1 → P2
Priority: P2 → P1
Whiteboard: c=API → c=API p=2
Whiteboard: c=API p=2 → c=API
Depends on: 818669
Reference:  https://github.com/mozilla/kuma/pull/674/files

What's an example URL endpoint for this?  I'm not entirely sure where to start with this.
FWIW, there's currently a hardcoded limit of 100. Should be pretty easy to change that into a default and honor a query param for a different limit.

But, make sure to add an upper bound to the limit - say, 1000 or something, so that someone requesting the feed can't use ?limit=999999 and try grabbing ALL the things.
Actually, another thought I just had from IRC:

We can have a low ceiling like 50 or 100 items, as long as we also have an ?offset parameter to facilitate pagination through results.

An example use case would be a script that wants to scoop up every page under a certain tag in JSON. It could request 50 results using an offset incrementing by 50, until the results run out.
Commits pushed to master at https://github.com/mozilla/kuma

https://github.com/mozilla/kuma/commit/fdef8f1525197870ff94a5ebb20f59dabd07af27
fix bug 809528 - Add limit param for RSS feeds

https://github.com/mozilla/kuma/commit/5e88792488443637af008978f360725422c71fe2
Merge pull request #751 from darkwing/rss-limit-809528

fix bug 809528 - Add limit param for RSS feeds
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Verified FIXED on prod now, too: https://developer.mozilla.org/en-US/docs/feeds/rss/revisions -- defaults to 50 items.
Status: RESOLVED → VERIFIED
Product: developer.mozilla.org → developer.mozilla.org Graveyard
You need to log in before you can comment on or make changes to this bug.