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/state-price-detailsReturns detailed gas price data for a specific state including current prices for all fuel grades, historical averages (yesterday, week ago, month ago, year ago), and all-time highest recorded prices with their dates.
出力はここに表示されます
入力を完了してから[実行]をクリックしてください。
Returns AAA gas prices for one US state. Each fuel grade has a current price and past prices from yesterday, a week ago, a month ago and a year ago, plus the highest recorded price with its date. Send a two-letter state_code.
curl -X POST "https://api.sandbase.ai/v1/api/aaa/state-price-details" \
-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": {
"highest_recorded": {
"Diesel": {
"date": "9/23/26",
"price": "7.4697"
},
"Regular Unleaded": {
"date": "5/20/26",
"price": "5.7887"
}
},
"prices": {
"Diesel": {
"current": 7.2512,
"month_ago": 7.3739,
"week_ago": 7.2642,
"year_ago": 4.9787,
"yesterday": 7.2685
},
"Mid-Grade": {
"current": 5.4442,
"month_ago": 5.7645,
"week_ago": 5.5587,
"year_ago": 4.5651,
"yesterday": 5.4577
},
"Premium": {
"current": 5.7146,
"month_ago": 6.0237,
"week_ago": 5.8074,
"year_ago": 4.8184,
"yesterday": 5.7243
},
"Regular": {
"current": 5.1925,
"month_ago": 5.4891,
"week_ago": 5.3047,
"year_ago": 4.2855,
"yesterday": 5.203
}
},
"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 prices describe. |
data.prices.Regular.current | Current price for Regular fuel in the state. Mid-Grade, Premium and Diesel use the same structure under data.prices. |
data.prices.Diesel.current | Current price for Diesel in the state. |
data.prices.Regular.yesterday / data.prices.Regular.week_ago / data.prices.Regular.month_ago / data.prices.Regular.year_ago | Regular price at each earlier point in time. The other grades have the same keys, so you can compare change over time. |
data.highest_recorded | Highest recorded price for each fuel grade, with the date it was recorded. Each entry holds a price string and a date string in M/D/YY format. |
data.highest_recorded.Diesel.price / date | Highest recorded Diesel price and the date it was recorded. |
status | Shows success when the call worked. |
state_code, such as WA. The description says all 50 states and DC are supported.data.prices are numbers. Prices under data.highest_recorded are strings.data.prices uses Regular, while data.highest_recorded labels the regular grade Regular Unleaded. Mid-Grade and Premium appear only under data.prices.$0.01 per successful call. Failed calls are not charged. It is included in the daily free quota of each organization.
開発を始める
統一認証と使用状況の追跡を備えたプラットフォームAPIエンドポイントです。
curl -X POST "https://api.sandbase.ai/v1/api/aaa/state-price-details" \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"state_code": "WA"
}'SandBaseのAPIキーをサーバー環境に設定してください。リクエストはBearer認証を使用します。
export SANDBASE_API_KEY="YOUR_API_KEY"キーはサーバー側で管理してください。ブラウザコードに公開しないでください。
state_codestring必須Two-letter US state code (e.g. TX, CA, NY, FL). All 50 states and DC are supported.
このAPIの保存済みサンプルレスポンスです。表示時にライブリクエストは行われません。
保存済みレスポンスはまだ公開されていません。PlaygroundでAPIを実行し、レスポンスを確認してください。
さらに探索
| API | 価格 | レスポンス |
|---|---|---|
AAA State Price Detailsこの 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 |
質問
Authorization ヘッダー(Bearer)に SandBase API key を指定し、パラメータを JSON ボディで送信して https://api.sandbase.ai/v1/api/aaa/state-price-details に POST リクエストを送ります。このページの Playground で、コードを書かずに試すこともできます。
1回あたり $0.01、SandBase 残高から課金されます。課金対象はご利用分のみで、サブスクリプションはありません。
必須: state_code (string)。 このページの Parameters テーブルと Playground に、すべてのフィールドが一覧表示されています。
JSON 結果です。このエンドポイントは非同期で実行されるため、レスポンスには完了した結果の取得方法が含まれます。 このページの README にサンプルレスポンスがあります。
いいえ。AAA State Price Details は SandBase 経由で動作するため、SandBase の API key 1つでこのエンドポイントと、カタログ内の他のすべての API とモデルを利用できます。AAA の API アクセスを別途申請する必要はありません。