{
  "openapi": "3.0.1",
  "info": {
    "title": "Fuel Price Tracker: Gas Station Prices in 23 Countries",
    "description": "Fuel and gas prices API: station-level prices in 23 countries incl. US, Canada, UK, Mexico, Australia, Germany, France, Spain, Brazil. Search by ZIP, city or coordinates, or get only price changes with Telegram, Slack or webhook alerts. From $0.85 per 1,000 prices.",
    "version": "0.1",
    "x-build-id": "HQtc2khbmo6P7eRrd"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/deepurple~fuel-price-tracker/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-deepurple-fuel-price-tracker",
        "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/deepurple~fuel-price-tracker/runs": {
      "post": {
        "operationId": "runs-sync-deepurple-fuel-price-tracker",
        "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/deepurple~fuel-price-tracker/run-sync": {
      "post": {
        "operationId": "run-sync-deepurple-fuel-price-tracker",
        "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": {
          "countries": {
            "title": "Countries",
            "type": "array",
            "description": "Country codes: US, CA, MX, GB, AU, DE, ES, PT, FR, IT, AT, SI, RO, HR, CL, BR, SE, GR, PL, CZ, BG, HU, SK. Pick the countries to query, for example [\"US\", \"DE\"]. Each fuel price returned is one charge, so leave out countries you do not need. Unknown codes are skipped with a warning.",
            "items": {
              "type": "string",
              "enum": [
                "US",
                "CA",
                "MX",
                "GB",
                "AU",
                "DE",
                "ES",
                "PT",
                "FR",
                "IT",
                "AT",
                "SI",
                "RO",
                "HR",
                "CL",
                "BR",
                "SE",
                "GR",
                "PL",
                "CZ",
                "BG",
                "HU",
                "SK"
              ],
              "enumTitles": [
                "United States (GasBuddy)",
                "Canada (GasBuddy)",
                "Mexico (CRE, official)",
                "United Kingdom (retailer open data)",
                "Australia (PetrolSpy)",
                "Germany (MTS-K via clever-tanken)",
                "Spain (Ministerio, official)",
                "Portugal (DGEG, official)",
                "France (official open data)",
                "Italy (official open data)",
                "Austria (official open data)",
                "Slovenia (goriva.si, official)",
                "Romania (Monitorul Prețurilor, official)",
                "Croatia (MZOE, official)",
                "Chile (CNE Bencina en Línea, official)",
                "Brazil (ANP weekly survey, official)",
                "Sweden (Bensinpriser.nu, crowd-sourced)",
                "Greece (Fuelo.net, crowd-sourced)",
                "Poland (Fuelo.net, crowd-sourced)",
                "Czechia (Fuelo.net, crowd-sourced)",
                "Bulgaria (Fuelo.net, crowd-sourced)",
                "Hungary (Fuelo.net, crowd-sourced)",
                "Slovakia (Fuelo.net, crowd-sourced)"
              ]
            },
            "default": [
              "US"
            ]
          },
          "locations": {
            "title": "Locations",
            "type": "array",
            "description": "Places to search, as strings, for example \"77002\", \"Los Angeles, CA\", \"DE:10115\", \"FR:75001\" or \"Malmö\". A postal code or a city name; coordinates as \"lat,lng\" where supported. Prefix a country code (\"DE:10115\") to pin it to one country, otherwise it is tried in every selected country. Formats per country: see README, Input reference.",
            "default": [
              "77002"
            ],
            "items": {
              "type": "string"
            }
          },
          "coordinates": {
            "title": "Coordinates (optional)",
            "type": "array",
            "description": "Points as objects: {\"lat\": 48.2082, \"lng\": 16.3738, \"radiusKm\": 5}. radiusKm applies to FR, ES, IT; AT always returns the 10 nearest stations; US and CA return the nearest stations.",
            "default": []
          },
          "fuelTypes": {
            "title": "Fuel types",
            "type": "array",
            "description": "Fuel types to return. Default: regular only. Each fuel type at a station is one row and one charge, so pick only the grades you need. An explicit empty list returns all grades.",
            "items": {
              "type": "string",
              "enum": [
                "regular",
                "midgrade",
                "premium",
                "diesel",
                "e85",
                "e10",
                "lpg"
              ]
            },
            "default": [
              "regular"
            ]
          },
          "mode": {
            "title": "Mode",
            "enum": [
              "snapshot",
              "changes"
            ],
            "type": "string",
            "description": "snapshot: every current price. changes: only new or changed prices since the previous run with the same State key.",
            "default": "snapshot"
          },
          "maxStationsPerLocation": {
            "title": "Max stations per location",
            "minimum": 1,
            "maximum": 2000,
            "type": "integer",
            "description": "Upper bound of stations fetched for each location.",
            "default": 100
          },
          "maxPriceAgeHours": {
            "title": "Max price age (hours)",
            "minimum": 0,
            "type": "integer",
            "description": "Skip prices older than this. 0 disables the filter. Prices without a timestamp (AT) are always kept.",
            "default": 0
          },
          "stateKey": {
            "title": "State key",
            "type": "string",
            "description": "Name of the saved price history used by 'changes' mode. Defaults to a hash of the input, so identical inputs share history."
          },
          "minPriceChange": {
            "title": "Minimum price change",
            "minimum": 0,
            "type": "number",
            "description": "Ignore moves smaller than this, in the station's currency (e.g. 0.05). 'changes' mode only. Ignored moves are not emitted, not charged and do not update the saved price, so small moves add up until they cross the threshold.",
            "default": 0
          },
          "brands": {
            "title": "Brands",
            "type": "array",
            "description": "Keep only stations whose brand (or name, when the brand is empty) contains any of these words, case-insensitive. Example: [\"shell\", \"omv\"]. Empty = all brands. Dropped stations are not charged.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "maxDistanceKm": {
            "title": "Max distance (km)",
            "minimum": 0,
            "type": "number",
            "description": "Keep only stations within this distance of the searched point. 0 disables the filter. Stations with unknown distance (for example Germany and Brazil, or sources without coordinates) are dropped when it is set. Dropped stations are not charged.",
            "default": 0
          },
          "sortBy": {
            "title": "Sort by",
            "enum": [
              "none",
              "price",
              "distance"
            ],
            "type": "string",
            "description": "Order of rows within each location: by price (cheapest first, grouped by fuel type) or by distance (nearest first). none keeps the source order.",
            "default": "none"
          },
          "telegramBotToken": {
            "title": "Telegram bot token",
            "type": "string",
            "description": "Bot token from @BotFather. Send your bot any message first."
          },
          "telegramChatId": {
            "title": "Telegram chat ID",
            "type": "string",
            "description": "Your chat id (a number; a group id starts with '-')."
          },
          "webhookUrl": {
            "title": "Webhook URL",
            "type": "string",
            "description": "An http(s) URL that receives a JSON POST with the changes."
          },
          "slackWebhookUrl": {
            "title": "Slack webhook URL",
            "type": "string",
            "description": "Slack incoming webhook URL (https://hooks.slack.com/...)."
          },
          "discordWebhookUrl": {
            "title": "Discord webhook URL",
            "type": "string",
            "description": "Discord channel webhook URL (https://discord.com/api/webhooks/...)."
          },
          "proxyConfiguration": {
            "title": "Proxy (optional)",
            "type": "object",
            "description": "Not needed by default. Enable Apify Proxy only if a source starts blocking requests."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}