Skip to content

Pagination

The SKUs endpoint is the only paginated endpoint in the Prediko API. All other endpoints (Orders, Suppliers, Locations) return complete result sets.

Endpoint Method Pagination
/api/v1/skus POST ✅ Yes
/api/v1/orders GET ❌ No (returns all)
/api/v1/suppliers GET ❌ No (returns all)
/api/v1/warehouses GET ❌ No (returns all)

The SKUs endpoint accepts these pagination parameters:

Parameter Type Default Max Description
limit integer 1000 5000 Number of results per page
offset integer 0 - Number of results to skip

The SKUs endpoint returns a pagination object with metadata:

{
"data": [...],
"pagination": {
"total": 1250,
"limit": 100,
"offset": 0,
"has_more": true
}
}
Field Description
total Total number of SKUs available
limit Number of SKUs returned in this page
offset Number of SKUs skipped
has_more Whether more SKUs exist after this page
import requests
def get_all_skus(api_key):
all_skus = []
offset = 0
limit = 1000 # Use default limit for efficiency
while True:
response = requests.post(
"https://api.prediko.io/api/v1/skus",
headers={
"Authorization": f"Bearer {api_key}",
"Content-Type": "application/json"
},
params={"limit": limit, "offset": offset},
json={}
)
data = response.json()
all_skus.extend(data["data"])
if not data["pagination"]["has_more"]:
break
offset += limit
return all_skus
# Usage
skus = get_all_skus("YOUR_API_KEY")
print(f"Total SKUs: {len(skus)}")
  1. Use the default limit - 1000 records per page is efficient for most use cases
  2. Check has_more - Always check this field before making another request
  3. Handle empty results - The first page may be empty if no SKUs match your filters
  4. Use filters - Reduce result sets with filters like name_like or with_material