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
  }
}
FieldDescription
totalExact number of jobs matching your filters. Only present when you pass includeTotal=true, because counting them is slow
countJobs in this response
nextCursorPass this to get the next page
hasMorefalse when you've reached the end

The Pattern

  1. Make a request (without cursor for the first page)
  2. Process the jobs in data
  3. If hasMore is true, make another request with cursor set to nextCursor
  4. Repeat until hasMore is false

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-After header duration before retrying.
  • Add error handling - The examples above are minimal. Add retry logic and error handling appropriate to your application.

Next Steps

Filter Jobs

Combine pagination with filters to fetch exactly what you need.

Jobs API Reference

Full API reference with all available parameters.