Skip to main content

Pagination

All list endpoints that return potentially large collections support offset-based pagination via query parameters.

Query Parameters

ParameterTypeDefaultMaxDescription
pageinteger1--The page number to retrieve (1-indexed).
per_pageinteger10100The number of items per page.

Response Format

Paginated responses wrap the data array with a meta object containing pagination metadata:

{
"data": [
{ "id": "...", "name": "..." },
{ "id": "...", "name": "..." }
],
"meta": {
"page": 1,
"per_page": 10,
"total": 42,
"total_pages": 5
}
}

PaginationMeta Fields

FieldTypeDescription
pageintegerThe current page number.
per_pageintegerThe number of items per page.
totalintegerThe total number of items across all pages.
total_pagesintegerThe total number of pages.

Example

Fetch the second page of blogs with 5 items per page:

curl -H "X-API-Key: oy_live_abc123..." \
"https://your-domain.com/api/v1/sites/{site_id}/blogs?page=2&per_page=5"

Response:

{
"data": [
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"slug": "getting-started-with-rust",
"author": "John Doe",
"status": "Published",
"created_at": "2025-01-15T12:00:00Z"
}
],
"meta": {
"page": 2,
"per_page": 5,
"total": 12,
"total_pages": 3
}
}

Notes

  • Requesting a page beyond total_pages returns an empty data array.
  • Some endpoints use different default per_page values (e.g., notifications default to 20, skills default to 25). Check the endpoint documentation for specifics.
  • A few endpoints (e.g., featured blogs, API key usage) use limit/offset directly instead of page/per_page.