{
  "openapi": "3.0.1",
  "info": {
    "title": "AAA Gas Prices Scraper & Monitor - US National & State Averages",
    "description": "AAA gas prices from the public AAA Fuel Prices pages: US national average, all 50 states + DC and metro areas, for regular, mid-grade, premium, diesel and E85, with the page date. Monitoring mode returns only areas whose price changed, with the previous price. Unofficial.",
    "version": "0.1",
    "x-build-id": "krTIELQiB6h3zhdCO"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/neverempty~aaa-gas-prices-monitor/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-neverempty-aaa-gas-prices-monitor",
        "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/neverempty~aaa-gas-prices-monitor/runs": {
      "post": {
        "operationId": "runs-sync-neverempty-aaa-gas-prices-monitor",
        "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/neverempty~aaa-gas-prices-monitor/run-sync": {
      "post": {
        "operationId": "run-sync-neverempty-aaa-gas-prices-monitor",
        "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": {
          "states": {
            "title": "States",
            "type": "array",
            "description": "US states to return, one per line: two-letter codes (TX, CA, NY, DC) or names (Texas). Write all for the 50 states and DC. All states come from one AAA page (one request), so all costs the same time as one. Something that is not a state comes back as a free row that says so. Empty = no state rows, only the national average.",
            "items": {
              "type": "string"
            }
          },
          "skipNational": {
            "title": "Skip the national average",
            "type": "boolean",
            "description": "Off (or empty) = the run also returns one row for the US national average: regular, mid-grade, premium, diesel and E85, each for today, yesterday, a week ago, a month ago and a year ago. On = only the states you listed."
          },
          "includeMetros": {
            "title": "Include metro areas (reads each state's own page)",
            "type": "boolean",
            "description": "On = for each state in States, read that state's own AAA page and return one row for the state (with yesterday, week-ago, month-ago and year-ago prices) plus one row for every metro area AAA lists in it (Texas has 27, California 31). AAA's robots.txt asks for 10 seconds between requests, so each state adds about 10 seconds: all 51 take about 9 minutes and return several hundred rows. Off (or empty) = state rows come from the one state table, with today's prices only."
          },
          "monitoringMode": {
            "title": "Monitoring mode (only return price changes)",
            "type": "boolean",
            "description": "On = for scheduled runs and alerts. The first run remembers today's prices as a starting point and returns no price rows (free). Later runs return a row only for an area whose price changed, with the previous price and the difference. A run where nothing changed costs one check and returns a free no-change row. AAA updates once a day, so one or two runs a day is enough. Off (or empty) = always return every area."
          },
          "minChangeUsd": {
            "title": "Report a change of at least this many dollars",
            "pattern": "^\\s*\\$?\\d*\\.?\\d+\\s*$",
            "type": "string",
            "description": "Monitoring mode only. For example 0.02 = return an area only when a watched fuel differs by 2 cents or more from the price in the last row you received for that area (or from the starting point). Small daily moves add up: three days of +1 cent are returned on the day the total reaches the amount. Empty = any change (AAA shows four decimals)."
          },
          "fuels": {
            "title": "Fuels to watch",
            "type": "array",
            "description": "Monitoring mode only. An area is returned when one of these fuels changed. Every row still carries all fuels. Empty = all fuels. Pick only Regular to follow the number most people quote.",
            "items": {
              "type": "string",
              "enum": [
                "regular",
                "mid-grade",
                "premium",
                "diesel",
                "e85"
              ],
              "enumTitles": [
                "Regular",
                "Mid-Grade",
                "Premium",
                "Diesel",
                "E85 (national only)"
              ]
            }
          },
          "watchName": {
            "title": "Watch name",
            "pattern": "^[A-Za-z0-9._-]{0,40}$",
            "type": "string",
            "description": "Optional, used with monitoring mode. Runs with the same watch name share what is remembered. Give a different name to each schedule. Do not run two schedules with the same watch name at the same time. Letters, digits, dot, dash and underscore."
          },
          "resetMonitoringState": {
            "title": "Reset monitoring state",
            "type": "boolean",
            "description": "Forget what this watch remembered at the start of this run, so every area gets a new starting point. Turn it off again for scheduled runs."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}