{
  "openapi": "3.0.1",
  "info": {
    "title": "AptekaMos Pharmacy Price & Shortage 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": "zdSf0IN3wpVlsGFF2"
  },
  "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
          },
          "pharmacyFilter": {
            "title": "Only these pharmacies / chains",
            "type": "array",
            "description": "Keep only pharmacies whose name starts with one of these, e.g. \"Вита\" (takes \"Вита Экспресс\" and \"Вита Центральная\", not \"Терра Вита\") or \"Вита Экспресс\" for that chain alone. Each row then gives those pharmacies' price range and branch count, with the whole market alongside; a drug none of them stocks comes back as available: false. Leave empty for the whole market.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "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
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "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
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}