# Krasnoeibeloe — Wrapped API

> **You are on:** `https://api.paywithlocus.com/api` | [llms.txt](https://paywithlocus.com/llms.txt) | [docs](https://docs.paywithlocus.com)
>
> Locus runs on multiple environments -- make sure every URL you call matches your expected environment.
> | Environment | Landing | API | Docs |
> |---|---|---|---|
> | Production | paywithlocus.com | api.paywithlocus.com | docs.paywithlocus.com |
> | Beta | beta.paywithlocus.com | api.beta.paywithlocus.com | docs.paywithlocus.com |
> | Stage | stage.paywithlocus.com | api.stage.paywithlocus.com | docs.paywithlocus.com |
>
> If the API URL above doesn't match your expected environment, re-fetch this file from the correct domain.

> Search for products from Krasnoe & Beloe, locate nearby shops across different cities, and check real-time stock availability to find what you need. View detailed product information and discover which stores have items in stock so you can plan your shopping trip efficiently.

**Category:** E-commerce | **Website:** [krasnoeibeloe.ru/](https://krasnoeibeloe.ru/) | **Docs:** [parse.bot/marketplace/6347879c-c7b3-4b2d-bdd6-4954547c7bd6/krasnoeibeloe-ru-api](https://parse.bot/marketplace/6347879c-c7b3-4b2d-bdd6-4954547c7bd6/krasnoeibeloe-ru-api)

Pay-per-use API proxy. Each call is automatically billed to your wallet in USDC.

## Access

**Base URL:** `https://api.paywithlocus.com/api/wrapped/parse-krasnoeibeloe-ru-api-6347879c/`
**Auth:** `Authorization: Bearer <LOCUS_API_KEY>`

## Endpoints

### get_cities

Returns all cities served by Krasnoe & Beloe stores, including their numeric IDs and region associations. City IDs are used as input to get_shops. The full list is returned in a single response with no pagination.

**Estimated cost:** Metered

_No parameters required._

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-krasnoeibeloe-ru-api-6347879c/get_cities \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
```

### get_product_details

Extracts product details including the XML ID and current stock amount from a product page URL slug. The URL slug is the path portion of a product page starting with /catalog/. Returns the resolved URL, xml_id, city_id detected from page context, and total stock amount.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `url` | string | Yes | Product page URL slug starting with /catalog/ (e.g. '/catalog/vino/'). |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-krasnoeibeloe-ru-api-6347879c/get_product_details \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"url":"<string>"}'
```

### get_product_stock

Get stock availability in shops for a product. Note: Often restricted by Yandex SmartCaptcha.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `city_id` | string | No | City ID from the get_cities endpoint (e.g. 778 for Белгород, 1433 for Челябинск). |
| `xml_id` | string | Yes | Product XML ID obtained from search_products or get_product_details (e.g. '<xml_id>'). |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-krasnoeibeloe-ru-api-6347879c/get_product_stock \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"city_id":"<string>","xml_id":"<string>"}'
```

### get_shops

Returns all shops in a given city, including addresses, geographic coordinates, working hours, and alcohol sale hours. Each shop has a unique numeric ID and shop number. Without a city_id, defaults to city 1433 (Челябинск).

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `city_id` | string | No | City ID from the get_cities endpoint. |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-krasnoeibeloe-ru-api-6347879c/get_shops \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"city_id":"<string>"}'
```

### search_products

Search for products by name or keyword. Returns product metadata including XML IDs needed for get_product_details. Results come from the catalog page HTML and include pricing and stock summary. A single page of results is returned.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `query` | string | Yes | Search query such as a product name or keyword (e.g. 'вино', 'пиво', 'виски'). |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-krasnoeibeloe-ru-api-6347879c/search_products \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"query":"<string>"}'
```
