Sand AISand AI MAGI-2MAGI-2 теперь на SandBase: видео 1080p с нативным звукомПопробовать сейчас

AAA Price Change By State

Документация 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.

Цена
$0.02USD / вызов
Метод
POST
Ответ
Асинхронный JSON
Параметры
1 обязательных · 0 необязательных

Песочница

Ввод
Two-letter US state code (e.g. TX, CA, NY, FL). All 50 states and DC are supported.
ВыходГотово

Ваш результат появится здесь

Заполните входные данные, затем нажмите «Запустить».

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.

Посмотреть больше

Связанные APIs

Все APIs
APIЦенаОтвет
AAA$0.02 за запросАсинхронный JSON
AAA$0.01 за запросАсинхронный JSON
AAA$0.01 за запросАсинхронный JSON
AAA$0.01 за запросАсинхронный JSON
AAA$0.01 за запросАсинхронный JSON
AAA$0.01 за запросАсинхронный JSON

Вопросы

FAQ

Как использовать API AAA Price Change By State?

Отправьте POST-запрос на https://api.sandbase.ai/v1/api/aaa/price-change-by-state, указав ключ SandBase API в заголовке Authorization (Bearer), а параметры — в теле JSON. Вы также можете попробовать это в Playground на этой странице без написания кода.

Сколько стоит API AAA Price Change By State?

$0.02 за вызов, списывается с баланса SandBase. Оплата взимается только за сделанные вызовы; подписка не требуется.

Какие параметры принимает API AAA Price Change By State?

Обязательные: state_code (string). В таблице Parameters и в Playground на этой странице перечислены все поля.

Что возвращает API AAA Price Change By State?

JSON-результат. Этот endpoint работает асинхронно, поэтому ответ подсказывает, как получить готовый результат. В README на этой странице приведен пример ответа.

Нужен ли мне аккаунт разработчика AAA или API key?

Нет. AAA Price Change By State работает через SandBase, поэтому один API key SandBase покрывает этот endpoint и все остальные API и модели в каталоге. Вам не нужно отдельно запрашивать доступ к API AAA.