{
  "openapi": "3.0.1",
  "info": {
    "title": "UK Fuel Prices API: Forecourt Prices and Every Change",
    "description": "Current pump prices for over 8,000 UK forecourts and a feed of every price change, with the forecourt's own timestamp. Plus UK weekly prices back to 2003 and Advisory Fuel Rates against real pump cost per mile.",
    "version": "0.1",
    "x-build-id": "bC6BvfCUW45vIxq44"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/arjs1000~uk-fuel-prices-enriched/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-arjs1000-uk-fuel-prices-enriched",
        "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/arjs1000~uk-fuel-prices-enriched/runs": {
      "post": {
        "operationId": "runs-sync-arjs1000-uk-fuel-prices-enriched",
        "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/arjs1000~uk-fuel-prices-enriched/run-sync": {
      "post": {
        "operationId": "run-sync-arjs1000-uk-fuel-prices-enriched",
        "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": [
              "energy_context",
              "weekly_prices",
              "trend_report",
              "fleet_afr",
              "changes",
              "snapshot",
              "postcode_cheapest",
              "station_history"
            ],
            "type": "string",
            "description": "energy_context: latest of every context series in one row. weekly_prices: DESNZ UK average pump prices since June 2003. trend_report: one month's report. fleet_afr: HMRC Advisory Fuel Rates against pump cost per mile. changes, snapshot, postcode_cheapest, station_history: forecourt-level data from Fuel Finder.",
            "default": "energy_context"
          },
          "grade": {
            "title": "Fuel grade",
            "enum": [
              "E10",
              "E5",
              "B7S",
              "B7P",
              "B10",
              "HVO"
            ],
            "type": "string",
            "description": "E10 and E5 petrol, B7S standard diesel, B7P premium diesel, B10, HVO. Used by changes, snapshot, postcode_cheapest, station_history and fleet_afr."
          },
          "postcode": {
            "title": "Postcode",
            "pattern": "^([A-Za-z]{1,2}[0-9][A-Za-z0-9]?( ?[0-9][A-Za-z]{2})?)?$",
            "type": "string",
            "description": "Full postcode or outward code in Great Britain (Northern Ireland BT postcodes are not supported). Required for postcode_cheapest; optional filter for changes and snapshot."
          },
          "radiusKm": {
            "title": "Radius (km)",
            "minimum": 1,
            "maximum": 50,
            "type": "integer",
            "description": "Search radius around the postcode, 1 to 50 km.",
            "default": 5
          },
          "brand": {
            "title": "Brand",
            "type": "string",
            "description": "Optional filter, exact brand name as published (case-insensitive). Results are never ordered by brand."
          },
          "sort": {
            "title": "Sort (snapshot)",
            "enum": [
              "node_id",
              "price",
              "distance",
              "updated"
            ],
            "type": "string",
            "description": "Objective orderings only.",
            "default": "node_id"
          },
          "since": {
            "title": "Changes since",
            "pattern": "^(\\d{4}-\\d{2}-\\d{2})?$",
            "type": "string",
            "description": "Mode changes only. Date in YYYY-MM-DD. Leave empty for the last 24 hours."
          },
          "sinceLastRun": {
            "title": "Only new since the last run",
            "type": "boolean",
            "description": "Mode changes only. Turn this on for scheduled runs. Each run returns only price changes newer than the last run that had it on, so you never pay twice for the same item. The actor saves its place in a key-value store called uk-fuel-prices-enriched-cursor in your own Apify account. The first run has no saved place and uses the default window. A date in \"Changes since\" overrides the saved place for that run. A failed or aborted run does not move it.",
            "default": false
          },
          "cursorName": {
            "title": "Cursor name",
            "pattern": "^[a-zA-Z0-9!\\-_.'()]{0,256}$",
            "type": "string",
            "description": "Used with \"Only new since the last run\". The name of the record that holds the saved place. Leave it empty and each mode and set of filters gets its own. Give two tasks the same name only if they should share one place."
          },
          "nodeId": {
            "title": "Station id (node_id)",
            "type": "string",
            "description": "Mode station_history only. The forecourt's Fuel Finder node_id, as returned by the other modes."
          },
          "from": {
            "title": "From date",
            "pattern": "^(\\d{4}-\\d{2}-\\d{2})?$",
            "type": "string",
            "description": "station_history and weekly_prices. YYYY-MM-DD."
          },
          "to": {
            "title": "To date",
            "pattern": "^(\\d{4}-\\d{2}-\\d{2})?$",
            "type": "string",
            "description": "station_history and weekly_prices. YYYY-MM-DD."
          },
          "month": {
            "title": "Month (trend report)",
            "pattern": "^(\\d{4}-\\d{2})?$",
            "type": "string",
            "description": "YYYY-MM. Leave empty for the latest complete month."
          },
          "area": {
            "title": "Area (trend report, fleet AFR)",
            "type": "string",
            "description": "Postcode area (for example SW) or outward code (for example SW1A). Applies to the forecourt-level parts."
          },
          "mpg": {
            "title": "Your fleet MPG (fleet AFR)",
            "minimum": 5,
            "maximum": 150,
            "type": "number",
            "description": "Leave empty to use HMRC's own mean MPG for each engine band."
          },
          "maxItems": {
            "title": "Maximum items",
            "minimum": 1,
            "type": "integer",
            "description": "Stop after this many dataset items. Station-level modes charge one event per item; report modes charge one event per run whatever the row count.",
            "default": 1000
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}