{
  "openapi": "3.0.1",
  "info": {
    "title": "Fuel Prices Scraper",
    "description": "Daily US fuel prices (regular, mid-grade, premium, diesel) at national, state, and metro level. HTTP-only, no proxy, no auth. Filters: states allowlist, fuelTypes, minPrice/maxPrice, sortBy. Source: AAA Fuel Gauge.",
    "version": "1.0",
    "x-build-id": "pm95udYAU64G965cK"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/crawlerbros~fuel-prices-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-crawlerbros-fuel-prices-scraper",
        "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/crawlerbros~fuel-prices-scraper/runs": {
      "post": {
        "operationId": "runs-sync-crawlerbros-fuel-prices-scraper",
        "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/crawlerbros~fuel-prices-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-crawlerbros-fuel-prices-scraper",
        "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": [
              "national",
              "state",
              "metro"
            ],
            "type": "string",
            "description": "What to scrape. `national` = single record (US average). `state` = 51 records (50 states + DC) with current/yesterday/week/month/year-ago prices. `metro` = metro/county-level prices for the requested states.",
            "default": "state"
          },
          "states": {
            "title": "States allowlist",
            "type": "array",
            "description": "Two-letter state codes (e.g. `NY`, `CA`, `TX`). Empty = all 50 states + DC. For `mode=metro`, this controls which state pages get scraped.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "fuelTypes": {
            "title": "Fuel types",
            "type": "array",
            "description": "Which fuel grades to include in each record. Empty = all four (regular, midGrade, premium, diesel).",
            "items": {
              "type": "string",
              "enum": [
                "regular",
                "midGrade",
                "premium",
                "diesel"
              ],
              "enumTitles": [
                "Regular",
                "Mid-grade",
                "Premium",
                "Diesel"
              ]
            },
            "default": [
              "regular",
              "midGrade",
              "premium",
              "diesel"
            ]
          },
          "includeHistory": {
            "title": "Include price history",
            "type": "boolean",
            "description": "When true (state/metro modes), include yesterday/week-ago/month-ago/year-ago averages. Default true.",
            "default": true
          },
          "minPrice": {
            "title": "Min price (USD/gal)",
            "minimum": 0,
            "maximum": 20,
            "type": "number",
            "description": "Drop records whose primary fuel (regular by default) is below this price."
          },
          "maxPrice": {
            "title": "Max price (USD/gal)",
            "minimum": 0,
            "maximum": 20,
            "type": "number",
            "description": "Drop records whose primary fuel (regular by default) is above this price."
          },
          "primaryFuelType": {
            "title": "Primary fuel type for filters/sort",
            "enum": [
              "regular",
              "midGrade",
              "premium",
              "diesel"
            ],
            "type": "string",
            "description": "Which fuel grade is used by `minPrice` / `maxPrice` / `sortBy` filters. Default: regular.",
            "default": "regular"
          },
          "sortBy": {
            "title": "Sort by",
            "enum": [
              "price_asc",
              "price_desc",
              "state_asc"
            ],
            "type": "string",
            "description": "How to order emitted records. Cheapest-first / most-expensive-first / alphabetical by state.",
            "default": "state_asc"
          },
          "includeChangeMetrics": {
            "title": "Include derived change metrics",
            "type": "boolean",
            "description": "When true and history is fetched, also emit `changeFromYesterday`, `changeFromWeekAgo`, `changeFromMonthAgo`, `changeFromYearAgo` (in cents).",
            "default": true
          },
          "metroNameFilter": {
            "title": "Metro name filter (mode=metro only)",
            "type": "array",
            "description": "Only emit metro records whose name contains one of these substrings (case-insensitive). e.g. ['New York','Los Angeles'].",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "maxItems": {
            "title": "Max items",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "Hard cap on emitted records.",
            "default": 500
          }
        }
      },
      "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
                  }
                }
              },
              "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}