ip-addresses api call limit 1000 #3230

Closed
opened 2025-12-29 18:26:54 +01:00 by adam · 2 comments
Owner

Originally created by @pp-007 on GitHub (Jan 28, 2020).

Looks like adding ?limit=0 for ip-addresses does not behave as described in the docs (https://netbox.readthedocs.io/en/stable/api/overview/#pagination).

Running netbox 2.6.8.

Actual result:

$ curl -sk -H "Accept: application/json" "https://server/api/ipam/ip-addresses/?limit=0" | jq '.count'
10296

$ curl -sk -H "Accept: application/json" "https://server/api/ipam/ip-addresses/?limit=0" | jq '.results[] | .address' | wc -l
1000

Expected result:

$ curl -sk -H "Accept: application/json" "https://server/api/ipam/ip-addresses/?limit=0" | jq '.count'
10296

$ curl -sk -H "Accept: application/json" "https://server/api/ipam/ip-addresses/?limit=0" | jq '.results[] | .address' | wc -l
10296

Originally created by @pp-007 on GitHub (Jan 28, 2020). Looks like adding ?limit=0 for ip-addresses does not behave as described in the docs (https://netbox.readthedocs.io/en/stable/api/overview/#pagination). Running netbox 2.6.8. Actual result: $ curl -sk -H "Accept: application/json" "https://server/api/ipam/ip-addresses/?limit=0" | jq '.count' 10296 $ curl -sk -H "Accept: application/json" "https://server/api/ipam/ip-addresses/?limit=0" | jq '.results[] | .address' | wc -l 1000 Expected result: $ curl -sk -H "Accept: application/json" "https://server/api/ipam/ip-addresses/?limit=0" | jq '.count' 10296 $ curl -sk -H "Accept: application/json" "https://server/api/ipam/ip-addresses/?limit=0" | jq '.results[] | .address' | wc -l 10296
adam closed this issue 2025-12-29 18:26:54 +01:00
Author
Owner

@jeremystretch commented on GitHub (Jan 28, 2020):

A bit further down in that documentation:

The maximum number of objects that can be returned is limited by the MAX_PAGE_SIZE setting, which is 1000 by default.

You can modify MAX_PAGE_SIZE but use caution when doing so.

In the future, please use one of the provided templates when submitting an issue.

@jeremystretch commented on GitHub (Jan 28, 2020): A bit further down in that documentation: > The maximum number of objects that can be returned is limited by the `MAX_PAGE_SIZE` setting, which is 1000 by default. You can modify [`MAX_PAGE_SIZE`](https://netbox.readthedocs.io/en/stable/configuration/optional-settings/#max_page_size) but use caution when doing so. In the future, please use one of the provided [templates](https://github.com/netbox-community/netbox/issues/new/choose) when submitting an issue.
Author
Owner

@pp-007 commented on GitHub (Jan 28, 2020):

Apologies for not using the template and thanks a lot for such a swift response. I've missed the 'An API consumer can then pass ?limit=0' bit.
Thanks for the great tool and wish you all the best.

@pp-007 commented on GitHub (Jan 28, 2020): Apologies for not using the template and thanks a lot for such a swift response. I've missed the 'An API consumer can **then** pass ?limit=0' bit. Thanks for the great tool and wish you all the best.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#3230