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

AAA Price Change By State

Docs API
https://api.sandbase.ai/v1/api/aaa/price-change-by-state

Returns the price change (delta) for a state between the current price and historical averages (day, week, month, year) for all fuel grades. Positive values indicate prices have risen; negative values indicate prices.

Prix
$0.02USD / 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 Price Change By State

Returns how AAA fuel prices in one US state have changed over the last day, week, month and year. The response covers Regular, Mid-Grade, Premium and Diesel. It needs a two-letter state_code.

Use cases

  • Show a dashboard card that tells drivers in a state whether gas got cheaper or more expensive this week.
  • Compare year-over-year diesel change in a state to track fleet fuel costs.
  • Flag states where Regular prices moved the most over the past month.
  • Add a short price trend line to a travel or road-trip planning app.

Request

curl -X POST "https://api.sandbase.ai/v1/api/aaa/price-change-by-state" \
  -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": {
    "price_changes": {
      "Diesel": {
        "day_change": -0.017,
        "month_change": -0.123,
        "week_change": -0.013,
        "year_change": 2.272
      },
      "Mid-Grade": {
        "day_change": -0.013,
        "month_change": -0.32,
        "week_change": -0.114,
        "year_change": 0.879
      },
      "Premium": {
        "day_change": -0.01,
        "month_change": -0.309,
        "week_change": -0.093,
        "year_change": 0.896
      },
      "Regular": {
        "day_change": -0.011,
        "month_change": -0.297,
        "week_change": -0.112,
        "year_change": 0.907
      }
    },
    "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 changes apply to.
data.price_changes.RegularPrice changes for Regular gas. Other grades use the same structure: Mid-Grade, Premium and Diesel.
data.price_changes.Regular.day_changeChange between the current price and the price one day ago. A negative value means the price fell.
data.price_changes.Regular.week_changeChange between the current price and the price one week ago.
data.price_changes.Regular.month_changeChange between the current price and the price one month ago.
data.price_changes.Regular.year_changeChange between the current price and the price one year ago. A positive value means the price rose.
data.price_changes.Diesel.day_change / week_change / month_change / year_changeThe same four changes for Diesel.
statusShows success when the call worked.

Notes

  • Pass state_code as a two-letter US state code such as WA. DC is also supported.
  • The changes are numeric differences, not percentages. Positive values mean prices rose and negative values mean they fell.
  • For the current price levels, call AAA State Gas Prices.
  • For metro-level changes, call AAA Price Change By Metro.

Pricing

$0.02 per successful call. Failed calls are not charged.

Explorer plus

APIs associées

Toutes les APIs
APIPrixRéponse
AAA$0.02 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 Price Change By State ?

Envoyez une requête POST à https://api.sandbase.ai/v1/api/aaa/price-change-by-state 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 Price Change By State ?

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

Quels paramètres l’API AAA Price Change By State 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 Price Change By State ?

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 Price Change By State 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.