{
  "openapi": "3.0.1",
  "info": {
    "title": "Spain Fuel Prices + Cheapest Stop on Your Route",
    "description": "Current fuel prices for every gas station in Spain from the Ministry open data service. Filter by province, town, brand, fuel type, max price or radius; sort by price. No login, no proxy.",
    "version": "0.2",
    "x-build-id": "34gcEdTWNuH0rOWVB"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/oatpage~spain-fuel-prices/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-oatpage-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/oatpage~spain-fuel-prices/runs": {
      "post": {
        "operationId": "runs-sync-oatpage-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/oatpage~spain-fuel-prices/run-sync": {
      "post": {
        "operationId": "run-sync-oatpage-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",
        "properties": {
          "provinces": {
            "title": "Provinces",
            "type": "array",
            "description": "Province names as in the Ministry data, e.g. MADRID, BARCELONA, ALBACETE. Empty = all Spain.",
            "items": {
              "type": "string"
            }
          },
          "municipality": {
            "title": "Municipality or town",
            "type": "string",
            "description": "Exact name, accents ignored."
          },
          "brand": {
            "title": "Brand contains",
            "type": "string",
            "description": "e.g. REPSOL, CEPSA, BALLENOIL."
          },
          "fuel": {
            "title": "Fuel",
            "enum": [
              "gasoleo_a",
              "gasoleo_premium",
              "gasoleo_b",
              "gasolina_95_e5",
              "gasolina_95_e10",
              "gasolina_95_e5_premium",
              "gasolina_98_e5",
              "gasolina_98_e10",
              "glp",
              "gnc",
              "gnl",
              "adblue",
              "hidrogeno",
              "biodiesel",
              "bioetanol"
            ],
            "type": "string",
            "description": "Required to use max price and sort by price.",
            "default": "gasoleo_a"
          },
          "maxPricePerLiter": {
            "title": "Max price per liter (EUR)",
            "minimum": 0,
            "type": "number",
            "description": "Only return stations whose price for the chosen fuel is at or below this value, in euros per liter."
          },
          "latitude": {
            "title": "Latitude",
            "type": "number",
            "description": "Latitude of the search center in decimal degrees. Use together with longitude and a radius."
          },
          "longitude": {
            "title": "Longitude",
            "type": "number",
            "description": "Longitude of the search center in decimal degrees. Use together with latitude and a radius."
          },
          "radiusKm": {
            "title": "Radius (km)",
            "minimum": 0,
            "type": "number",
            "description": "Needs latitude and longitude."
          },
          "sortBy": {
            "title": "Sort by",
            "enum": [
              "price",
              "distance",
              "none"
            ],
            "type": "string",
            "description": "How to order the results, for example by price or by distance.",
            "default": "price"
          },
          "maxItems": {
            "title": "Max stations",
            "minimum": 1,
            "maximum": 20000,
            "type": "integer",
            "description": "Maximum number of stations to return. Each station is billed as one event.",
            "default": 100
          },
          "routePoints": {
            "title": "Route points (cheapest stop on your route)",
            "type": "array",
            "description": "Optional. Two or more points {\"latitude\":..,\"longitude\":..}: origin, optional waypoints, destination. The actor returns the stations within the corridor of that line, ranked by the REAL cost of filling up there (liters x price + the cost of the detour). Needs 'fuel'. The line joins your points in a straight line: add waypoints to follow the road."
          },
          "corridorKm": {
            "title": "Corridor width (km)",
            "minimum": 0.5,
            "maximum": 25,
            "type": "number",
            "description": "Maximum distance from the route line to a station (route mode).",
            "default": 3
          },
          "tankLiters": {
            "title": "Liters to fill",
            "minimum": 1,
            "maximum": 1000,
            "type": "number",
            "description": "Used to compute the cost of the fill-up (route mode).",
            "default": 40
          },
          "consumptionL100km": {
            "title": "Consumption (l/100 km)",
            "minimum": 0.5,
            "maximum": 100,
            "type": "number",
            "description": "Used to price the detour: 2 x distance to the route x consumption x price (route mode).",
            "default": 6
          },
          "openNow": {
            "title": "Only stations open now",
            "type": "boolean",
            "description": "Skips stations whose published opening hours say they are closed right now (Spanish local time). Stations whose hours cannot be read are kept.",
            "default": false
          },
          "includeSummary": {
            "title": "Include summary record",
            "type": "boolean",
            "description": "With 'fuel' set, adds one record (type 'summary') with average, minimum, maximum and median price of the selection and its cheapest station. It is not billed.",
            "default": 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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}