{
  "openapi": "3.0.1",
  "info": {
    "title": "Spain Fuel Prices - Ministry Open Data (unofficial)",
    "description": "Fuel prices for ~11,500 Spanish service stations from the official Ministry open-data feed (MINCOTUR). Find the cheapest station near any coordinates or filter by province, brand and fuel. Refreshed every 30 min; ready-to-open CSV/Excel included. Unofficial: not affiliated with the Spanish Ministry.",
    "version": "0.2",
    "x-build-id": "R8zZiwBLXQVXDal1W"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/rianone~spain-fuel-prices/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-rianone-spain-fuel-prices",
        "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/rianone~spain-fuel-prices/runs": {
      "post": {
        "operationId": "runs-sync-rianone-spain-fuel-prices",
        "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/rianone~spain-fuel-prices/run-sync": {
      "post": {
        "operationId": "run-sync-rianone-spain-fuel-prices",
        "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": [
          "products"
        ],
        "properties": {
          "searchMode": {
            "title": "Search mode",
            "enum": [
              "cheapest",
              "nearest",
              "all"
            ],
            "type": "string",
            "description": "How to build the list of stations.",
            "default": "cheapest"
          },
          "sortBy": {
            "title": "Orden personalizado (opcional)",
            "enum": [
              "price",
              "distance",
              "cheapest",
              "source"
            ],
            "type": "string",
            "description": "Vacío = usa el orden propio del modo elegido. 'source' conserva el orden del fichero oficial."
          },
          "products": {
            "title": "Fuel types",
            "type": "array",
            "description": "Only these fuels are returned in the `prices` object.",
            "items": {
              "type": "string"
            },
            "default": [
              "gasolina95",
              "gasoleo_a"
            ]
          },
          "provinceIds": {
            "title": "Province data optimization (optional)",
            "maxItems": 1,
            "type": "array",
            "description": "Select exactly one official province id (e.g. 28 = Madrid, 08 = Barcelona) to download a smaller official source file. This only optimizes the download; pricing depends on returned station results, not on provinceIds. Use Provinces by name for one or more names after the source download.",
            "items": {
              "type": "string"
            }
          },
          "provinces": {
            "title": "Provinces (by name)",
            "type": "array",
            "description": "Filter by one or more province names, accents optional (e.g. Madrid, Alava, Malaga). provinceIds can optimize a single-province source download, but it does not change pricing.",
            "items": {
              "type": "string"
            }
          },
          "municipalities": {
            "title": "Municipalities / towns",
            "type": "array",
            "description": "Filter by municipality or town name (partial match, accents optional).",
            "items": {
              "type": "string"
            }
          },
          "brands": {
            "title": "Brands to include",
            "type": "array",
            "description": "Partial match on the station brand, e.g. Repsol, Cepsa, Ballenoil, Plenoil.",
            "items": {
              "type": "string"
            }
          },
          "excludeBrands": {
            "title": "Brands to exclude",
            "type": "array",
            "description": "Brands to exclude (partial match).",
            "items": {
              "type": "string"
            }
          },
          "latitude": {
            "title": "Latitude",
            "type": "number",
            "description": "Centre point for the nearest / radius search."
          },
          "longitude": {
            "title": "Longitude",
            "type": "number",
            "description": "Longitude for the nearest / radius search."
          },
          "radiusKm": {
            "title": "Radius (km)",
            "type": "number",
            "description": "Only used together with latitude + longitude.",
            "default": 5
          },
          "maxPrice": {
            "title": "Maximum price (EUR)",
            "type": "number",
            "description": "Drop stations above this price for the reference fuel type."
          },
          "priceProduct": {
            "title": "Reference fuel for sorting, maxPrice and statistics",
            "enum": [
              "gasoleo_a",
              "gasoleo_premium",
              "gasoleo_b",
              "gasolina95",
              "gasolina95_premium",
              "gasolina95_e10",
              "gasolina95_e25",
              "gasolina95_e85",
              "gasolina98",
              "gasolina98_e10",
              "gasoleo_renovable",
              "gasolina_renovable",
              "glp",
              "gnc",
              "gnl",
              "biogas_c",
              "biogas_l",
              "biodiesel",
              "bioetanol",
              "adblue",
              "amoniaco",
              "hidrogeno",
              "metanol"
            ],
            "type": "string",
            "description": "Reference fuel for sorting, maxPrice and statistics. Los 23 combustibles del catálogo son seleccionables. Ojo: `cheapestProduct`/`cheapestPrice` solo comparan combustibles de la MISMA unidad (EUR/litro vs EUR/kg no se pueden comparar); el resto de unidades van en `cheapestByUnit`.",
            "default": "gasolina95"
          },
          "requireProducts": {
            "title": "Must have all of these fuels",
            "type": "array",
            "description": "Keep only stations that sell all of these fuels.",
            "items": {
              "type": "string"
            }
          },
          "exportFiles": {
            "title": "Also save ready-to-open files (CSV / XLSX)",
            "type": "array",
            "description": "Writes downloadable files to the run's key-value store: a standard CSV (comma separated, dot decimals) and an Excel workbook with price columns as real numbers, autofilter and a per-province summary. Free of charge - they do not add events.",
            "items": {
              "type": "string"
            },
            "default": [
              "csv",
              "xlsx"
            ]
          },
          "exportLanguage": {
            "title": "Export language",
            "enum": [
              "es",
              "en"
            ],
            "type": "string",
            "description": "Column headers and sheet names for the export files.",
            "default": "es"
          },
          "chargeReport": {
            "title": "Price statistics included",
            "type": "boolean",
            "description": "Kept for backward-compatible input only. Price statistics are included in every run at no extra event.",
            "default": true
          },
          "onlyWithPrices": {
            "title": "Only stations with at least one price",
            "type": "boolean",
            "description": "Drop stations with no price at all.",
            "default": true
          },
          "cacheMinutes": {
            "title": "Cache the source file (minutes)",
            "type": "integer",
            "description": "Reuses a previously downloaded Ministry file if it is younger than this. Keeps the load on the public endpoint low (its legal notice reserves the right to act against abusive or robotic use). Use 0 to always fetch fresh.",
            "default": 30
          },
          "maxResults": {
            "title": "Max stations (optional cap)",
            "type": "integer",
            "description": "Default 0 returns every matching station. Set a positive integer when you deliberately want a smaller result set; only returned station results are billable, with a maximum of 4,000 charged results per execution.",
            "default": 0
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}