Sand AISand AI MAGI-2ตอนนี้ MAGI-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.01USD / คำขอ
Method
POST
การตอบกลับ
Async JSON
พารามิเตอร์
1 จำเป็น · 0 ไม่บังคับ

Playground

อินพุต
Two-letter US state code (e.g. TX, CA, NY, FL). All 50 states and DC are supported.
เอาต์พุตพร้อมใช้งาน

เอาต์พุตของคุณจะแสดงที่นี่

กรอกอินพุตให้ครบ แล้วคลิก Run

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 ต่อการเรียกAsync JSON
AAA$0.01 ต่อการเรียกAsync JSON
AAA$0.01 ต่อการเรียกAsync JSON
AAA$0.01 ต่อการเรียกAsync JSON
AAA$0.01 ต่อการเรียกAsync JSON
AAA$0.01 ต่อการเรียกAsync JSON

คำถาม

คำถามที่พบบ่อย

ฉันจะใช้ AAA Price Change By Metro API ได้อย่างไร?

ส่งคำขอ POST ไปที่ https://api.sandbase.ai/v1/api/aaa/price-change-by-metro โดยใส่ SandBase API key ของคุณใน Authorization header (Bearer) และส่งพารามิเตอร์เป็น JSON body คุณยังสามารถลองใช้ได้ใน 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 บนหน้านี้มีตัวอย่างการตอบกลับ

ฉันจำเป็นต้องมีบัญชีนักพัฒนาหรือ API key ของ AAA ไหม?

ไม่จำเป็น AAA Price Change By Metro ทำงานผ่าน SandBase ดังนั้น SandBase API key เดียวครอบคลุม endpoint นี้และทุก API กับโมเดลอื่นในแค็ตตาล็อก คุณไม่ต้องสมัครขอสิทธิ์เข้าถึง AAA API แยกต่างหาก