# /townwork/jobs/search

`POST /api/townwork/jobs/search`

Price: 20 credits

Search part-time and casual job postings on townwork (タウンワーク) in one prefecture by keyword, area, city or ward, station, occupation, working conditions, employment type, pay range and distance from a point: title, catch line, employer, photo, access, pay text and structured pay, employment types, location, hours, duties, condition tags, coordinates and publish date

## How to use it

Pass a returned id to townwork/jobs for the full posting and the employer's company id. Pay bounds need salary_type; latitude, longitude and radius_km go together.

## Parameters

- `access-token` (string, required)

## Request body

- `timeout` (integer) — Max scrapping execution timeout (in seconds) (default: 300; min: 20; max: 1500)
- `prefecture` (string, required) — Prefecture (one of: "hokkaidou", "aomori", "iwate", "miyagi", "akita", "yamagata", "fukushima", "ibaraki", "tochigi", "gunma", "saitama", "chiba", "tokyo", "kanagawa", "niigata", "toyama", "ishikawa", "fukui", "yamanashi", "nagano", "gifu", "shizuoka", "aichi", "mie", "shiga", "kyoto", "oosaka", "hyogo", "nara", "wakayama", "tottori", "shimane", "okayama", "hiroshima", "yamaguchi", "tokushima", "kagawa", "ehime", "kouchi", "fukuoka", "saga", "nagasaki", "kumamoto", "ooita", "miyazaki", "kagoshima", "okinawa"; examples: "tokyo", "oosaka")
- `keyword` (string, nullable) — Free-text keyword (examples: "カフェ"; minLength: 1)
- `areas` (array, nullable) — townwork area codes inside the prefecture (examples: ["013001"])
- `sub_areas` (array, nullable) — townwork city or ward codes inside the prefecture (examples: ["013001001"])
- `stations` (array, nullable) — townwork station codes (examples: ["8714"])
- `occupation_groups` (array, nullable) — townwork occupation group codes (examples: ["001"])
- `occupations` (array, nullable) — townwork occupation codes (examples: ["0001"])
- `preferences` (array, nullable) — townwork working-condition codes; all must match (examples: ["0602","0401"])
- `employment_types` (array, nullable) — Employment types (one of: "part_time", "full_time", "contract", "temporary_staff", "outsourcing"; examples: ["part_time"])
- `salary_type` (string, nullable) — Pay basis for the pay bounds (one of: "hourly", "daily", "monthly")
- `min_salary` (integer, nullable) — Minimum pay in yen (examples: 1200)
- `max_salary` (integer, nullable) — Maximum pay in yen (examples: 2000)
- `latitude` (number, nullable) — Latitude of the search centre (examples: 35.6896; min: -90; max: 90)
- `longitude` (number, nullable) — Longitude of the search centre (examples: 139.7006; min: -180; max: 180)
- `radius_km` (string, nullable) — Search radius in km around the centre (one of: "1", "2", "3", "5", "7", "10", "15", "20")
- `sort` (string) — Result order (default: "relevance"; one of: "relevance", "newest")
- `count` (integer, required) — Max number of results (min: 1; max: 3000)

## Response

### 200 — Successful Response

- `@type` (string) (default: "TownworkJobCard")
- `id` (string, required)
- `url` (string, required)
- `subtitle` (string, nullable)
- `employer_name` (string, nullable)
- `image` (string, nullable)
- `access` (string, nullable)
- `salary` (string, nullable)
- `base_pay` (object, nullable)
  - `@type` (string) (default: "TownworkPay")
  - `min` (number, nullable)
  - `max` (number, nullable)
  - `unit` (string, nullable)
  - `currency` (string, nullable)
  - `task_minutes` (integer, nullable)
- `task_pay` (object, nullable)
  - `@type` (string) (default: "TownworkPay")
  - `min` (number, nullable)
  - `max` (number, nullable)
  - `unit` (string, nullable)
  - `currency` (string, nullable)
  - `task_minutes` (integer, nullable)
- `employment_types` (array) (default: [])
- `work_location` (string, nullable)
- `work_hours` (string, nullable)
- `description` (string, nullable)
- `preferences` (array) (default: [])
- `matching_tags` (array) (default: [])
- `latitude` (number, nullable)
- `longitude` (number, nullable)
- `is_remote` (boolean, nullable)
- `is_new` (boolean, nullable)
- `is_sponsored` (boolean, nullable)
- `published_at` (integer, nullable)

## Errors

### 422 — Validation Error

A filter value is malformed or townwork does not know the area, sub-area or station code

What to do: Check the fields against this schema. A URN with the wrong prefix is the most common cause.

- `detail` (array)
  - `loc` (array, required)
  - `msg` (string, required)
  - `type` (string, required)
  - `input` (any)
  - `ctx` (object)

### 408

The request ran past its time limit

What to do: Raise `timeout` in the request body, up to the maximum this endpoint documents. Lowering `count` or turning off the `with_*` flags also helps, because less work finishes sooner.

### 412

The entity was not found, or a precondition failed

What to do: Retrying will not help: either the entity does not exist, or the input points at a different one.

### 429

Too many requests: a rate limit or a usage window is exhausted

What to do: When the response carries an X-Retry-After header, wait that many seconds and retry: the same number is in the body as `detail.retry_after`, and the limit clears once that window passes. The message in the body names the limit that was hit.

### 500

Something broke on our side

What to do: Retrying will not help. If it keeps happening, send us the X-Request-ID from the response headers.

### 529

Rate limit reached, or the endpoint is overloaded

What to do: Wait at least 30 seconds, then retry.

## Response envelope

Success: Array of objects (may be empty if no results)

Error: Error may coexist with partial results if it occurs mid-execution. Check X-Error header and status code.

Every response carries these headers:

- `X-Error` — Error message text (present only on error)
- `X-Request-ID` — Unique request identifier
- `X-Execution-Time` — Execution time in seconds
- `X-Result-Count` — How many records the body carries. 0 means an empty result, which is a normal answer and not by itself an error. A non-zero count can come back together with X-Error when the failure happened partway through — read this header and X-Error independently.
- `X-Total-Available-Results` — How many records exist for this query, when the endpoint can say. On a `dry_run` request this is the answer and the body is empty. It saturates: the endpoint's documented maximum means 'at least that many', any smaller number is exact.
- `X-Warning` — Present when the request body carried keys this endpoint does not document. They were ignored, so any filter you meant to apply through them did not apply. Check the spelling against this schema and retry.
- `X-Retry-After` — Seconds to wait before retrying. Present only on 429.

