# /dnsshop/products

`POST /api/dnsshop/products`

Price: 1 credit

Return one DNS (dns-shop.ru) product for a named Russian city by product URL, 16-hex url id, guid or numeric product code: name, brand, price in roubles, availability, loyalty bonus, the full specification sheet grouped as DNS groups it, the marketing description, the manufacturer country, the warranty term, product images, the aggregate rating with its review count and the review DNS features at the top of the page. Optionally also the colour and memory siblings of the same model.

## How to use it

All four input forms resolve to the same product. The guid cannot be derived from the url id, so keep the guid this endpoint returns if you plan to come back. The slug inside a product URL is decorative and any value resolves. `city` changes the answer: DNS prices the same product differently by city, and the record echoes the city it was priced in. `characteristics` is the full specification sheet as DNS groups it, so read it for anything the flat fields do not carry. There is no previous price, discount amount or percentage here and none exists anywhere in the DNS product surface — call dnsshop/products/price-history for what the product used to cost. `top_opinion` is the single review DNS promotes, not a review list. A category id or an unrelated guid is answered with 412 rather than a neighbouring entity.

## Parameters

- `access-token` (string, required)

## Request body

- `timeout` (integer) — Max scrapping execution timeout (in seconds) (default: 300; min: 20; max: 1500)
- `product` (string, required) — Product as a dns-shop.ru product URL, its 16-hex url id, its guid, or the numeric 'код товара' DNS shows on the product page (examples: "https://www.dns-shop.ru/product/f89a801b62bbd21a/69-smartfon-xiaomi-redmi-15-256-gb-cernyj/", "f89a801b62bbd21a", "f89a801b-62bb-11f0-935d-0050569d21a3", "5634783"; minLength: 1)
- `city` (string) — City the price and availability belong to. A city name, its dns-shop subdomain or its city guid. DNS prices the same product differently across cities (default: "Москва"; examples: "Москва", "Владивосток", "vladivostok"; minLength: 1)
- `with_variants` (boolean) — Also return the colour and memory siblings DNS groups with this product (default: false)

## Response

### 200 — Successful Response

- `@type` (string) (default: "DnsshopProduct")
- `guid` (string, required)
- `code` (string, nullable)
- `hex_id` (string, nullable)
- `url` (string, nullable)
- `name` (string, nullable)
- `brand` (string, nullable)
- `headline_specs` (string, nullable)
- `description` (string, nullable)
- `price` (integer, nullable)
- `currency` (string, nullable)
- `bonus_points` (integer, nullable)
- `availability` (string, nullable)
- `is_available` (boolean, nullable)
- `rating` (number, nullable)
- `review_count` (integer, nullable)
- `manufacturer_country` (string, nullable)
- `warranty_months` (integer, nullable)
- `images` (array) (default: [])
- `characteristics` (array) (default: [])
  - `@type` (string) (default: "DnsshopSpecGroup")
  - `name` (string, required)
  - `specs` (array) (default: [])
    - `@type` (string) (default: "DnsshopSpec")
    - `label` (string, required)
    - `value` (string, required)
- `top_opinion` (object, nullable)
  - `@type` (string) (default: "DnsshopOpinion")
  - `author` (string, nullable)
  - `city` (string, nullable)
  - `grade` (integer, nullable)
  - `plus` (string, nullable)
  - `minus` (string, nullable)
  - `comment` (string, nullable)
  - `ownership_months` (integer, nullable)
  - `published_at` (string, nullable)
- `variants` (array) (default: [])
  - `@type` (string) (default: "DnsshopVariant")
  - `code` (string, required)
  - `url` (string, nullable)
  - `is_available` (boolean, nullable)
  - `options` (array) (default: [])
    - `@type` (string) (default: "DnsshopSpec")
    - `label` (string, required)
    - `value` (string, required)
- `city` (string, nullable)
- `city_id` (string, nullable)

## Errors

### 422 — Validation Error

The city is not in the DNS city catalogue, or product is empty

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

No DNS product resolves from this identifier, or DNS did not serve the product for this session

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.

