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-stateReturns 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.
आपका आउटपुट यहाँ दिखाई देगा
इनपुट पूरा करें, फिर Run पर क्लिक करें।
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.
Regular prices moved the most over the past month.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.
| 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": {
"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"
}
| Field | Meaning |
|---|---|
data.state_code / data.state_name | The two-letter code and full name of the state the changes apply to. |
data.price_changes.Regular | Price changes for Regular gas. Other grades use the same structure: Mid-Grade, Premium and Diesel. |
data.price_changes.Regular.day_change | Change between the current price and the price one day ago. A negative value means the price fell. |
data.price_changes.Regular.week_change | Change between the current price and the price one week ago. |
data.price_changes.Regular.month_change | Change between the current price and the price one month ago. |
data.price_changes.Regular.year_change | Change 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_change | The same four changes for Diesel. |
status | Shows success when the call worked. |
state_code as a two-letter US state code such as WA. DC is also supported.$0.02 per successful call. Failed calls are not charged.
बिल्डिंग शुरू करें
एकीकृत authentication और usage tracking के साथ Platform API endpoint.
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"
}'अपने 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.02 प्रति कॉल | असिंक्रोनस 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-state पर Authorization header (Bearer) में अपनी SandBase API key और parameters को JSON body के रूप में भेजें। आप इस पेज के Playground में बिना code लिखे भी इसे आज़मा सकते हैं।
$0.02 प्रति 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 State SandBase के माध्यम से चलता है, इसलिए एक SandBase API key इस endpoint और catalog के हर अन्य API और model को कवर करती है। आपको अलग से AAA API access के लिए आवेदन करने की आवश्यकता नहीं है।