Sand AISand AI MAGI-2MAGI-2 jest teraz na SandBase: wideo 1080p z natywnym dźwiękiemWypróbuj teraz

AAA State Price Details

Dokumentacja API
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.

Cena
$0.01USD / wywołanie
Metoda
POST
Odpowiedź
Asynchroniczny JSON
Parametry
1 wymaganych · 0 opcjonalnych

Playground

Wejście
Two-letter US state code (e.g. TX, CA, NY, FL). All 50 states and DC are supported.
WyjścieGotowe

Twój wynik pojawi się tutaj

Uzupełnij dane wejściowe, a następnie kliknij Uruchom.

README API

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.

Odkryj więcej

Powiązane APIs

Wszystkie APIs
APICenaOdpowiedź
AAA$0.01 za wywołanieAsynchroniczny JSON
AAA$0.01 za wywołanieAsynchroniczny JSON
AAA$0.01 za wywołanieAsynchroniczny JSON
AAA$0.01 za wywołanieAsynchroniczny JSON
AAA$0.01 za wywołanieAsynchroniczny JSON
AAA$0.01 za wywołanieAsynchroniczny JSON

Pytania

FAQ

Jak używać API AAA State Price Details?

Wyślij żądanie POST do https://api.sandbase.ai/v1/api/aaa/state-price-details z kluczem API SandBase w nagłówku Authorization (Bearer) oraz parametrami w treści JSON. Możesz też wypróbować je w Playground na tej stronie bez pisania kodu.

Ile kosztuje API AAA State Price Details?

$0.01 za wywołanie, rozliczane z salda SandBase. Płacisz tylko za wykonane wywołania; nie ma subskrypcji.

Jakie parametry przyjmuje API AAA State Price Details?

Wymagane: state_code (string). Tabela Parameters oraz Playground na tej stronie zawierają wszystkie pola.

Co zwraca API AAA State Price Details?

Wynik JSON. Ten endpoint działa asynchronicznie, więc odpowiedź informuje, jak pobrać gotowy wynik. README na tej stronie zawiera przykładową odpowiedź.

Czy potrzebuję konta deweloperskiego AAA lub klucza API?

Nie. AAA State Price Details działa przez SandBase, więc jeden klucz API SandBase obejmuje ten endpoint i każde inne API oraz model w katalogu. Nie musisz osobno ubiegać się o dostęp do API AAA.