Skip to content

Pagination

Endpoints that return large result sets support offset-based pagination using limit and offset query parameters. All paginated responses share the same shape.

Every paginated endpoint returns:

{
"results": [...],
"total": 42,
"limit": 20,
"offset": 0
}
FieldTypeDescription
resultsarrayItems for the current page
totalintegerTotal number of items (before pagination)
limitintegerMaximum items per page
offsetintegerNumber of items skipped

Some endpoints include additional fields alongside the pagination (e.g., query, country, processing_time_ms).

ParameterTypeDefaultDescription
limitintegervariesMaximum number of items to return
offsetinteger0Number of items to skip
EndpointDefault limitMax limit
GET /v1/search20100
GET /v1/rankings50200
GET /v1/trending20100
GET /v1/collections/{slug}50200
const PAGE_SIZE = 20;
let offset = 0;
let allResults = [];
while (true) {
const res = await fetch(
`https://api.popcorntime.app/v1/search?q=action&country=US&limit=${PAGE_SIZE}&offset=${offset}`,
{ headers: { Authorization: "Bearer YOUR_API_KEY" } }
);
const data = await res.json();
allResults.push(...data.results);
if (allResults.length >= data.total || data.results.length < PAGE_SIZE) {
break; // No more pages
}
offset += PAGE_SIZE;
}

These endpoints return all results in a single response:

EndpointTypical size
GET /v1/providers~50-200 per country
GET /v1/featured~10-20 items
GET /v1/collections~5-20 per country (list only)
GET /v1/media/{id}/links~10-50 links
GET /v1/media/{id}/seasons~1-20 seasons
GET /v1/media/{id}/seasons/{season}/episodes~5-25 episodes
GET /v1/locales~30 languages

Use the q parameter on /v1/providers to filter results if the full list is too large.