Sand AISand AI MAGI-2MAGI-2 agora está na SandBase: vídeo em 1080p com áudio nativoExperimente agora

AAA Price Change By State

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

Preço
$0.02USD / chamada
Método
POST
Resposta
JSON assíncrono
Parâmetros
1 obrigatórios · 0 opcionais

Playground

Entrada
Two-letter US state code (e.g. TX, CA, NY, FL). All 50 states and DC are supported.
SaídaPronto

Sua saída aparecerá aqui

Preencha as entradas e clique em Executar.

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

Explorar mais

APIs relacionadas

Todas as APIs
APIPreçoResposta
AAA$0.02 por chamadaJSON assíncrono
AAA$0.01 por chamadaJSON assíncrono
AAA$0.01 por chamadaJSON assíncrono
AAA$0.01 por chamadaJSON assíncrono
AAA$0.01 por chamadaJSON assíncrono
AAA$0.01 por chamadaJSON assíncrono

Perguntas

FAQ

Como eu uso a API AAA Price Change By State?

Envie uma solicitação POST para https://api.sandbase.ai/v1/api/aaa/price-change-by-state com sua chave de API da SandBase no cabeçalho Authorization (Bearer) e os parâmetros no corpo JSON. Você também pode testar no Playground desta página sem escrever código.

Quanto custa a API AAA Price Change By State?

$0.02 por chamada, cobrado do seu saldo SandBase. Você paga apenas pelas chamadas que fizer; não há assinatura.

Quais parâmetros a API AAA Price Change By State aceita?

Obrigatórios: state_code (string). A tabela de Parâmetros e o Playground nesta página listam todos os campos.

O que a API AAA Price Change By State retorna?

Um resultado JSON. Este endpoint é assíncrono, então a resposta informa como buscar o resultado final. O README desta página inclui um exemplo de resposta.

Preciso de uma conta de desenvolvedor AAA ou de uma chave de API?

Não. AAA Price Change By State funciona via SandBase, então uma única chave de API da SandBase cobre este endpoint e todas as outras APIs e modelos do catálogo. Você não precisa solicitar acesso à API do AAA separadamente.