# /twpcc/tenders/search

`POST /api/twpcc/tenders/search`

Price: 20 credits

Search Taiwan government tender notices by announcement date window, tendering method, category, tender name, case number, agency and trade-agreement coverage. Each row is the notice's id, case number, name, agency, method, category, announcement date, bid deadline and budget.

## How to use it

The date window spans at most 184 days and may be omitted only with `case_number`. Rows run newest announcement first; `is_correction` marks a corrected notice. Pass a row's `id` to twpcc/tenders for the full notice.

## Parameters

- `access-token` (string, required)

## Request body

- `timeout` (integer) — Max scrapping execution timeout (in seconds) (default: 300; min: 20; max: 1500)
- `start_date` (string, nullable) — First announcement day of the window (format: date; examples: "2026-09-19")
- `end_date` (string, nullable) — Last announcement day of the window (format: date; examples: "2026-09-25")
- `tender_method` (string, nullable) — Tendering method (one of: "open", "open_electronic_quotation", "open_quotation_or_proposal", "restricted_after_open_evaluation", "selective_qualified_list", "selective_qualified_list_invitation", "selective_single_case", "electronic_auction", "restricted")
- `category` (string, nullable) — Procurement category (one of: "works", "goods", "services")
- `keyword` (string, nullable) — Words in the tender name (examples: "工程"; minLength: 1)
- `case_number` (string, nullable) — Tender case number (examples: "dsp1150901"; minLength: 1)
- `org_id` (string, nullable) — Procuring agency code (examples: "3.97.8.7"; minLength: 1)
- `org_name` (string, nullable) — Procuring agency name (examples: "國立虎尾科技大學"; minLength: 1)
- `gpa` (boolean) — Only tenders covered by the WTO Government Procurement Agreement (default: false)
- `anztec` (boolean) — Only tenders covered by the Taiwan-New Zealand agreement (default: false)
- `astep` (boolean) — Only tenders covered by the Taiwan-Singapore agreement (default: false)
- `policy_advocacy` (boolean, nullable) — Policy and public-information campaigns only, or none of them
- `count` (integer, required) — Max number of notices to return (min: 1; max: 5000)

## Response

### 200 — Successful Response

- `@type` (string) (default: "TwpccTenderListing")
- `id` (string, required)
- `case_number` (string, nullable)
- `is_correction` (boolean) (default: false)
- `org_name` (string, nullable)
- `transmission_number` (string, nullable)
- `tender_method` (string, nullable)
- `category` (string, nullable)
- `announced_date` (string, nullable)
- `deadline_date` (string, nullable)
- `budget_amount` (number, nullable)
- `currency` (string, nullable)
- `url` (string, required)

## Errors

### 422 — Validation Error

The request body did not validate

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.

