# Search the index of job postings

> Searches Spicrawl's index of job postings in one synchronous call.

Source: https://docs.spicrawl.com/api-reference/jobs/jobs-search

## POST /v1/jobs/search

Operation ID: `jobsSearch`. API key scope: `scrape`.

Searches Spicrawl's index of job postings in one synchronous call. The index is crawled from
company job boards on Greenhouse, Lever, Ashby, Workable, SmartRecruiters, Recruitee, Breezy, Pinpoint,
Personio and Workday, from Y Combinator's job board, and from Wellfound's role listing pages (the newest postings on a set of them, not the whole site), and refreshed
about every 6 hours. The request reads the index; it does not fetch the boards.
Evergreen catch-all listings ("Join our Talent Community", "General application") are not indexed.

Results are ordered newest first, one page per call; pass `next_cursor` back as `cursor` for the next.
By default only open postings are returned (`status: open`). `status: closed` or `status: any` also
returns postings that left their board. A posting that leaves its board is marked `closed` and kept
for 30 days, then removed. `closed_at` is when the crawler noticed, up to one crawl interval after it
actually closed.

Filters: `seniority`, `employment_type`, `skills` (every listed skill must match), `language`, `country`,
`salary_min` with `salary_currency`, and `workplace`. Each one narrows results. `seniority` is read from
the job title, so most postings are `unknown`. `skills` are matched against a fixed vocabulary; a posting
whose description is not available only has skills found in its title. `salary_min` compares yearly
amounts within one currency and does not convert between currencies.

`include_description: true` adds each posting's plain text (capped at 20,000 characters) as `description`.
It makes responses much larger.

`visa_sponsorship` is `yes`, `no` or `unknown`. `visa_source` is `listed` when the platform publishes
it (YC, Wellfound) and `inferred` when read from the description text (the company job-board platforms); inferred values
can be wrong. `visa_sponsorship: true` narrows results a lot, because most postings are `unknown`.

Billing: 2 credits per request, including one that returns no results; 0 when billing is off. A failed
request costs 0. The price does not depend on `limit`. Subject to the key's normal rate limit.

With `find_contacts: true` the request also costs 5 credits for each posting that gets contacts; a posting
that already names people, or for which nothing is found, costs nothing extra, and a cached lookup costs
the same as a fresh one. The organization must have room for 2 + 5 × `limit` when the request starts.
`find_contacts` caps `limit` at 10 and can take up to about 30 seconds.

Unknown fields are a `400`. A search with a blank or missing `title` and no other filter is `400 ERR::REQUEST::MISSING_PARAMETER`; every
other invalid value is `400 ERR::REQUEST::INVALID_PARAMETER`, including an unknown skill, which the detail names.

Daily allowance: a workspace may run 5 searches per day (`SPICRAWL_JOBS_DAILY_LIMIT` on a self-hosted
deployment; 0 is unlimited). The day resets at 12:00 AM IST (18:30 UTC). Requests that pass validation
count; a `400`, a per-key rate-limit `429`, a `5xx` on our side and a `402` do not use one. Past the
allowance the request is refused with `429 ERR::LIMIT::DAILY_LIMIT_EXCEEDED`, which is not retryable
before the reset. The `X-Jobs-Daily-Limit`, `X-Jobs-Daily-Remaining` and `X-Jobs-Daily-Reset` headers
report the allowance on success and on that `429`.

### Example

```bash
curl -X POST "https://api.spicrawl.com/v1/jobs/search" \
  -H "Authorization: Bearer $SPICRAWL_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"title":"backend engineer -senior","posted_within":"7d","region":"Berlin","workplace":["remote","hybrid"],"platforms":["greenhouse","ashby"],"limit":25}'
```

### Request body

`application/json`, required.

| Field | Type | Required | Description |
|---|---|---|---|
| `title` | string | no | Words to match in the job title. Web-search syntax: `backend engineer` matches both words, `"staff engineer"` a phrase, `engineer -senior` excludes a word, `ml or "machine learning"` matches either. Optional: a blank title is treated as absent. Without a title, the request must carry at least one filter (`posted_within`, `region`, `country`, `workplace`, `visa_sponsorship: true`, `platforms`, `seniority`, `employment_type`, `skills`, `language` or `salary_min`), or it is a `400` with `ERR::REQUEST::MISSING_PARAMETER`. |
| `posted_within` | string | no | Only postings first seen within this window, as hours (`1h` to `72h`) or days (`1d` to `30d`). Omitted means any age. Results are only as fresh as the crawl: boards are re-read about every 6 hours, so a posting from the last hour may not be indexed yet. |
| `region` | string | no | A country name or code, or a city. Matched case-insensitively against the posting's location text and its country. |
| `workplace` | array of string: `remote`, `hybrid`, `onsite` | no |  |
| `visa_sponsorship` | boolean | no | `true` returns only postings known to sponsor. Most postings are `unknown`, so this narrows results a lot. |
| `platforms` | array of string: `greenhouse`, `lever`, `ashby`, `yc`, `wellfound`, `techtree`, `reddit`, `workable`, `smartrecruiters`, `recruitee`, `breezy`, `pinpoint`, `personio`, `workday` | no | Omitted or empty means all platforms. |
| `limit` | integer; default `25` | no | With find_contacts set to true, the maximum is 10 and the default is 10. A larger value is a `400`. |
| `cursor` | string | no | The `next_cursor` from the previous page, passed back verbatim. |
| `find_contacts` | boolean; default `false` | no | Look up company-level contacts for postings that name none: Y Combinator founders, and names from a company's own team or about page. Adds `contacts_found` to the response, caps `limit` at 10, and costs 5 credits per posting that gets contacts. Can take up to about 30 seconds. Returns names and roles only, never email addresses or phone numbers. A `400` on a deployment without contact lookup. |
| `seniority` | array of string: `intern`, `entry`, `mid`, `senior`, `lead`, `executive` | no | Any of the listed levels. Read from the job title only, and most titles carry no level, so most postings are `unknown` and this filter narrows results a lot. |
| `employment_type` | array of string: `full_time`, `part_time`, `contract`, `internship`, `temporary` | no | Any of the listed types. Taken from the platform's field where it has one (English, German, Dutch, French and Spanish values are understood), otherwise from an unambiguous title tag such as an internship word or `(Contract)`. |
| `skills` | array of string | no | Every skill listed must match. An empty array is the same as omitting the field. Aliases are accepted (`golang` is `go`, `k8s` is `kubernetes`, `postgres` is `postgresql`). An unknown skill is a `400` that names it. Matched against a fixed vocabulary in the title and description; a posting whose description is not available only has skills found in its title. |
| `language` | string | no | ISO 639-1 code of the language the posting is written in, such as `en`. Matched case-insensitively. Detected from the posting text. An empty string is the same as omitting the field. |
| `country` | string | no | ISO 3166-1 alpha-2 code, such as `DE`. Matched case-insensitively. An empty string is the same as omitting the field. Matches the platform's country field or the location text. Independent of `region`, which is a substring match on the location. |
| `salary_min` | number | no | A yearly amount. Returns postings whose published yearly salary, in `salary_currency`, reaches it. No exchange-rate conversion. Hourly and monthly salaries are converted to a year at 2080 hours and 12 months. Postings that publish no salary never match. |
| `salary_currency` | string | no | ISO 4217 code, upper-cased. Defaults to `USD` when `salary_min` is set. A `400` when given without `salary_min`. |
| `status` | string: `open`, `closed`, `any`; default `"open"` | no | `open` returns open postings only, which is the default. `closed` returns postings that left their board and are kept for 30 days. `any` returns both. |
| `include_description` | boolean; default `false` | no | Adds `description`, the posting's plain text capped at 20,000 characters, to each job. Responses become much larger. |

Example `backendRemoteOrHybrid`: Recent backend roles, remote or hybrid

```json
{
  "title": "backend engineer -senior",
  "posted_within": "7d",
  "region": "Berlin",
  "workplace": [
    "remote",
    "hybrid"
  ],
  "platforms": [
    "greenhouse",
    "ashby"
  ],
  "limit": 25
}
```

Example `seniorRemoteWithSalary`: Senior Go roles, remote, at least 120k USD a year

```json
{
  "title": "engineer",
  "workplace": [
    "remote"
  ],
  "seniority": [
    "senior",
    "lead"
  ],
  "skills": [
    "go",
    "postgresql"
  ],
  "salary_min": 120000,
  "salary_currency": "USD"
}
```

### Responses

#### 200

One page of postings, newest first.

Headers: `X-Request-Id`, `X-Jobs-Daily-Limit`, `X-Jobs-Daily-Remaining`, `X-Jobs-Daily-Reset`.

`application/json`.

| Field | Type | Required | Description |
|---|---|---|---|
| `jobs` | array of object (`JobPosting`) | yes | Newest first. |
| `next_cursor` | string | no | Pass it back as `cursor` to read the next page. |
| `credits_used` | integer | yes | Credits charged for this request. 2, or 0 when billing is off. With `find_contacts`, add 5 for each posting that got contacts. |
| `contacts_found` | integer | no | Number of postings that got at least one contact from the `find_contacts` lookup. Present only when `find_contacts` was `true`. |

#### 400

The request is invalid. Not retryable; fix the request using `code` and `diagnostics.hint`.

Headers: `X-Request-Id`.

`application/problem+json` (`Problem` schema).

#### 401

Missing, invalid, revoked or expired key. Not retryable with the same key.

Headers: `X-Request-Id`.

`application/problem+json` (`Problem` schema).

#### 402

`ERR::LIMIT::QUOTA_EXCEEDED`: the organization is out of credits. Not retryable until credits are added. For a partner workspace the message says its free credits are used, with the date they return; once the partner's balance or the workspace's own balance has been funded and is exhausted, it says the provider's balance is exhausted and the partner must add balance.

Headers: `X-Request-Id`, `X-Credits-Remaining`.

`application/problem+json` (`Problem` schema).

#### 403

The key lacks the scope this route requires (`ERR::AUTH::INSUFFICIENT_SCOPE`), or the action is not permitted.

Headers: `X-Request-Id`.

`application/problem+json` (`Problem` schema).

#### 413

The request body exceeds the size limit.

Headers: `X-Request-Id`.

`application/problem+json` (`Problem` schema).

#### 429

Either the per-key rate limit was reached (`ERR::LIMIT::RATE_LIMITED`, retryable after `Retry-After`),
or the workspace's daily allowance is used up (`ERR::LIMIT::DAILY_LIMIT_EXCEEDED`, not retryable
before the reset that `Retry-After` gives). Neither is charged.

Headers: `Retry-After`, `X-RateLimit-Limit`, `X-RateLimit-Remaining`, `X-RateLimit-Reset`, `X-Jobs-Daily-Limit`, `X-Jobs-Daily-Remaining`, `X-Jobs-Daily-Reset`, `X-Request-Id`.

`application/problem+json` (`Problem` schema).

#### 500

Internal error. Retryable when `retryable` is true.

Headers: `X-Request-Id`.

`application/problem+json` (`Problem` schema).

#### 503

No proxy exit or engine capacity was available. Retryable after `Retry-After`; 0 credits.

Headers: `Retry-After`, `X-Request-Id`.

`application/problem+json` (`Problem` schema).

Full OpenAPI spec: https://docs.spicrawl.com/openapi.yaml
