How to Fetch All Jobs
Learn how to page through the Jobs API to retrieve all matching results.
The Jobs API returns results in pages. Each response includes a cursor you can use to fetch the next page.
Response Structure
Every response includes pagination info in the meta object:
{
"data": [...],
"meta": {
"count": 100,
"nextCursor": "eyJpZCI6ImFiYzEyMyJ9",
"hasMore": true
}
}
| Field | Description |
|---|---|
total | Exact number of jobs matching your filters. Only present when you pass includeTotal=true, because counting them is slow |
count | Jobs in this response |
nextCursor | Pass this to get the next page |
hasMore | false when you've reached the end |
The Pattern
- Make a request (without cursor for the first page)
- Process the jobs in
data - If
hasMoreistrue, make another request withcursorset tonextCursor - Repeat until
hasMoreisfalse
Examples
JavaScript
async function fetchAllJobs(filters = {}) {
const jobs = [];
let cursor = null;
do {
const params = new URLSearchParams({ ...filters, limit: '100' });
if (cursor) params.set('cursor', cursor);
const response = await fetch(
`https://api.jobven.com/v1/public/jobs?${params}`,
{ headers: { 'X-API-Key': process.env.JOBVEN_API_KEY } }
);
const { data, meta } = await response.json();
jobs.push(...data);
cursor = meta.nextCursor;
} while (cursor);
return jobs;
}
// Usage
const remoteJobs = await fetchAllJobs({ 'remoteType[]': 'remote' });
Python
import os
import requests
def fetch_all_jobs(filters=None):
jobs = []
cursor = None
filters = filters or {}
while True:
params = {**filters, 'limit': 100}
if cursor:
params['cursor'] = cursor
response = requests.get(
'https://api.jobven.com/v1/public/jobs',
headers={'X-API-Key': os.environ['JOBVEN_API_KEY']},
params=params
)
response.raise_for_status()
data = response.json()
jobs.extend(data['data'])
cursor = data['meta'].get('nextCursor')
if not cursor:
break
return jobs
# Usage
remote_jobs = fetch_all_jobs({'remoteType[]': 'remote'})
Tips
- Use the maximum limit - Fewer requests means faster fetching. Check your plan limits.
- Handle rate limits - If you hit rate limits, wait for the
Retry-Afterheader duration before retrying. - Add error handling - The examples above are minimal. Add retry logic and error handling appropriate to your application.