# /sofmap/products/search

`POST /api/sofmap/products/search`

Price: 10 credits

Search Sofmap (ソフマップ) products by keyword and/or category, narrowed by new versus second-hand stock, second-hand condition grade, maker, colour, price range, availability and the category-specific specification facets, with eight orderings. Returns product cards with product number, name, brand, image, JAN code, tax-included price, Sofmap point reward, release date, stock line, star rating and review count, second-hand condition and the shop that holds it.

## How to use it

Search sofmap.com. Give a keyword, a category_id (e.g. '001010150' from the categories endpoint) or both. Narrow with product_type (all/new/used), used_rank (S unused, A mint, B good, C fair, D faulty, E junk), maker codes and specs codes taken from the facets endpoint for the same category, color, price_min/price_max in JPY and stock; order with sort. Each result carries id (the product number, usable with the products endpoint), url, name, brand, image, jan, price with is_price_from set when the card shows a starting price for several second-hand copies, point, release_date, stock_status and stock_message, is_used, used_rank, used_count, store, badges and rating with review_count and review_url. Second-hand cards that cover several copies of the same model have no id and link to the group instead. Japanese keywords are supported. All prices are in JPY and tax-included.

## Parameters

- `access-token` (string, required)

## Request body

- `timeout` (integer) — Max scrapping execution timeout (in seconds) (default: 300; min: 20; max: 1500)
- `keyword` (string, nullable) — Free-text query matched on name, model number and JAN (minLength: 1)
- `exclude_keyword` (string, nullable) — Drop products whose name, model number or JAN contains this text (minLength: 1)
- `category_id` (string, nullable) — Category to search inside, e.g. '001010150' (from the categories endpoint) (examples: "001010150")
- `count` (integer, required) — Max number of results to return (min: 1)
- `product_type` (string) — Keep only new or only second-hand stock (default: "all"; one of: "all", "new", "used")
- `used_rank` (array, nullable) — Second-hand condition grades to keep: S unused, A mint, B good, C fair, D faulty, E junk (one of: "S", "A", "B", "C", "D", "E")
- `maker` (array, nullable) — Maker codes as returned by the facets endpoint (examples: ["100009822"])
- `color` (array, nullable) — Colour families to keep (one of: "black", "white", "gray", "silver", "blue", "green", "beige", "yellow", "gold", "orange", "brown", "red", "pink", "purple", "clear", "other")
- `price_min` (integer, nullable) — Minimum tax-included price in JPY (min: 0)
- `price_max` (integer, nullable) — Maximum tax-included price in JPY (min: 0)
- `stock` (string, nullable) — Keep only orderable, in-stock, newly released or newly arrived products (one of: "orderable", "in_stock", "new_product", "new_arrival")
- `specs` (array, nullable) — Specification facet codes as returned by the facets endpoint, e.g. an OS, CPU or storage-capacity value of the category being searched
- `sort` (string) — Result ordering (default: "recommended"; one of: "recommended", "sales", "price_asc", "price_desc", "name", "maker", "release_date_desc", "release_date_asc")

## Response

### 200 — Successful Response

- `@type` (string) (default: "SofmapProductCard")
- `id` (string, nullable)
- `url` (string, required)
- `name` (string, nullable)
- `brand` (string, nullable)
- `image` (string, nullable)
- `jan` (string, nullable)
- `price` (number, nullable)
- `currency` (string) (default: "JPY")
- `is_price_from` (boolean) (default: false)
- `point` (integer, nullable)
- `release_date` (string, nullable)
- `release_date_text` (string, nullable)
- `stock_status` (string, nullable)
- `stock_message` (string, nullable)
- `is_sold_out` (boolean) (default: false)
- `is_used` (boolean) (default: false)
- `used_rank` (string, nullable) (one of: "S", "A", "B", "C", "D", "E")
- `used_count` (integer, nullable)
- `store` (object, nullable)
  - `@type` (string) (default: "SofmapCardStore")
  - `id` (string, nullable)
  - `name` (string, required)
  - `url` (string, nullable)
- `badges` (array) (default: [])
- `rating` (number, nullable)
- `review_count` (integer, nullable)
- `review_url` (string, nullable)
- `rank` (integer, nullable)
- `rank_change` (string, nullable)

## Errors

### 422 — Validation Error

Neither keyword nor category_id was given, or a malformed category_id

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 requested category does not exist on sofmap.com

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.

