All list endpoints in the RxScale APIs support pagination through query parameters.
Query Parameters
| Parameter | Type | Default | Description |
|---|
page | integer | 0 | Page number (zero-indexed) |
limit | integer | 50 | Number of items per page |
Pages are zero-indexed. The first page is page=0, not page=1.
Paginated endpoints return:
{
"data": [...],
"totalRegistries": 150,
"totalPages": 3
}
data — Array of items for the current page
totalRegistries — Total number of items across all pages
totalPages — Total number of pages (calculated as ceil(totalRegistries / limit))
Limits
| API | Default Limit | Maximum Limit |
|---|
| External Pharmacy API | 50 | 200 |
| Management API | 50 | 200 |
| Public API (Products) | 50 | 150 |
Requesting a limit above the maximum will be capped to the maximum.
Example
Fetching the second page of 25 products:
curl -X GET "https://api.rxscale.com/v1/management/products?page=1&limit=25" \
-H "X-API-Key: your-api-key"
Response:
{
"data": [
{"uid": "prod_abc", "name": "Product 26"},
{"uid": "prod_def", "name": "Product 27"}
],
"totalRegistries": 75,
"totalPages": 3
}
Iterating Through All Pages
import requests
page = 0
all_items = []
while True:
response = requests.get(
"https://api.rxscale.com/v1/management/products",
headers={"X-API-Key": "your-api-key"},
params={"page": page, "limit": 50}
)
data = response.json()
all_items.extend(data["data"])
if page >= data["totalPages"] - 1:
break
page += 1
Use the smallest limit that makes sense for your use case. Smaller pages mean faster responses and less memory usage.