Sand AISand AI MAGI-2MAGI-2 ist jetzt auf SandBase: 1080p-Video mit nativem AudioJetzt testen

AAA State Price Details

API-Dokumentation
https://api.sandbase.ai/v1/api/aaa/state-price-details

Returns detailed gas price data for a specific state including current prices for all fuel grades, historical averages (yesterday, week ago, month ago, year ago), and all-time highest recorded prices with their dates.

Preis
$0.01USD / Aufruf
Methode
POST
Antwort
Asynchrones JSON
Parameter
1 erforderlich · 0 optional

Playground

Eingabe
Two-letter US state code (e.g. TX, CA, NY, FL). All 50 states and DC are supported.
AusgabeBereit

Ihre Ausgabe wird hier angezeigt

Vervollständigen Sie die Eingaben und klicken Sie dann auf Ausführen.

API-README

AAA State Price Details

Returns AAA gas prices for one US state. Each fuel grade has a current price and past prices from yesterday, a week ago, a month ago and a year ago, plus the highest recorded price with its date. Send a two-letter state_code.

Use cases

  • Show the current Regular and Diesel price for a state in a fuel cost calculator.
  • Compare today's Washington price with the price a month ago and a year ago to chart a trend.
  • Check how far current diesel prices sit below the highest recorded diesel price for a state.
  • Compare Regular, Mid-Grade and Premium prices in a state to estimate the cost of a higher grade.

Request

curl -X POST "https://api.sandbase.ai/v1/api/aaa/state-price-details" \
  -H "Authorization: Bearer $SANDBASE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"state_code": "WA"}'

The result is returned in outputs[0].data.

Parameters

NameTypeRequiredDescription
state_codestringYesTwo-letter US state code (e.g. TX, CA, NY, FL). All 50 states and DC are supported.

Example response

Real response for the request above, trimmed: lists keep their first item and long strings are cut.

{
  "data": {
    "highest_recorded": {
      "Diesel": {
        "date": "9/23/26",
        "price": "7.4697"
      },
      "Regular Unleaded": {
        "date": "5/20/26",
        "price": "5.7887"
      }
    },
    "prices": {
      "Diesel": {
        "current": 7.2512,
        "month_ago": 7.3739,
        "week_ago": 7.2642,
        "year_ago": 4.9787,
        "yesterday": 7.2685
      },
      "Mid-Grade": {
        "current": 5.4442,
        "month_ago": 5.7645,
        "week_ago": 5.5587,
        "year_ago": 4.5651,
        "yesterday": 5.4577
      },
      "Premium": {
        "current": 5.7146,
        "month_ago": 6.0237,
        "week_ago": 5.8074,
        "year_ago": 4.8184,
        "yesterday": 5.7243
      },
      "Regular": {
        "current": 5.1925,
        "month_ago": 5.4891,
        "week_ago": 5.3047,
        "year_ago": 4.2855,
        "yesterday": 5.203
      }
    },
    "state_code": "WA",
    "state_name": "Washington"
  },
  "status": "success"
}

Response fields

FieldMeaning
data.state_code / data.state_nameThe two-letter code and full name of the state the prices describe.
data.prices.Regular.currentCurrent price for Regular fuel in the state. Mid-Grade, Premium and Diesel use the same structure under data.prices.
data.prices.Diesel.currentCurrent price for Diesel in the state.
data.prices.Regular.yesterday / data.prices.Regular.week_ago / data.prices.Regular.month_ago / data.prices.Regular.year_agoRegular price at each earlier point in time. The other grades have the same keys, so you can compare change over time.
data.highest_recordedHighest recorded price for each fuel grade, with the date it was recorded. Each entry holds a price string and a date string in M/D/YY format.
data.highest_recorded.Diesel.price / dateHighest recorded Diesel price and the date it was recorded.
statusShows success when the call worked.

Notes

  • Use the two-letter postal code for state_code, such as WA. The description says all 50 states and DC are supported.
  • Current and past prices under data.prices are numbers. Prices under data.highest_recorded are strings.
  • The grade names differ between sections: data.prices uses Regular, while data.highest_recorded labels the regular grade Regular Unleaded. Mid-Grade and Premium appear only under data.prices.
  • For city-level prices in a state, call AAA Metro Prices By State. For a national figure, call AAA National Average.

Pricing

$0.01 per successful call. Failed calls are not charged. It is included in the daily free quota of each organization.

Mehr entdecken

Verwandte APIs

Alle APIs
APIPreisAntwort
AAA$0.01 pro AufrufAsynchrones JSON
AAA$0.01 pro AufrufAsynchrones JSON
AAA$0.01 pro AufrufAsynchrones JSON
AAA$0.01 pro AufrufAsynchrones JSON
AAA$0.01 pro AufrufAsynchrones JSON
AAA$0.01 pro AufrufAsynchrones JSON

Fragen

FAQ

Wie verwende ich die AAA State Price Details API?

Senden Sie eine POST-Anfrage an https://api.sandbase.ai/v1/api/aaa/state-price-details mit Ihrem SandBase API-Schlüssel im Authorization-Header (Bearer) und den Parametern als JSON-Body. Sie können das auch ohne Code direkt auf dieser Seite im Playground testen.

Was kostet die AAA State Price Details API?

$0.01 pro Aufruf, abgerechnet von Ihrem SandBase-Guthaben. Es werden nur die von Ihnen getätigten Aufrufe berechnet; es gibt kein Abo.

Welche Parameter akzeptiert die AAA State Price Details API?

Erforderlich: state_code (string). Die Parametertabelle und der Playground auf dieser Seite listen jedes Feld auf.

Was gibt die AAA State Price Details API zurück?

Ein JSON-Ergebnis. Dieser Endpunkt läuft asynchron, daher zeigt die Antwort, wie Sie das fertige Ergebnis abrufen. Die README auf dieser Seite enthält eine Beispielantwort.

Benötige ich ein AAA-Entwicklerkonto oder einen API-Schlüssel?

Nein. AAA State Price Details läuft über SandBase, daher deckt ein SandBase API-Schlüssel diesen Endpunkt und jede andere API sowie jedes Modell im Katalog ab. Sie müssen keinen separaten Zugang für AAA API beantragen.