# AptekaMos Price & Availability Monitor (`sashaebashu/aptekamos-monitor`) Actor

Track drug prices across thousands of Russian pharmacies — market price range, per-pharmacy offers, and what changed since the last run.

- **URL**: https://apify.com/sashaebashu/aptekamos-monitor.md
- **Developed by:** [Sasha Ebashu](https://apify.com/sashaebashu) (community)
- **Categories:** E-commerce, Integrations, Other
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $20.00 / 1,000 results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.
Actors are written with capital "A".

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.
The best way to integrate Actors is as follows.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js/docs.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python/docs.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/integrations/mcp.md).

If your project is in a different language, use the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).


# README

## AptekaMos Price & Availability Monitor

Track what any drug costs across **thousands of Russian pharmacies at once** — the full market price range, the per-pharmacy offers behind it, and exactly what moved since your last run.

AptekaMos aggregates live prices from the pharmacy chains and independent shops of Moscow & MO, St. Petersburg, Yekaterinburg, Krasnodar, Novosibirsk and Tatarstan. One drug page routinely lists **1,000–5,000 pharmacies**.

### What you get

For every drug:

| Field | Meaning |
| --- | --- |
| `name`, `mnn`, `group` | Drug name, active ingredient (МНН), pharmacological group |
| `available` | `false` when the drug is out of stock across the **entire** regional market |
| `priceMin`, `priceMax` | The market price range right now |
| `pharmacyCount` | How many pharmacies carry it |
| `offers[]` | Per-pharmacy rows: `pharmacy`, `address`, `price` / `priceMin`–`priceMax`, `isChain`, `chainSize`, `logo` |
| `image`, `drugId`, `url`, `city`, `scrapedAt` | Identity & provenance |

Chains are reported as one row with their branch count (e.g. `"36,6"`, `chainSize: 356`, `146 … 150 ₽`); independent pharmacies come with a street address.

### Monitor mode — the point of this Actor

Turn on **Monitor mode** and every run is compared against the previous one. Each drug is labelled:

- `price_up` / `price_down` — the market's cheapest price moved
- `stock_change` — the drug vanished from every pharmacy in the region, or came back
- `range_change` — the spread between cheapest and dearest shifted
- `pharmacy_count_change` — more or fewer pharmacies carry it
- `new` / `unchanged`

You also get `previousPriceMin` / `previousPriceMax` / `previousPharmacyCount` / `previousAvailable`, `firstSeenAt` / `lastConfirmedAt`, and a rolling 30-day band (`priceLow30` / `priceHigh30`).

Flip on **Only output changes** and the dataset contains nothing but what actually moved — ideal on a schedule.

State is kept in a named key-value store (`aptekamos-monitor-state`), keyed per input scope, so several monitoring tasks can run side by side without stepping on each other.

### Input

Pick drugs any of three ways — combine them freely:

- **Drug names** (`searchQueries`): `["нурофен", "аспирин"]` — every match is scraped.
- **Drug URLs** (`drugUrls`): paste AptekaMos links; any suffix (`/ceni`, `/instrukciya`) is normalised to the price page.
- **Catalogue crawl** (`crawlSitemap`): walk AptekaMos's own sitemap (44k+ drugs per region), optionally narrowed with `drugFilter` and capped by `maxDrugsFromSitemap`.

Choose the market with `sitemapCity` (prices are regional). Turn `includeOffers` off for a compact, summary-only dataset.

### Example

```json
{
  "searchQueries": ["нурофен"],
  "monitorMode": true,
  "onlyChanges": true,
  "includeOffers": true
}
````

### Notes

- Runs on Apify's **datacenter proxy** — no residential, no browser, so it's fast and cheap (~11 s for 5 drugs and ~400 pharmacy offers).
- Drug pages are large (~430 KB); `maxConcurrency` 5 is a good default.
- The catalogue crawl drives off sitemap URLs, which AptekaMos publishes for crawling.

# Actor input Schema

## `searchQueries` (type: `array`):

Drug names to look up, e.g. "нурофен" or "ибупрофен". Each name is searched on AptekaMos and every matching drug is scraped with its full per-pharmacy price list.

## `drugUrls` (type: `array`):

Direct AptekaMos drug URLs, e.g. https://aptekamos.ru/tovary/lekarstva/ibuprofen-333/nurofen-tabletki-200mg-11562/ceni — any suffix (/ceni, /instrukciya) works, it is normalised to the price page.

## `crawlSitemap` (type: `boolean`):

Instead of naming drugs, pull them from AptekaMos's own sitemap (44k+ drugs per city). Combine with 'Catalogue filter' to narrow it down. Off by default.

## `sitemapCity` (type: `string`):

Which regional catalogue to read when 'Crawl the catalogue' is on. Prices are regional, so this selects the market you monitor.

## `drugFilter` (type: `string`):

Only crawl catalogue URLs containing this text, e.g. "ibuprofen" or "nurofen" (URL slugs are latin). Leave empty to take the catalogue in order.

## `maxDrugsFromSitemap` (type: `integer`):

Cap on how many drug pages the sitemap crawl collects. Keeps a catalogue-wide run bounded.

## `includeOffers` (type: `boolean`):

Include the full pharmacy-by-pharmacy price list (name, address, price) for each drug. Turn off for a compact market-summary-only dataset.

## `maxItems` (type: `integer`):

Stop after this many drugs. 0 = no limit.

## `maxConcurrency` (type: `integer`):

How many price pages to fetch in parallel. Price pages are large (~430 KB); 5 is a good balance.

## `monitorMode` (type: `boolean`):

Compare this run against the previous one and label every drug: new / price\_up / price\_down / stock\_change / range\_change / pharmacy\_count\_change / unchanged. 'stock\_change' fires when a drug disappears from every pharmacy in the region (or comes back). Also adds previous values, first-seen/last-confirmed stamps and a 30-day price band. Off by default.

## `onlyChanges` (type: `boolean`):

With Monitor mode on, skip drugs whose price, stock and pharmacy count did not change — the dataset then contains only what actually moved.

## `proxyConfiguration` (type: `object`):

AptekaMos works over Apify's cheap datacenter proxy — the default is fine.

## Actor input object example

```json
{
  "searchQueries": [
    "нурофен",
    "аспирин"
  ],
  "drugUrls": [
    "https://aptekamos.ru/tovary/lekarstva/ibuprofen-333/nurofen-tabletki-200mg-11562/ceni"
  ],
  "crawlSitemap": false,
  "sitemapCity": "moscow",
  "maxDrugsFromSitemap": 100,
  "includeOffers": true,
  "maxItems": 0,
  "maxConcurrency": 5,
  "monitorMode": false,
  "onlyChanges": false,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

## `marketOverview` (type: `string`):

Every drug with its market price range and how many pharmacies carry it.

## `changes` (type: `string`):

What moved since the previous run (monitor mode).

## `details` (type: `string`):

All fields, including the per-pharmacy offers.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "searchQueries": [
        "нурофен"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("sashaebashu/aptekamos-monitor").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "searchQueries": ["нурофен"] }

# Run the Actor and wait for it to finish
run = client.actor("sashaebashu/aptekamos-monitor").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "searchQueries": [
    "нурофен"
  ]
}' |
apify call sashaebashu/aptekamos-monitor --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=sashaebashu/aptekamos-monitor",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "AptekaMos Price & Availability Monitor",
        "description": "Track drug prices across thousands of Russian pharmacies — market price range, per-pharmacy offers, and what changed since the last run.",
        "version": "0.1",
        "x-build-id": "ic9JVqQzm0rFey5jf"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/sashaebashu~aptekamos-monitor/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-sashaebashu-aptekamos-monitor",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/sashaebashu~aptekamos-monitor/runs": {
            "post": {
                "operationId": "runs-sync-sashaebashu-aptekamos-monitor",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/sashaebashu~aptekamos-monitor/run-sync": {
            "post": {
                "operationId": "run-sync-sashaebashu-aptekamos-monitor",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "properties": {
                    "searchQueries": {
                        "title": "Drug names to track",
                        "type": "array",
                        "description": "Drug names to look up, e.g. \"нурофен\" or \"ибупрофен\". Each name is searched on AptekaMos and every matching drug is scraped with its full per-pharmacy price list.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "drugUrls": {
                        "title": "Drug page URLs",
                        "type": "array",
                        "description": "Direct AptekaMos drug URLs, e.g. https://aptekamos.ru/tovary/lekarstva/ibuprofen-333/nurofen-tabletki-200mg-11562/ceni — any suffix (/ceni, /instrukciya) works, it is normalised to the price page.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "crawlSitemap": {
                        "title": "Crawl the catalogue (sitemap)",
                        "type": "boolean",
                        "description": "Instead of naming drugs, pull them from AptekaMos's own sitemap (44k+ drugs per city). Combine with 'Catalogue filter' to narrow it down. Off by default.",
                        "default": false
                    },
                    "sitemapCity": {
                        "title": "City / region",
                        "enum": [
                            "moscow",
                            "spb",
                            "ekb",
                            "krasnodar",
                            "novosibirsk",
                            "tatarstan"
                        ],
                        "type": "string",
                        "description": "Which regional catalogue to read when 'Crawl the catalogue' is on. Prices are regional, so this selects the market you monitor.",
                        "default": "moscow"
                    },
                    "drugFilter": {
                        "title": "Catalogue filter",
                        "type": "string",
                        "description": "Only crawl catalogue URLs containing this text, e.g. \"ibuprofen\" or \"nurofen\" (URL slugs are latin). Leave empty to take the catalogue in order."
                    },
                    "maxDrugsFromSitemap": {
                        "title": "Max drugs from catalogue",
                        "minimum": 1,
                        "type": "integer",
                        "description": "Cap on how many drug pages the sitemap crawl collects. Keeps a catalogue-wide run bounded.",
                        "default": 100
                    },
                    "includeOffers": {
                        "title": "Include per-pharmacy offers",
                        "type": "boolean",
                        "description": "Include the full pharmacy-by-pharmacy price list (name, address, price) for each drug. Turn off for a compact market-summary-only dataset.",
                        "default": true
                    },
                    "maxItems": {
                        "title": "Max drugs",
                        "minimum": 0,
                        "type": "integer",
                        "description": "Stop after this many drugs. 0 = no limit.",
                        "default": 0
                    },
                    "maxConcurrency": {
                        "title": "Max concurrency",
                        "minimum": 1,
                        "maximum": 12,
                        "type": "integer",
                        "description": "How many price pages to fetch in parallel. Price pages are large (~430 KB); 5 is a good balance.",
                        "default": 5
                    },
                    "monitorMode": {
                        "title": "Monitor mode (track changes)",
                        "type": "boolean",
                        "description": "Compare this run against the previous one and label every drug: new / price_up / price_down / stock_change / range_change / pharmacy_count_change / unchanged. 'stock_change' fires when a drug disappears from every pharmacy in the region (or comes back). Also adds previous values, first-seen/last-confirmed stamps and a 30-day price band. Off by default.",
                        "default": false
                    },
                    "onlyChanges": {
                        "title": "Only output changes",
                        "type": "boolean",
                        "description": "With Monitor mode on, skip drugs whose price, stock and pharmacy count did not change — the dataset then contains only what actually moved.",
                        "default": false
                    },
                    "proxyConfiguration": {
                        "title": "Proxy configuration",
                        "type": "object",
                        "description": "AptekaMos works over Apify's cheap datacenter proxy — the default is fine.",
                        "default": {
                            "useApifyProxy": true
                        }
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
