# /aws/prices/selectors

`POST /api/aws/prices/selectors`

Price: 5 credits

List every combination of rate term, tenancy, guest operating system, bundled software, licensing arrangement, reserved commitment length, payment option, offering class and instance generation that AWS publishes EC2 prices for in one region, each with the number of rates it covers. Narrows by any of those dimensions.

## How to use it

Use this to find out which rate dimensions actually exist in a region before querying aws/prices/search, and to size an answer: `price_count` is how many rates that exact combination covers. The reserved-only dimensions come back empty on on-demand combinations rather than absent. Combinations differ between regions, so a set that exists in us-east-1 need not exist elsewhere.

## 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 combinations on this rate term. Unset returns both (one of: "OnDemand", "Reserved")
- `tenancy` (string, nullable) — Keep only combinations on this tenancy. Unset returns both (one of: "Dedicated", "Shared")
- `operating_system` (string, nullable) — Keep only combinations 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 combinations bundling this software. Unset returns every bundle (one of: "NA", "SQL Ent", "SQL Std", "SQL Web")
- `license_model` (string, nullable) — Keep only combinations 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 combinations of this commitment length. Unset returns every one (one of: "1yr", "3yr")
- `purchase_option` (string, nullable) — Keep only reserved combinations paid this way. Unset returns every option (one of: "All Upfront", "No Upfront", "Partial Upfront")
- `offering_class` (string, nullable) — Keep only reserved combinations of this class. Unset returns both (one of: "convertible", "standard")
- `current_generation` (boolean, nullable) — True keeps combinations covering current instance generations, false the previous ones. Unset returns both
- `count` (integer, required) — Max number of results to return (min: 1)

## Response

### 200 — Successful Response

- `@type` (string) (default: "AwsPriceSelector")
- `id` (string, required)
- `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_count` (integer) (default: 0)

## 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 combination 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.

