# /aws/prices/search

`POST /api/aws/prices/search`

Price: 20 credits

Search published EC2 rates in one AWS region. Every rate carries its price and unit alongside the instance type it belongs to and that type's vCPU count, memory, storage, network performance and physical processor. Narrows by on-demand against reserved, tenancy, guest operating system, bundled software, licensing arrangement, reserved commitment length, payment option and offering class, by current against previous instance generations, and by instance type, family, workload category and vCPU or memory bounds.

## How to use it

Rates are published per region and this endpoint answers for one at a time; pass the region code from aws/regions. Leaving a rate dimension unset widens the answer rather than picking a default, so an unconstrained call returns Linux and Windows, shared and dedicated, on-demand and reserved rates together — constrain `term_type`, `operating_system` and `tenancy` when you want one comparable set. Reserved rates arrive as two rows per commitment, one in `Quantity` for the upfront amount and one in `Hrs` for the recurring rate, so read `unit` before summing. `current_generation` unset also brings back the previous-generation types, which are absent from most instance listings. Spot prices are not part of this catalogue.

## Parameters

- `access-token` (string, required)

## Request body

- `timeout` (integer) — Max scrapping execution timeout (in seconds) (default: 300; min: 20; max: 1500)
- `region` (string, required) — AWS region, given either as the region code or as the display name aws/regions returns (examples: "us-east-1", "eu-west-1", "US East (Ohio)"; minLength: 1)
- `term_type` (string, nullable) — Keep only on-demand or only reserved rates. Unset returns both (one of: "OnDemand", "Reserved")
- `tenancy` (string, nullable) — Keep only shared or only dedicated tenancy. Unset returns both (one of: "Dedicated", "Shared")
- `operating_system` (string, nullable) — Keep only rates for this guest operating system. Unset returns every one (one of: "Linux", "RHEL", "Red Hat Enterprise Linux with HA", "SUSE", "Ubuntu Pro", "Windows")
- `pre_installed_software` (string, nullable) — Keep only rates that bundle this software with the instance. Unset returns every bundle, including the plain instance (one of: "NA", "SQL Ent", "SQL Std", "SQL Web")
- `license_model` (string, nullable) — Keep only rates on this licensing arrangement. Unset returns every one (one of: "Bring your own license", "License Included - Infrastructure", "No License required")
- `lease_contract_length` (string, nullable) — Keep only reserved rates on a commitment of this length. Unset returns every length and the on-demand rates, which have none (one of: "1yr", "3yr")
- `purchase_option` (string, nullable) — Keep only reserved rates paid this way. Unset returns every option and the on-demand rates, which have none (one of: "All Upfront", "No Upfront", "Partial Upfront")
- `offering_class` (string, nullable) — Keep only reserved rates of this class. Unset returns both classes and the on-demand rates, which have none (one of: "convertible", "standard")
- `current_generation` (boolean, nullable) — True keeps rates for instance types AWS still lists as current, false keeps the previous generations. Unset returns both
- `instance_types` (array, nullable) — Keep only rates for these instance types, matched exactly (examples: ["m5.xlarge","g5.2xlarge"])
- `instance_family` (string, nullable) — Keep only rates for instance types in this family, the part of the name before the dot (examples: "m5", "c7g"; minLength: 1)
- `instance_category` (string, nullable) — Keep only rates whose workload category matches, case-insensitively (examples: "General purpose", "GPU instance"; minLength: 1)
- `min_vcpu` (integer, nullable) — Keep only instance types with at least this many vCPUs (min: 1)
- `max_vcpu` (integer, nullable) — Keep only instance types with at most this many vCPUs (min: 1)
- `min_memory_gib` (number, nullable) — Keep only instance types with at least this much memory, in GiB (>: 0)
- `max_memory_gib` (number, nullable) — Keep only instance types with at most this much memory, in GiB (>: 0)
- `count` (integer, required) — Max number of results to return (min: 1; max: 100000)

## Response

### 200 — Successful Response

- `@type` (string) (default: "AwsPrice")
- `id` (string, required)
- `instance_type` (string, required)
- `instance_category` (string, nullable)
- `location` (string, nullable)
- `region_code` (string, nullable)
- `term_type` (string, nullable)
- `tenancy` (string, nullable)
- `operating_system` (string, nullable)
- `pre_installed_software` (string, nullable)
- `license_model` (string, nullable)
- `lease_contract_length` (string, nullable)
- `purchase_option` (string, nullable)
- `offering_class` (string, nullable)
- `is_current_generation` (boolean, nullable)
- `price` (number, nullable)
- `currency` (string, nullable)
- `unit` (string, nullable)
- `vcpu` (integer, nullable)
- `ecu` (string, nullable)
- `memory` (string, nullable)
- `memory_gib` (number, nullable)
- `storage` (string, nullable)
- `network_performance` (string, nullable)
- `physical_processor` (string, nullable)
- `published_at` (string, nullable)

## 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 region is not in the AWS location catalogue, or no published rate matched the filters.

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.

