# Your first API request

Search Swiss jobs and follow the source evidence with a few lines of code.

Use the REST API to search Swiss-eligible jobs without an account or API key. REST endpoints return JSON over HTTPS. For MCP, follow the [agent connection guide](https://withpanta.com/docs/mcp/). When building an HTTP client, send a descriptive User-Agent identifying your application and a documentation or contact URL.

```sh
curl --fail --get 'https://withpanta.com/api/v1/jobs' \
  --data-urlencode 'q=software engineer' \
  --data-urlencode 'canton=ZH' \
  --data-urlencode 'limit=5'
```

Use `jobs[].id` to fetch a full description and source listings. IDs are opaque: URL-encode them in paths.

```js
const base = 'https://withpanta.com/api/v1';
const params = new URLSearchParams({
  q: 'nurse',
  canton: 'VD',
  limit: '5',
});
const response = await fetch(base + '/jobs?' + params);
if (!response.ok) {
  throw new Error('Panta returned ' + response.status);
}
const page = await response.json();
for (const job of page.jobs) {
  console.log(job.title, job.company);
  console.log(job.source_url, job.source_freshness);
}
if (page.jobs[0]) {
  const id = encodeURIComponent(page.jobs[0].id);
  const detail = await fetch(base + '/jobs/' + id);
  if (!detail.ok) {
    throw new Error('Panta returned ' + detail.status);
  }
  console.log(await detail.json());
}
```

[Run the example search](https://withpanta.com/api/v1/jobs?q=software%20engineer&canton=ZH&limit=5) or [download the OpenAPI contract](https://withpanta.com/api/v1/openapi.json).
