Sand AISand AI MAGI-2MAGI-2 现已上线 SandBase:支持原生音频的 1080p 视频立即试用

AAA Price Change By Metro

API 文档
https://api.sandbase.ai/v1/api/aaa/price-change-by-metro

Returns price changes for all metro areas within a given state, showing the difference between current and historical prices for each fuel grade. Includes yesterday_change, week_ago_change, month_ago_change, and.

价格
$0.01美元 / 次调用
方法
POST
响应
异步 JSON
参数
1 个必填 · 0 个可选

Playground

输入
Two-letter US state code (e.g. TX, CA, NY, FL). All 50 states and DC are supported.
输出就绪

您的输出将显示在这里

完成输入,然后点击运行。

API README

AAA Price Change By Metro

Returns gas and diesel changes since yesterday, last week, last month and last year for every metro area in a US state. It needs a two-letter state_code such as WA. Each metro lists changes for Regular, Mid-Grade, Premium and Diesel.

Use cases

  • Compare how fast Regular gas is moving in Bellingham, Bremerton and Olympia.
  • Flag metros where yesterday_change shows a sudden jump or drop.
  • Chart month over month and year over year fuel trends for a state.
  • Add local fuel trends to a logistics or fleet dashboard.

Request

curl -X POST "https://api.sandbase.ai/v1/api/aaa/price-change-by-metro" \
  -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": {
    "metro_price_changes": [
      {
        "changes": {
          "Diesel": {
            "month_ago_change": -0.179,
            "week_ago_change": -0.04,
            "year_ago_change": 2.101,
            "yesterday_change": -0.064
          },
          "Mid-Grade": {
            "month_ago_change": -0.349,
            "week_ago_change": 0.069,
            "year_ago_change": 1.144,
            "yesterday_change": -0.039
          },
          "Premium": {
            "month_ago_change": -0.332,
            "week_ago_change": 0.039,
            "year_ago_change": 0.995,
            "yesterday_change": 0.042
          },
          "Regular": {
            "month_ago_change": -0.356,
            "week_ago_change": -0.124,
            "year_ago_change": 1.012,
            "yesterday_change": -0.012
          }
        },
        "metro": "Bellingham"
      }
    ],
    "state": "Washington"
  },
  "status": "success"
}

Response fields

FieldMeaning
data.stateFull name of the state the metros belong to, such as Washington.
data.metro_price_changes[].metroName of the metro area.
data.metro_price_changes[].changesChanges for this metro, keyed by fuel grade: Regular, Mid-Grade, Premium and Diesel.
data.metro_price_changes[].changes.Regular.yesterday_changeDifference between the current Regular value and yesterday's value for this metro.
data.metro_price_changes[].changes.Regular.week_ago_change / month_ago_change / year_ago_changeDifference between the current Regular value and the value one week, one month or one year ago.
data.metro_price_changes[].changes.Diesel.yesterday_change / week_ago_change / month_ago_change / year_ago_changeThe same set of changes for Diesel.
data.metro_price_changes[].changes.Mid-GradeSame four change fields for Mid-Grade gas.
data.metro_price_changes[].changes.PremiumSame four change fields for Premium gas.
statusShows success when the call worked.

Notes

  • Pass the two-letter state code in state_code. The response returns the full state name in data.state.
  • The fuel grades are object keys under changes, and Mid-Grade includes a hyphen.
  • Change values are decimals with up to three places, such as -0.012. Negative values mean the current value is lower than the earlier one.

Pricing

$0.01 per successful call. Failed calls are not charged. It is included in the daily free quota of each organization.

探索更多

相关 APIs

全部 APIs
API价格响应
AAA$0.01 每次调用异步 JSON
AAA$0.01 每次调用异步 JSON
AAA$0.01 每次调用异步 JSON
AAA$0.01 每次调用异步 JSON
AAA$0.01 每次调用异步 JSON
AAA$0.01 每次调用异步 JSON

问题

常见问题

如何使用 AAA Price Change By Metro API?

向 https://api.sandbase.ai/v1/api/aaa/price-change-by-metro 发送 POST 请求,在 Authorization 请求头中使用您的 SandBase API key(Bearer),并将参数作为 JSON 请求体传入。您也可以直接在本页的 Playground 中试用,无需编写代码。

AAA Price Change By Metro API 的价格是多少?

每次调用 $0.01,从您的 SandBase 余额中扣费。您只需为实际调用付费;无需订阅。

AAA Price Change By Metro API 接受哪些参数?

必填:state_code (string)。 Parameters 表和本页的 Playground 列出了每个字段。

AAA Price Change By Metro API 返回什么?

JSON 结果。此端点异步运行,因此响应会告诉您如何获取已完成的结果。 本页的 README 包含一个示例响应。

我需要 AAA 开发者账户或 API key 吗?

不需要。AAA Price Change By Metro 通过 SandBase 运行,因此一个 SandBase API key 即可覆盖此端点以及目录中的其他所有 API 和模型。您无需单独申请 AAA API 访问权限。