state_codestringआवश्यक
Two-letter US state code (e.g. TX, CA, NY, FL). All 50 states and DC are supported.
https://api.sandbase.ai/v1/api/aaa/price-change-by-metroReturns 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.
आपका आउटपुट यहाँ दिखाई देगा
इनपुट पूरा करें, फिर Run पर क्लिक करें।
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.
yesterday_change shows a sudden jump or drop.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.
| Name | Type | Required | Description |
|---|---|---|---|
state_code | string | Yes | Two-letter US state code (e.g. TX, CA, NY, FL). All 50 states and DC are supported. |
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"
}
| Field | Meaning |
|---|---|
data.state | Full name of the state the metros belong to, such as Washington. |
data.metro_price_changes[].metro | Name of the metro area. |
data.metro_price_changes[].changes | Changes for this metro, keyed by fuel grade: Regular, Mid-Grade, Premium and Diesel. |
data.metro_price_changes[].changes.Regular.yesterday_change | Difference 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_change | Difference 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_change | The same set of changes for Diesel. |
data.metro_price_changes[].changes.Mid-Grade | Same four change fields for Mid-Grade gas. |
data.metro_price_changes[].changes.Premium | Same four change fields for Premium gas. |
status | Shows success when the call worked. |
state_code. The response returns the full state name in data.state.changes, and Mid-Grade includes a hyphen.-0.012. Negative values mean the current value is lower than the earlier one.$0.01 per successful call. Failed calls are not charged. It is included in the daily free quota of each organization.
बिल्डिंग शुरू करें
एकीकृत authentication और usage tracking के साथ Platform API endpoint.
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"
}'अपने SandBase API key को अपने सर्वर environment में सेट करें। Requests Bearer authentication का उपयोग करती हैं।
export SANDBASE_API_KEY="YOUR_API_KEY"अपना key सर्वर पर रखें। इसे browser code में expose न करें।
state_codestringआवश्यकTwo-letter US state code (e.g. TX, CA, NY, FL). All 50 states and DC are supported.
इस API के लिए सेव किया गया example response; इसे देखते समय कोई live request नहीं की जाती।
कोई सेव response प्रकाशित नहीं किया गया है। इसका response देखने के लिए Playground में API चलाएँ।
और जानें
| 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 |
प्रश्न
https://api.sandbase.ai/v1/api/aaa/price-change-by-metro पर Authorization header (Bearer) में अपनी SandBase API key और parameters को JSON body के रूप में भेजें। आप इस पेज के Playground में बिना code लिखे भी इसे आज़मा सकते हैं।
$0.01 प्रति call, आपकी SandBase balance से बिल किया जाएगा। आपसे केवल आपके किए गए calls के लिए शुल्क लिया जाता है; कोई subscription नहीं है।
आवश्यक: state_code (string)। Parameters table और इस पेज का Playground हर field सूचीबद्ध करते हैं।
एक JSON result। यह endpoint asynchronously चलता है, इसलिए response आपको बताता है कि तैयार result कैसे प्राप्त करना है। इस पेज का README एक sample response शामिल करता है।
नहीं। AAA Price Change By Metro SandBase के माध्यम से चलता है, इसलिए एक SandBase API key इस endpoint और catalog के हर अन्य API और model को कवर करती है। आपको अलग से AAA API access के लिए आवेदन करने की आवश्यकता नहीं है।