> ## Documentation Index
> Fetch the complete documentation index at: https://docs.letsfind.work/llms.txt
> Use this file to discover all available pages before exploring further.

# Paging

> Read long result lists one page at a time with a cursor.

`GET /v1/jobs` and `GET /v1/companies` return one page at a time, with a `next` cursor.

| Param | What it does |
| - | - |
| `limit` | Results per page, 1 to 100. Default 20. |
| `cursor` | The `next` value from the page before. Leave it out for the first page. |

## Read every page

1. Send your request without `cursor`.
2. If `next` is not `null`, send the same request again with `cursor` set to `next`.
3. Stop when `next` is `null`.

```js theme={null}
let cursor = null
do {
  const url = new URL("/v1/jobs", process.env.BASE_URL)
  url.searchParams.set("q", "electrician")
  url.searchParams.set("limit", "100")
  if (cursor) url.searchParams.set("cursor", cursor)
  const res = await fetch(url, { headers: { Authorization: `Bearer ${process.env.API_KEY}` } })
  const page = await res.json()
  for (const job of page.jobs) console.log(job.title, job.company)
  cursor = page.next
} while (cursor)
```

## Good to know

* Keep every other param the same while you page. Only `cursor` changes.
* A cursor is not a page number. Do not build or change one; send it back as you got it. A cursor we did not make gets `400`.
* Cursors keep working when new jobs arrive: with `sort=newest`, new jobs go before your first page, so you never see a job twice in one pass.
* A job that closes while you page leaves the results. The pages after it do not shift, so you skip no job.
* Only the last page can have fewer jobs than `limit`. Still, stop on `next` being `null`, not on a short page.

To keep a copy in sync without reading every page again, use the [change feed](https://docs.letsfind.work/changes.md): new, changed and closed jobs in order.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.