Sand AISand AI MAGI-2MAGI-2 est maintenant sur SandBase : vidéo 1080p avec audio natifEssayer maintenant

AAA State Price Details

Docs 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.

Prix
$0.01USD / appel
Méthode
POST
Réponse
JSON asynchrone
Paramètres
1 obligatoires · 0 facultatifs

Bac à sable

Entrée
Two-letter US state code (e.g. TX, CA, NY, FL). All 50 states and DC are supported.
SortiePrêt

Votre sortie apparaîtra ici

Complétez les entrées, puis cliquez sur Exécuter.

README de l'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.

Explorer plus

APIs associées

Toutes les APIs
APIPrixRéponse
AAA$0.01 par appelJSON asynchrone
AAA$0.01 par appelJSON asynchrone
AAA$0.01 par appelJSON asynchrone
AAA$0.01 par appelJSON asynchrone
AAA$0.01 par appelJSON asynchrone
AAA$0.01 par appelJSON asynchrone

Questions

FAQ

Comment utiliser l’API AAA State Price Details ?

Envoyez une requête POST à https://api.sandbase.ai/v1/api/aaa/state-price-details avec votre clé API SandBase dans l’en-tête Authorization (Bearer) et les paramètres dans un corps JSON. Vous pouvez aussi l’essayer dans le Playground sur cette page sans écrire de code.

Combien coûte l’API AAA State Price Details ?

$0.01 par appel, facturé depuis votre solde SandBase. Vous ne payez que les appels que vous effectuez ; aucun abonnement.

Quels paramètres l’API AAA State Price Details accepte-t-elle ?

Obligatoire : state_code (string). Le tableau des paramètres et le Playground sur cette page listent tous les champs.

Que renvoie l’API AAA State Price Details ?

Un résultat JSON. Ce point de terminaison s’exécute de manière asynchrone, donc la réponse vous indique comment récupérer le résultat final. Le README sur cette page inclut un exemple de réponse.

Ai-je besoin d’un compte développeur ou d’une clé API AAA ?

Non. AAA State Price Details fonctionne via SandBase, donc une seule clé API SandBase couvre ce point de terminaison ainsi que toutes les autres API et tous les modèles du catalogue. Vous n’avez pas besoin de demander un accès API AAA séparément.