Sand AISand AI MAGI-2MAGI-2 kini tersedia di SandBase: video 1080p dengan audio nativeCoba sekarang

AAA Price Change By State

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

Harga
$0.02USD / panggilan
Metode
POST
Respons
JSON Asinkron
Parameter
1 wajib · 0 opsional

Playground

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

Output Anda akan muncul di sini

Lengkapi input, lalu klik Run.

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

Jelajahi lebih lanjut

API Terkait

Semua APIs
APIHargaRespons
AAA$0.02 per panggilanJSON Asinkron
AAA$0.01 per panggilanJSON Asinkron
AAA$0.01 per panggilanJSON Asinkron
AAA$0.01 per panggilanJSON Asinkron
AAA$0.01 per panggilanJSON Asinkron
AAA$0.01 per panggilanJSON Asinkron

Pertanyaan

FAQ

Bagaimana cara menggunakan API AAA Price Change By State?

Kirim permintaan POST ke https://api.sandbase.ai/v1/api/aaa/price-change-by-state dengan kunci API SandBase Anda di header Authorization (Bearer) dan parameter sebagai body JSON. Anda juga dapat mencobanya di Playground di halaman ini tanpa menulis kode.

Berapa biaya API AAA Price Change By State?

$0.02 per panggilan, ditagihkan dari saldo SandBase Anda. Anda hanya dikenai biaya untuk panggilan yang Anda lakukan; tidak ada langganan.

Parameter apa yang diterima API AAA Price Change By State?

Wajib: state_code (string). Tabel Parameters dan Playground di halaman ini mencantumkan setiap field.

Apa yang dikembalikan API AAA Price Change By State?

Hasil JSON. Endpoint ini berjalan secara asinkron, jadi responsnya memberi tahu cara mengambil hasil yang sudah selesai. README di halaman ini menyertakan contoh respons.

Apakah saya memerlukan akun developer atau kunci API AAA?

Tidak. AAA Price Change By State berjalan melalui SandBase, jadi satu kunci API SandBase mencakup endpoint ini dan setiap API serta model lain di katalog. Anda tidak perlu mendaftar akses API AAA secara terpisah.