# 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/tools/aaa
- Handle: `@aaa`
- Category: [Energy](https://fous.com/tools/category/energy)
- Source website: https://gasprices.aaa.com
- Last verified: Sep 29, 2026

## Methods

### Get gas prices

Operation `get_gas_prices`, version 1. 1 credit per completed call. Failed calls without a completed billing receipt are free; completed work can remain charged if delivery is interrupted.

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

Replace `YOUR_API_KEY` with a Fous API key. To create one, open Developers at the bottom of Fous Studio, turn on Developer mode, then go to API keys (https://app.fous.com/keys). Change the values in `input` to run the same tool on new data.

```bash
curl 'https://api.fous.com/v1/query' \
  --fail-with-body --silent --show-error --max-time 180 \
  -H "Authorization: Bearer YOUR_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.
import json
import urllib.error
import urllib.request

api_key = "YOUR_API_KEY"

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=180) 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.
const apiKey = "YOUR_API_KEY";

const response = await fetch("https://api.fous.com/v1/query", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${apiKey}`,
    "Content-Type": "application/json",
  },
  signal: AbortSignal.timeout(180_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);
```

## Use from an AI assistant

Connect this tool to Claude Code, Claude Desktop, Cursor, VS Code, Codex and any MCP client as its own MCP server. Each method is a typed tool whose arguments are the method’s input.

- Server URL: `https://api.fous.com/mcp/tools/aaa`
- Authorization: `Authorization: Bearer <Fous API key>`

**Tools**

- `get_gas_prices`: Get gas prices. 1 credit per completed call. Failed calls without a completed billing receipt are free; completed work can remain charged if delivery is interrupted.
- `fous_get_run`: the result of a run that was still going, by its `request_id`. Free.

Claude Code:

```bash
claude mcp add --scope user --transport http fous-aaa https://api.fous.com/mcp/tools/aaa --header "Authorization: Bearer ${FOUS_API_KEY:?Set FOUS_API_KEY to your Fous API key}"
```

To give the assistant every tool, connect `https://api.fous.com/mcp`: it finds one with `fous_search_tools` and runs it with `fous_run_tool`. Setup for other clients: https://fous.com/llms-full.txt.

## 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

### Can I run it with my own inputs?

Yes. Change the inputs in Studio and press Run, or send new inputs from your code, or ask a connected AI assistant.

### Can I call this AAA tool as an API?

Yes. Send a POST request to /v1/query with your Fous API key and the inputs, and get JSON back.

### How much does it cost?

Each completed run costs 1 credit. Failed runs without a completed receipt are free; completed work can remain charged if delivery is interrupted. 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. Some results are reused for up to 24 hours, and results that use your account or key are never reused. It was last verified 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/tools/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/tools/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/tools/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/tools/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/tools/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/tools/alternative-fuels-data-center.md): U.S. Department of Energy data on alternative fuel stations and vehicles.
- [CarGurus API](https://fous.com/tools/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/tools/kitco.md): Precious metals spot prices and market coverage.
- [All Energy tools](https://fous.com/tools/category/energy)
