Skip to main content

Pagination

List endpoints return paginated results. Use page and limit parameters to navigate.

Parameters

ParameterTypeDefaultMax
pageinteger1-
limitinteger20100

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
}
}
FieldDescription
totalTotal records across all pages
pageCurrent page number (1-indexed)
limitItems per page (max 100)
total_pagesTotal 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_pages before requesting beyond available data