# /rusprofile/companies/search/advanced

`POST /api/rusprofile/companies/search/advanced`

Price: 5 credits

Search Russian companies or sole proprietors by filters: name or number, registry status, region, OKVED activity, legal form, SME category, registration date range, charter capital, headcount, revenue, profit, value, government contracts, arbitration claims and contact availability, ordered by relevance, revenue or charter capital. Returns up to 25 matches with id, name, INN, OGRN, status, region, address, CEO, main activity, charter capital, revenue with its yearly change and registration date.

## How to use it

Use this to find companies by filters rather than by name; query is optional and every filter combines with AND. One call searches either companies or sole proprietors (organization_type), and returns at most 25 rows, so narrow the filters instead of expecting more. Dates are unix seconds and money bounds are RUB.

## Parameters

- `access-token` (string, required)

## Request body

- `timeout` (integer) — Max scrapping execution timeout (in seconds) (default: 300; min: 20; max: 1500)
- `query` (string, nullable) — Name, INN, OGRN, address or person name to match; omit to search by filters only (examples: "банк", "7707083893"; minLength: 1)
- `count` (integer, required) — Max number of results (min: 1; max: 25)
- `organization_type` (string) — Search legal entities or sole proprietors (default: "company"; one of: "company", "entrepreneur")
- `statuses` (array) — Registry statuses to include (default: ["active","reorganizing","liquidating","bankruptcy","liquidated"]; one of: "active", "reorganizing", "liquidating", "bankruptcy", "liquidated"; minItems: 1)
- `regions` (array) — Regions of registration, by their Russian name (default: []; one of: "Алтайский край", "Амурская область", "Архангельская область", "Астраханская область", "Байконур", "Белгородская область", "Брянская область", "Владимирская область", "Волгоградская область", "Вологодская область", "Воронежская область", "Донецкая народная республика", "Еврейская автономная область", "Забайкальский край", "Запорожская область", "Ивановская область", "Иркутская область", "Кабардино-Балкарская республика", "Калининградская область", "Калужская область", "Камчатский край", "Карачаево-Черкесская республика", "Кемеровская область", "Кировская область", "Костромская область", "Краснодарский край", "Красноярский край", "Курганская область", "Курская область", "Ленинградская область", "Липецкая область", "Луганская народная республика", "Магаданская область", "Москва", "Московская область", "Мурманская область", "Ненецкий автономный округ", "Нижегородская область", "Новгородская область", "Новосибирская область", "Омская область", "Оренбургская область", "Орловская область", "Пензенская область", "Пермский край", "Приморский край", "Псковская область", "Республика Адыгея", "Республика Алтай", "Республика Башкортостан", "Республика Бурятия", "Республика Дагестан", "Республика Ингушетия", "Республика Калмыкия", "Республика Карелия", "Республика Коми", "Республика Крым", "Республика Марий Эл", "Республика Мордовия", "Республика Саха (Якутия)", "Республика Северная Осетия — Алания", "Республика Татарстан", "Республика Тыва", "Республика Хакасия", "Ростовская область", "Рязанская область", "Самарская область", "Санкт-Петербург", "Саратовская область", "Сахалинская область", "Свердловская область", "Севастополь", "Смоленская область", "Ставропольский край", "Тамбовская область", "Тверская область", "Томская область", "Тульская область", "Тюменская область", "Удмуртская республика", "Ульяновская область", "Хабаровский край", "Ханты-Мансийский автономный округ - Югра", "Херсонская область", "Челябинская область", "Чеченская республика", "Чувашская республика", "Чукотский автономный округ", "Ямало-Ненецкий автономный округ", "Ярославская область"; examples: ["Москва","Республика Татарстан"])
- `activity_codes` (array) — OKVED activity codes (default: []; examples: ["64.19","47.73"])
- `main_activity_only` (boolean) — Match activity_codes against the main activity only, not any registered activity (default: false)
- `legal_form_codes` (array) — OKOPF legal form codes (default: []; examples: ["12300","12267"])
- `sme_categories` (array) — Small and medium business register categories (default: []; one of: "micro", "small", "medium", "not_sme")
- `registered_after` (integer, nullable) — Registered on or after this day, unix seconds (examples: 1735689600)
- `registered_before` (integer, nullable) — Registered on or before this day, unix seconds (examples: 1738281600)
- `charter_capital_min` (number, nullable) — Minimum charter capital, RUB (min: 0)
- `charter_capital_max` (number, nullable) — Maximum charter capital, RUB (min: 0)
- `employee_count_min` (integer, nullable) — Minimum average headcount (min: 0)
- `employee_count_max` (integer, nullable) — Maximum average headcount (min: 0)
- `revenue_min` (number, nullable) — Minimum revenue of the latest reported year, RUB (min: 0)
- `revenue_max` (number, nullable) — Maximum revenue of the latest reported year, RUB (min: 0)
- `profit_min` (number, nullable) — Minimum net profit of the latest reported year, RUB (min: 0)
- `profit_max` (number, nullable) — Maximum net profit of the latest reported year, RUB (min: 0)
- `company_value_min` (number, nullable) — Minimum company value, RUB (min: 0)
- `company_value_max` (number, nullable) — Maximum company value, RUB (min: 0)
- `contract_count_min` (integer, nullable) — Minimum number of government contracts won (min: 0)
- `contract_count_max` (integer, nullable) — Maximum number of government contracts won (min: 0)
- `contract_sum_min` (number, nullable) — Minimum total of government contracts, RUB (min: 0)
- `contract_sum_max` (number, nullable) — Maximum total of government contracts, RUB (min: 0)
- `claims_as_defendant_sum_min` (number, nullable) — Minimum total of arbitration claims against the company, RUB (min: 0)
- `claims_as_defendant_sum_max` (number, nullable) — Maximum total of arbitration claims against the company, RUB (min: 0)
- `never_defendant` (boolean) — Only companies that were never a defendant in arbitration (default: false)
- `has_phone` (boolean) — Only companies with a known phone number (default: false)
- `has_email` (boolean) — Only companies with a known email (default: false)
- `has_website` (boolean) — Only companies with a known website (default: false)
- `sort` (string) — Result order (default: "relevance"; one of: "relevance", "revenue_desc", "revenue_asc", "charter_capital_desc")

## Response

### 200 — Successful Response

- `@type` (string) (default: "RusprofileAdvancedSearchResult")
- `id` (string, required)
- `url` (string, required)
- `type` (string, nullable)
- `name` (string, nullable)
- `inn` (string, nullable)
- `ogrn` (string, nullable)
- `status` (string, nullable) (one of: "active", "reorganizing", "liquidating", "bankruptcy", "liquidated")
- `entrepreneur_type` (string, nullable)
- `region` (string, nullable)
- `address` (string, nullable)
- `ceo_name` (string, nullable)
- `ceo_position` (string, nullable)
- `has_several_ceos` (boolean, nullable)
- `main_activity_code` (string, nullable)
- `main_activity_name` (string, nullable)
- `charter_capital` (number, nullable)
- `revenue` (number, nullable)
- `revenue_change` (number, nullable)
- `revenue_change_percent` (number, nullable)
- `registered_date` (integer, nullable)
- `sex` (string, nullable)
- `match_text` (string, nullable)
- `match_type` (string, nullable)
- `matched_trademarks` (array) (default: [])

## Errors

### 422 — Validation Error

A region, OKVED or OKOPF value outside the accepted catalogue

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.

