{
  "openapi": "3.0.1",
  "info": {
    "title": "Spanish Pharmacy Price Monitor (EAN-13, Multi-Shop JSON)",
    "description": "Compare EAN-13 codes across 12 Spanish online pharmacies. Monitor mode tracks price and stock changes with delta rows, alerts, and price percent. Daily price history snapshots via S3.",
    "version": "0.7",
    "x-build-id": "Xaq5bWTCNukVQEpux"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/steadfetch~farmacias-es-comparator/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-steadfetch-farmacias-es-comparator",
        "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/steadfetch~farmacias-es-comparator/runs": {
      "post": {
        "operationId": "runs-sync-steadfetch-farmacias-es-comparator",
        "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/steadfetch~farmacias-es-comparator/run-sync": {
      "post": {
        "operationId": "run-sync-steadfetch-farmacias-es-comparator",
        "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": [
          "eans"
        ],
        "properties": {
          "eans": {
            "title": "EAN-13 codes",
            "minItems": 1,
            "uniqueItems": true,
            "type": "array",
            "description": "Non-empty list of 13-digit EAN codes to compare. v1 accepts EAN-13 only; free-text product names are not supported yet.",
            "items": {
              "type": "string",
              "pattern": "^[0-9]{13}$"
            }
          },
          "stores": {
            "title": "Stores",
            "uniqueItems": true,
            "type": "array",
            "description": "Subset of the v6 roster: farmaciasdirect, farmaline, farmaten, negrito, cuestavilla, vistabella, farmaprincipal, farmaciacolmenar, pharmacieprado, farmaleon, farmaes, farma2go. Omit it to compare against every supported store.",
            "items": {
              "type": "string"
            },
            "default": [
              "farmaciasdirect",
              "farmaline",
              "farmaten",
              "negrito",
              "cuestavilla",
              "vistabella",
              "farmaprincipal",
              "farmaciacolmenar",
              "pharmacieprado",
              "farmaleon",
              "farmaes",
              "farma2go"
            ]
          },
          "maxResults": {
            "title": "Max results",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "Maximum number of rows (one per EAN and store) to save to the dataset. Default 100, maximum 5000.",
            "default": 100
          },
          "delayMs": {
            "title": "Delay between requests (ms)",
            "minimum": 1000,
            "type": "integer",
            "description": "Minimum delay between HTTP requests. Concurrency is always 1. The default and minimum is 1000 ms; keep it at 1500 ms or higher to be a good citizen.",
            "default": 1500
          },
          "maxScanPages": {
            "title": "Max product pages scanned in the run",
            "minimum": 1,
            "maximum": 200000,
            "type": "integer",
            "description": "Credit guard: maximum number of product pages fetched in the run, split evenly across the selected stores. Product sitemaps can hold tens of thousands of URLs, so a very old or absent EAN may need a larger budget. Stores that publish the EAN in the product URL only fetch matching pages. Default 2000.",
            "default": 2000
          },
          "strictSchema": {
            "title": "Strict output schema",
            "type": "boolean",
            "description": "Fail the run when a row does not match the OUTPUT schema. Keep enabled: Steadfetch never publishes Actors without output-schema validation.",
            "default": true
          },
          "monitorMode": {
            "title": "Monitor mode (delta only)",
            "type": "boolean",
            "description": "When enabled, rows that have not changed since the last run (same price and availability for each EAN × store) are not pushed to the dataset, so a monitor run without changes delivers 0 rows and is not charged per result.",
            "default": false
          },
          "lastRunKey": {
            "title": "Run key for history tracking",
            "type": "string",
            "description": "A key used to track the history of prices and availability across runs. When monitorMode is true, this key must be the same across runs to compare against previous results. Leave empty for one-off runs.",
            "default": ""
          },
          "saveSnapshot": {
            "title": "Save snapshot to Steadfetch storage",
            "type": "boolean",
            "description": "Internal use: scheduled series only. When enabled on a run started by the Steadfetch account, the run also writes the full validated dataset to Steadfetch object storage for the daily price history. Customer runs never write, even with this flag on.",
            "default": 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
                  },
                  "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}