Pagination
List endpoints return paginated results. Use page and limit parameters to navigate.
Parameters
| Parameter | Type | Default | Max |
|---|---|---|---|
page | integer | 1 | - |
limit | integer | 20 | 100 |
Response Format
All list endpoints return data in a data array with pagination info in meta:
{
"data": [
{ "id": 1, "title": "Software Engineer", ... },
{ "id": 2, "title": "Product Manager", ... }
],
"meta": {
"timestamp": "2025-01-15T10:30:00Z",
"request_id": "req_abc123",
"total": 87,
"page": 1,
"limit": 20,
"total_pages": 5
}
}
| Field | Description |
|---|---|
total | Total records across all pages |
page | Current page number (1-indexed) |
limit | Items per page (max 100) |
total_pages | Total pages available |
Fetching Pages
# First page (default)
curl "https://api.kula.ai/v1/job-boards/job-posts"
# Specific page with custom limit
curl "https://api.kula.ai/v1/job-boards/job-posts?page=2&limit=50"
Fetching All Pages
async function fetchAllPages(token) {
const allItems = [];
let page = 1;
let hasMore = true;
while (hasMore) {
const response = await fetch(
`https://api.kula.ai/v1/job-boards/job-posts?page=${page}`,
{ headers: { 'Authorization': `Bearer ${token}` } }
);
const result = await response.json();
allItems.push(...result.data);
hasMore = page < result.meta.total_pages;
page++;
}
return allItems;
}
Best Practices
- Request only the pages you need
- Use larger page sizes (50-100) to reduce API calls
- Cache frequently accessed pages
- Check
total_pagesbefore requesting beyond available data