{
  "openapi": "3.0.1",
  "info": {
    "title": "DE/AT Pharmacy Price & Stock Monitor",
    "description": "PZN-keyed OTC shelf data from Europe's largest online pharmacy (DE + AT): price, list-price breach, discount, availability and the marketplace seller undercutting the shop. Delta mode returns only price moves, RRP breaches and stock flips.",
    "version": "0.1",
    "x-build-id": "l8SyGetBMpZf4m1Wh"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/zhorex~pharmacy-price-monitor/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-zhorex-pharmacy-price-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/zhorex~pharmacy-price-monitor/runs": {
      "post": {
        "operationId": "runs-sync-zhorex-pharmacy-price-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/zhorex~pharmacy-price-monitor/run-sync": {
      "post": {
        "operationId": "run-sync-zhorex-pharmacy-price-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",
        "required": [
          "mode"
        ],
        "properties": {
          "mode": {
            "title": "Mode",
            "enum": [
              "brand_watch",
              "pzn_watch",
              "category_slice"
            ],
            "type": "string",
            "description": "'Brand watch' pulls every article of a brand — the volume path, and how you map a competitor's whole range. 'PZN watch' takes the exact article numbers you own, which is what a brand or trade team actually monitors. 'Category slice' takes a raw index filter for analysts who want a whole segment.",
            "default": "brand_watch"
          },
          "brands": {
            "title": "Brands",
            "type": "array",
            "description": "Brand tokens, exact and case-insensitive (they are stored upper-case in the index): DOPPELHERZ, ABTEI, VOLTAREN, BEPANTHEN, NUROFEN, ASPIRIN. One request covers up to 1,000 articles of a brand, so a brand is one request, not one per article.",
            "items": {
              "type": "string"
            }
          },
          "pzns": {
            "title": "PZNs (article numbers)",
            "type": "array",
            "description": "Pharmazentralnummern to track, e.g. 17268563. The PZN is the German/Austrian pharmaceutical article number, so it joins the same article across storefronts and sellers with no name matching. Batched 40 per request.",
            "items": {
              "type": "string"
            }
          },
          "filterExpression": {
            "title": "Filter expression (category-slice mode)",
            "type": "string",
            "description": "A raw index filter, e.g. `prescriptionMedicine:false AND marketplace:false` or `categoryCodes:...`. Note the result window: any single filter exposes at most 5,000 articles, so slice narrowly (per brand, per category) rather than trying to page through a whole catalogue."
          },
          "markets": {
            "title": "Markets",
            "type": "array",
            "description": "DE (shop-apotheke.com) and/or AT (shop-apotheke.at). The same PZN is often priced differently in each, which is itself the signal for cross-border price-corridor work.",
            "items": {
              "type": "string"
            },
            "default": [
              "DE"
            ]
          },
          "includeMarketplaceOffers": {
            "title": "Include marketplace seller offers",
            "type": "boolean",
            "description": "Adds the per-seller offer table for each article: how many sellers, the cheapest offer and who is making it, the price spread, and whether the shop's own price is being undercut. This is the answer to 'who is breaking my price', and it also recovers a reference price for articles where the storefront shows none. Costs one extra request per 40 articles.",
            "default": false
          },
          "maxRowsPerSlice": {
            "title": "Max articles per slice",
            "minimum": 1,
            "maximum": 60000,
            "type": "integer",
            "description": "Ceiling per brand / PZN batch / filter. The index only ever exposes the first 5,000 matches of a query, so values above that cannot be reached by paging — narrow the slice instead.",
            "default": 5000
          },
          "deltaMode": {
            "title": "Delta mode — only what CHANGED",
            "type": "boolean",
            "description": "Turn this on for a scheduled monitor. The first run records a baseline (billed at the ordinary row rate, not the alert rate); every later run returns and bills ONLY what moved: price up or down, a list-price breach opening or closing, and stock flips. Out-of-stock is only detectable this way — the search index has no stock filter at all, so availability changes can only be derived by comparing against stored state.",
            "default": false
          },
          "deltaStateKey": {
            "title": "Delta stream name",
            "type": "string",
            "description": "Names an independent delta stream so several monitors don't collide (e.g. 'my-brand-de' vs 'competitors-at'). Only used when Delta mode is on.",
            "default": "default"
          },
          "proxyConfiguration": {
            "title": "Proxy (optional — not required)",
            "type": "object",
            "description": "Not needed: the search endpoint answers ordinary datacenter IPs with no challenge and no rate limiting observed. Leave it off unless you specifically want your traffic routed.",
            "default": {
              "useApifyProxy": false
            }
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}