# Job Opportunities API in JavaScript

- Canonical page: https://jobopportunitiesapi.org/integrations/javascript
- Description: Copy-paste JavaScript (Node.js fetch) code for Job Opportunities API (JOA): search jobs with filters, follow next_cursor pagination and read the key from the JOA_API_KEY environment variable. Tested against the live API.
- This is the Markdown version of the page above, generated from the page itself. Links to other pages on this site point to their Markdown versions (addresses ending in .md) where one exists, so you can keep navigating in Markdown; every other link is an absolute address.

[Integrations](https://jobopportunitiesapi.org/integrations.md) JavaScript

Search jobs from Node.js with built-in fetch and cursor pagination.

- Official

[Copy the JavaScript snippet →](#setup) [Get a free key](https://jobopportunitiesapi.org/register)

- [API documentation](https://jobopportunitiesapi.org/docs/ai/index.md)

Node.js 18 or later (built-in fetch) · free key, no card

## Set it up in 3 steps

You need a free API key (no card): [get one here](https://jobopportunitiesapi.org/register).

1. ### Set your key

   Put your free key in an environment variable. Call the API from your server, never from browser code, so the key stays private.

   Shell

   ```
   export JOA_API_KEY=your_key_here
   ```

2. ### Run the snippet

   Save as jobs.mjs and run node jobs.mjs. It fetches up to three pages and prints title, company, location and apply link (tested against the live API on 6 Oct 2026):

   jobs.mjs

   ```
   // Node.js 18+ (built-in fetch). Save as jobs.mjs and run: node jobs.mjs
   const API = "https://api.jobopportunitiesapi.org/v1/jobs";
   const headers = { Authorization: `Bearer ${process.env.JOA_API_KEY}` };
   const params = new URLSearchParams({ country: "DE", q: "engineer", remote: "remote,hybrid", limit: "20" });

   const jobs = [];
   for (let page = 0; page < 3; page++) { // every row returned is metered, so cap the pages
     const res = await fetch(`${API}?${params}`, { headers });
     if (!res.ok) throw new Error(`${res.status}: ${await res.text()}`);
     const body = await res.json();
     jobs.push(...body.data);
     if (!body.has_more || !body.next_cursor) break;
     params.set("cursor", body.next_cursor);
   }

   for (const job of jobs.slice(0, 5)) {
     console.log(job.title, "|", job.company, "|", job.location, "|", job.apply_url);
   }
   ```

3. ### Know the response

   Each page is an object with data, next_cursor and has_more. Fields can be absent; field_sources tells you which ones the employer published and which were inferred.

   Response shape

   ```
   {
     "data": [
       {
         "id": "…", "slug": "…",
         "title": "…", "company": "…", "location": "…", "country": "DE",
         "remote": "remote | hybrid | on_site | not_stated",
         "apply_url": "https://… (the employer's own apply page)",
         "posted_at": "2026-10-05T17:41:41Z",
         "field_sources": { "title": "published", "remote": "inferred", "…": "…" }
       }
     ],
     "next_cursor": "… (pass as ?cursor= for the next page)",
     "has_more": true
   }
   ```

### Example: for job boards

In a Next.js or Astro site, run the fetch in a server route or at build time, cache the page, and link each job's apply button to apply_url.

### Example: for AI agents

Expose the function as a tool in the Vercel AI SDK, LangChain.js or the OpenAI and Anthropic SDKs; the model fills country, q and remote, and your code adds the key server-side.

## Questions

Straight answers about plans, metering and what to show.

**How is usage counted?**

Every job row the API returns counts against your plan's monthly record allowance, exactly as a direct API call would. The free key has a small monthly allowance and needs no card, so start with small page sizes and a daily schedule rather than polling every few minutes. Your key's largest page size is in GET /v1/me (limits.max_page_size).

**Where do I get an API key?**

At jobopportunitiesapi.org/register. The Primary key is free and needs no card. Keep it in your tool's credential store or an environment variable, never in a shared file.

**Where do applicants apply?**

On the employer's own site. Every job carries apply_url, the employer's application page or applicant-tracking-system link. Job Opportunities API never sits between the candidate and the employer, so always use apply_url as the apply button.

**Do I need to show any attribution?**

On the free Explore plan, yes: one line where listings are shown publicly, a visible credit "Data: Job Opportunities API" linking to https://jobopportunitiesapi.org. Paid plans are white label and need no credit to us. (See /terms: storing, displaying, reselling and redistributing within your account's plan limits are all allowed.) On every plan, jobs an employer pushed to us directly carry an attribution field and a canonical_url: when attribution is present, show it with the listing and link to canonical_url.

## Related integrations

[See all integrations](https://jobopportunitiesapi.org/integrations.md)

- ### [Python](https://jobopportunitiesapi.org/integrations/python.md)

  Search jobs from Python with requests and cursor pagination in a few lines.

  - Official

  Copy the snippet

- ### [REST API & OpenAPI](https://jobopportunitiesapi.org/integrations/rest-api.md)

  Call the API from any HTTP client, or import the OpenAPI spec.

  - Official

  Open the API docs

- ### [Pipedream](https://jobopportunitiesapi.org/integrations/pipedream.md)

  Fetch jobs in a Pipedream workflow with one HTTP action or a short Node.js step.

  - Official
  - Open source
  - No code

  Copy the code step

## Get a free API key

No card. The same key works for every integration on this site.

[Get a free key →](https://jobopportunitiesapi.org/register)

---

More machine readable files for this site: https://jobopportunitiesapi.org/llms.txt
