# AAA API

> AAA returns average gasoline and diesel prices for the US, states, and metro areas as a workflow and API.

AAA, also called Triple-A, returns average gasoline and diesel prices for the US, a state, or a metro area using a location name or code. Get gas prices includes current prices, five comparison periods, and record-high diesel prices when shown; results use AAA’s displayed price date.

- Page: https://fous.com/workflows/aaa
- Handle: `@aaa`
- Category: [Energy](https://fous.com/workflows/category/energy)
- Source website: https://gasprices.aaa.com
- Last verified: Sep 29, 2026
- Fous is not affiliated with AAA.

## Methods

### Get gas prices

Operation `get_gas_prices`, version 1. 1 credit per call.

Get AAA average gasoline and diesel prices for the US, a state, or a metro area, including five comparison periods and record highs. Prices use the date shown by AAA, which may differ from today; metro areas are those listed on their state page.

**Input**

| Field | Type | Required | Example | Description |
|---|---|---|---|---|
| `location` | string | no | `"US"` | US, a state name or two-letter code, or a metro name followed by its state, for example Houston, TX. |

**Input schema**

```json
{
  "type": "object",
  "properties": {
    "location": {
      "type": "string",
      "default": "US",
      "description": "US, a state name or two-letter code, or a metro name followed by its state, for example Houston, TX.",
      "examples": [
        "US",
        "Houston, TX",
        "Texas"
      ]
    }
  },
  "additionalProperties": false,
  "examples": [
    {
      "location": "US"
    },
    {
      "location": "Houston, TX"
    },
    {
      "location": "Texas"
    }
  ]
}
```

**Output**

| Field | Type | Example | Description |
|---|---|---|---|
| `date` | string | `"2026-09-28"` | AAA price date (YYYY-MM-DD). |
| `link` | string | `"https://gasprices.aaa.com/"` | AAA price page for this location. |
| `place` | string | `"United States"` | The national, state, or metro location. |
| `current` | object |  | Current average prices per gallon in USD. |
| `current.diesel` | number or null | `6.4531` | Diesel price per gallon in USD. |
| `current.premium` | number or null | `5.3625` | Premium price per gallon in USD. |
| `current.regular` | number or null | `4.4768` | Regular price per gallon in USD. |
| `current.mid_grade` | number or null | `4.9689` | Mid-grade price per gallon in USD. |
| `currency` | string | `"USD"` | Currency of all prices, USD. |
| `week_ago` | object |  | One week ago average prices per gallon in USD. |
| `week_ago.diesel` | number or null | `6.5107` | Diesel price per gallon in USD. |
| `week_ago.premium` | number or null | `5.3545` | Premium price per gallon in USD. |
| `week_ago.regular` | number or null | `4.4786` | Regular price per gallon in USD. |
| `week_ago.mid_grade` | number or null | `4.9599` | Mid-grade price per gallon in USD. |
| `year_ago` | object |  | One year ago average prices per gallon in USD. |
| `year_ago.diesel` | number or null | `3.6856` | Diesel price per gallon in USD. |
| `year_ago.premium` | number or null | `3.9805` | Premium price per gallon in USD. |
| `year_ago.regular` | number or null | `3.1329` | Regular price per gallon in USD. |
| `year_ago.mid_grade` | number or null | `3.6216` | Mid-grade price per gallon in USD. |
| `month_ago` | object |  | One month ago average prices per gallon in USD. |
| `month_ago.diesel` | number or null | `5.6105` | Diesel price per gallon in USD. |
| `month_ago.premium` | number or null | `4.984` | Premium price per gallon in USD. |
| `month_ago.regular` | number or null | `4.0898` | Regular price per gallon in USD. |
| `month_ago.mid_grade` | number or null | `4.6021` | Mid-grade price per gallon in USD. |
| `yesterday` | object |  | Yesterday average prices per gallon in USD. |
| `yesterday.diesel` | number or null | `6.4709` | Diesel price per gallon in USD. |
| `yesterday.premium` | number or null | `5.3777` | Premium price per gallon in USD. |
| `yesterday.regular` | number or null | `4.4798` | Regular price per gallon in USD. |
| `yesterday.mid_grade` | number or null | `4.9891` | Mid-grade price per gallon in USD. |
| `record_high_diesel` | object or null |  | Highest recorded average price per gallon in USD and the date it occurred, if AAA shows it. |
| `record_high_diesel.date` | string | `"2026-09-22"` | Date the record was reached (YYYY-MM-DD). |
| `record_high_diesel.price` | number | `6.5276` | Record-high average price per gallon in USD. |
| `record_high_regular` | object or null |  | Highest recorded average price per gallon in USD and the date it occurred, if AAA shows it. |
| `record_high_regular.date` | string | `"2022-06-14"` | Date the record was reached (YYYY-MM-DD). |
| `record_high_regular.price` | number | `5.0165` | Record-high average price per gallon in USD. |

**Example input**

```json
{
  "location": "US"
}
```

**Example output**

```json
{
  "date": "2026-09-28",
  "link": "https://gasprices.aaa.com/",
  "place": "United States",
  "current": {
    "diesel": 6.4531,
    "premium": 5.3625,
    "regular": 4.4768,
    "mid_grade": 4.9689
  },
  "currency": "USD",
  "week_ago": {
    "diesel": 6.5107,
    "premium": 5.3545,
    "regular": 4.4786,
    "mid_grade": 4.9599
  },
  "year_ago": {
    "diesel": 3.6856,
    "premium": 3.9805,
    "regular": 3.1329,
    "mid_grade": 3.6216
  },
  "month_ago": {
    "diesel": 5.6105,
    "premium": 4.984,
    "regular": 4.0898,
    "mid_grade": 4.6021
  },
  "yesterday": {
    "diesel": 6.4709,
    "premium": 5.3777,
    "regular": 4.4798,
    "mid_grade": 4.9891
  },
  "record_high_diesel": {
    "date": "2026-09-22",
    "price": 6.5276
  },
  "record_high_regular": {
    "date": "2022-06-14",
    "price": 5.0165
  }
}
```

## Quick start

Call the API with a Fous API key (`FOUS_API_KEY`). To create one, turn on Developer mode in Fous Studio, then open Keys & connections → API keys (https://app.fous.com/keys).

```bash
# First set your key: export FOUS_API_KEY='YOUR_FOUS_API_KEY'
: "${FOUS_API_KEY:?Set FOUS_API_KEY before running this example}"

curl 'https://api.fous.com/v1/query' \
  --fail-with-body --silent --show-error --max-time 120 \
  -H "Authorization: Bearer $FOUS_API_KEY" \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "api": "@aaa",
  "visibility": "public",
  "operation": "get_gas_prices",
  "version": 1,
  "input": {
    "location": "US"
  },
  "response": {
    "format": "json"
  }
}'
```

```python
# Save as fous.py and run with python3 fous.py. No packages needed.
# First set your key: export FOUS_API_KEY='YOUR_FOUS_API_KEY'
import json
import os
import urllib.error
import urllib.request

api_key = os.environ.get("FOUS_API_KEY")
if not api_key:
    raise RuntimeError("Set FOUS_API_KEY before running this example")

body = json.loads("{\n  \"api\": \"@aaa\",\n  \"visibility\": \"public\",\n  \"operation\": \"get_gas_prices\",\n  \"version\": 1,\n  \"input\": {\n    \"location\": \"US\"\n  },\n  \"response\": {\n    \"format\": \"json\"\n  }\n}")
request = urllib.request.Request(
    "https://api.fous.com/v1/query",
    data=json.dumps(body).encode("utf-8"),
    headers={
        "Authorization": f"Bearer {api_key}",
        "Content-Type": "application/json",
    },
    method="POST",
)
try:
    with urllib.request.urlopen(request, timeout=120) as response:
        result = json.load(response)
except urllib.error.HTTPError as error:
    raise RuntimeError(f"HTTP {error.code}: {error.read().decode('utf-8', errors='replace')}") from error
if result.get("success") is False:
    raise RuntimeError(result.get("error", {}).get("message", "Request failed"))
print(json.dumps(result["data"]["output"], indent=2))
```

```typescript
// Save as fous.mts and run with npx tsx fous.mts.
// First set your key: export FOUS_API_KEY='YOUR_FOUS_API_KEY'
const apiKey = process.env.FOUS_API_KEY;
if (!apiKey) throw new Error("Set FOUS_API_KEY before running this example");

const response = await fetch("https://api.fous.com/v1/query", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${apiKey}`,
    "Content-Type": "application/json",
  },
  signal: AbortSignal.timeout(120_000),
  body: JSON.stringify({
  "api": "@aaa",
  "visibility": "public",
  "operation": "get_gas_prices",
  "version": 1,
  "input": {
    "location": "US"
  },
  "response": {
    "format": "json"
  }
}),
});
type ApiResult = { success: boolean; data?: { output: unknown }; error?: { message: string } };
const result: ApiResult = await response.json();
if (!response.ok || result.success === false) {
  throw new Error(result.error?.message ?? `HTTP ${response.status}`);
}
if (!result.data) throw new Error("Missing API response data");
console.log(result.data.output);
```

Or describe the data in plain language: send `{"api":"@aaa","prompt":"Describe the data you need, with every detail"}` to the same URL. Fous fills in the input, runs the method that fits and returns only the fields you asked for; `data.route.calls[].request` is the exact call it made. Routing is free; the run costs the same.

## Use cases

- Compare gasoline prices across states and metro areas
- Track diesel prices against earlier periods
- Review regular, mid-grade, and premium prices
- Check a location’s record-high diesel price

## FAQ

### Is Fous affiliated with AAA?

No. Fous is not affiliated with AAA. This workflow reads the public gasprices.aaa.com website and returns its data.

### How much does it cost?

Each run costs 1 credit. With pay-as-you-go, a credit costs 1¢; monthly plans cost less per credit.

### Do I need a AAA account?

No. You only need a Fous account.

### How current is the data?

Fous gets the data from gasprices.aaa.com when you run it; repeating the same request within a day may return the saved result. Fous checks this workflow automatically; it last passed a check on Sep 29, 2026.

### What are gas prices in a state or metro area?

Get gas prices returns average gasoline and diesel prices for the US, a state, or a metro area. Provide a location name or state code.

### How do current prices compare with earlier periods?

Get gas prices includes prices for yesterday, one week ago, one month ago, and one year ago, alongside current prices.

### What is the record-high diesel price?

Get gas prices returns the highest recorded average diesel price and its date, if AAA shows it.

## Related

- [GasBuddy API](https://fous.com/workflows/gasbuddy.md): GasBuddy finds stations and community-reported fuel prices in the US and Canada, with nearby prices that may be missing or out of date and regional averages that may lag the day.
- [US Energy Information Administration API](https://fous.com/workflows/us-energy-information-administration.md): US Energy Information Administration provides official energy statistics and analysis, including latest weekly fuel prices and preliminary monthly state electricity prices with historical comparisons.
- [Costco API](https://fous.com/workflows/costco.md): Costco returns US product prices/details and warehouse hours/services/gas prices; delivery affects availability, member prices may be hidden, and posted gas and holiday hours may differ.
- [FuelEconomy.gov API](https://fous.com/workflows/fueleconomy-gov.md): FuelEconomy.gov provides official vehicle fuel economy ratings, driving range, emissions, five-year savings, and annual fuel costs based on current fuel prices and EPA’s 15,000-mile annual driving assumption.
- [Etherscan API](https://fous.com/workflows/etherscan.md): Etherscan shows current gas prices, estimated costs, wallet balances, displayed token holdings and newest confirmed transactions, plus transaction status and details; pending fees are unconfirmed.
- [Alternative Fuels Data Center API](https://fous.com/workflows/alternative-fuels-data-center.md): U.S. Department of Energy data on alternative fuel stations and vehicles.
- [CarGurus API](https://fous.com/workflows/cargurus.md): CarGurus helps shoppers browse dealer-listed new and used cars with deal ratings, and view average used prices, price ranges and 12-month price history by model year.
- [Kitco API](https://fous.com/workflows/kitco.md): Precious metals spot prices and market coverage.
- [All Energy workflows](https://fous.com/workflows/category/energy)
