# /enabavki/contracts/search

`POST /api/enabavki/contracts/search`

Price: 10 credits

Search North Macedonia public procurement contracts on e-nabavki.gov.mk by subject, procedure number, supplier registration number, beneficial owner, contract type, procedure, award criterion, publication and signature dates and termination, in the current records or one archive year from 2008 to 2022. Returns the contract with buyer, supplier, estimated and contract price, newest first.

## How to use it

The current records start in 2023; set `archive_year` for older contracts. Pass `id` to enabavki/contracts for the award notification with lots, bidders, beneficial owners and contract files.

## Parameters

- `access-token` (string, required)

## Request body

- `timeout` (integer) — Max scrapping execution timeout (in seconds) (default: 300; min: 20; max: 1500)
- `subject` (string, nullable) — Words in the subject (examples: "гориво"; minLength: 1)
- `process_number` (string, nullable) — Procedure number (examples: "14082/2026"; minLength: 1)
- `vendor_registration_number` (string, nullable) — Supplier registration number (ЕМБС) (examples: "4067037"; minLength: 1)
- `beneficial_owner_name` (string, nullable) — Full name of a supplier's beneficial owner (examples: "БРАНИСЛАВ ДИМИТРИЈЕВИЌ")
- `beneficial_owner_stage` (string, nullable) — Beneficial ownership disclosure state of the supplier (one of: "before_disclosure_rules", "no_information", "consent_not_given", "has_beneficial_owner", "consent_given_no_information")
- `contract_type` (string, nullable) — Goods, services or works (one of: "goods", "services", "works")
- `procedure_type` (string, nullable) — Procurement procedure (one of: "open", "restricted", "negotiated_with_notice", "competitive_dialogue", "request_for_proposal", "design_contest", "negotiated_without_notice", "qualification_system", "low_value", "simplified_open", "competitive_negotiation", "innovation_partnership", "special_services")
- `offer_type` (string, nullable) — Award criterion (one of: "lowest_price", "best_value")
- `only_terminated` (boolean) — Only terminated contracts (default: false)
- `date_from` (string, nullable) — Published on or after (format: date; examples: "2026-09-01")
- `date_to` (string, nullable) — Published on or before (format: date; examples: "2026-09-10")
- `signed_from` (string, nullable) — Signed on or after (format: date; examples: "2026-09-01")
- `signed_to` (string, nullable) — Signed on or before (format: date; examples: "2026-09-10")
- `archive_year` (integer, nullable) — Archive year to search instead of the current records (examples: 2019; min: 2008; max: 2022)
- `offset` (integer) — Rows to skip (default: 0; min: 0)
- `count` (integer, required) — Max number of contracts to return (min: 1; max: 2000)

## Response

### 200 — Successful Response

- `@type` (string) (default: "EnabavkiContractSummary")
- `id` (string, required)
- `definition_id` (string, nullable)
- `process_number` (string, nullable)
- `buyer_name` (string, nullable)
- `subject` (string, nullable)
- `contract_type` (string, nullable) (one of: "goods", "services", "works")
- `procedure_type_id` (string, nullable)
- `vendor_name` (string, nullable)
- `vendor_registration_number` (string, nullable)
- `person_in_charge` (string, nullable)
- `contract_date` (string, nullable)
- `published_at` (integer, nullable)
- `estimated_price` (number, nullable)
- `contract_price` (number, nullable)
- `offer_type_id` (string, nullable)
- `framework_type` (string, nullable)
- `is_terminated` (boolean, nullable)
- `is_divided` (boolean, nullable)
- `is_price_only` (boolean, nullable)
- `is_small_procurement` (boolean, nullable)
- `has_electronic_auction` (boolean, nullable)
- `uses_electronic_tools` (boolean, nullable)
- `has_notice` (boolean, nullable)
- `is_complained` (boolean, nullable)

## Errors

### 422 — Validation Error

A date is not YYYY-MM-DD, a range is inverted, the archive year is outside 2008-2022, or the portal rejected the filter values

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.

