[GH-ISSUE #2] Add pagination support to /api/v1/prefixes #2

Closed
opened 2026-02-27 15:43:48 +03:00 by kerem · 1 comment
Owner

Originally created by @Someguy123 on GitHub (Feb 21, 2020).
Original GitHub issue: https://github.com/Privex/looking-glass/issues/2

Originally assigned to: @bt-cryptomancer on GitHub.

Currently the API doesn't support pagination, which can be a problem when viewing ASNs with large amounts of prefixes such as Hurricane Electric (AS6939).

The list_prefixes view ( https://github.com/Privex/looking-glass/blob/master/lg/peerapp/views.py#L117 ) should support the GET parameters limit / skip, and to prevent abuse, limit should have a configurable default and maximum, e.g. DEFAULT_API_LIMIT=1000 MAX_API_LIMIT=10000

Example:

# page 1
GET /api/v1/prefixes?asn=6939&limit=1000

# page 2
GET /api/v1/prefixes?asn=6939&limit=1000&skip=1000
Originally created by @Someguy123 on GitHub (Feb 21, 2020). Original GitHub issue: https://github.com/Privex/looking-glass/issues/2 Originally assigned to: @bt-cryptomancer on GitHub. Currently the API doesn't support pagination, which can be a problem when viewing ASNs with large amounts of prefixes such as Hurricane Electric (AS6939). The list_prefixes view ( https://github.com/Privex/looking-glass/blob/master/lg/peerapp/views.py#L117 ) should support the GET parameters `limit` / `skip`, and to prevent abuse, `limit` should have a configurable default and maximum, e.g. `DEFAULT_API_LIMIT=1000` `MAX_API_LIMIT=10000` Example: ``` # page 1 GET /api/v1/prefixes?asn=6939&limit=1000 # page 2 GET /api/v1/prefixes?asn=6939&limit=1000&skip=1000 ```
kerem closed this issue 2026-02-27 15:43:48 +03:00
Author
Owner

@bt-cryptomancer commented on GitHub (Apr 10, 2020):

Task complete in linked PR

<!-- gh-comment-id:611820316 --> @bt-cryptomancer commented on GitHub (Apr 10, 2020): Task complete in linked PR
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/looking-glass#2
No description provided.