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

AAA Price Change By State

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

Preis
$0.02USD / 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 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.

Mehr entdecken

Verwandte APIs

Alle APIs
APIPreisAntwort
AAA$0.02 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 Price Change By State API?

Senden Sie eine POST-Anfrage an https://api.sandbase.ai/v1/api/aaa/price-change-by-state 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 Price Change By State API?

$0.02 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 Price Change By State API?

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

Was gibt die AAA Price Change By State 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 Price Change By State 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.