AAA State Gas Prices
https://api.sandbase.ai/v1/api/aaa/state-gas-pricesReturns current average gas prices for all 50 US states plus DC across all four fuel grades (Regular, Mid-Grade, Premium, Diesel). States are listed in alphabetical order by full state name.
- Prezzo
- $0.01USD / chiamata
- Metodo
- POST
- Risposta
- JSON asincrono
- Parametri
- 0 obbligatori · 0 opzionali
Playground
Il tuo output apparirà qui
Completa gli input, poi fai clic su Esegui.
README API
AAA State Gas Prices
Returns the current average cost of gas for each US state and DC, based on AAA data. Each row covers Regular, Mid-Grade, Premium and Diesel. The request takes no input.
Use cases
- Compare Regular gas costs between states to find the cheapest and most expensive places to fill up.
- Estimate fuel costs for a road trip that crosses several states.
- Build a state-by-state fuel cost table or map for a dashboard.
- Track the gap between
dieselandregularin each state for fleet planning.
Request
curl -X POST "https://api.sandbase.ai/v1/api/aaa/state-gas-prices" \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
-H "Content-Type: application/json" \
-d '{}'
The result is returned in outputs[0].data.
Example response
Real response for the request above, trimmed: lists keep their first item and long strings are cut.
{
"data": {
"states": [
{
"diesel": 5.8537,
"mid_grade": 4.1781,
"premium": 4.5882,
"regular": 3.73,
"state": "Alabama"
}
]
},
"status": "success"
}
Response fields
| Field | Meaning |
|---|---|
data.states[] | One entry per state. The list is in alphabetical order by full state name. |
data.states[].state | Full name of the state, for example Alabama. |
data.states[].regular | Average cost of Regular gas in that state. |
data.states[].mid_grade | Average cost of Mid-Grade gas in that state. |
data.states[].premium | Average cost of Premium gas in that state. |
data.states[].diesel | Average cost of diesel in that state. |
status | Shows success when the call worked. |
Notes
- Send an empty JSON object
{}as the request body. There are no parameters. - Fuel values are plain numbers, such as
3.73or5.8537. - For the US-wide average, call AAA National Average.
Pricing
$0.01 per successful call. Failed calls are not charged. It is included in the daily free quota of each organization.
Inizia a costruire
Invia la tua prima richiesta
Endpoint API della piattaforma con autenticazione unificata e tracciamento dell'utilizzo.
curl -X POST "https://api.sandbase.ai/v1/api/aaa/state-gas-prices" \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
-H "Content-Type: application/json" \
-d '{}'2. Autenticazione
Imposta la tua SandBase API key nell'ambiente del server. Le richieste usano l'autenticazione Bearer.
export SANDBASE_API_KEY="YOUR_API_KEY"Conserva la tua key sul server. Non esporla nel codice del browser.
3. Parametri
Non è stato pubblicato alcuno schema dei parametri per questa API.
4. Risposta
Risposta di esempio salvata per questa API; durante la visualizzazione non viene eseguita alcuna richiesta live.
Nessuna risposta salvata è stata pubblicata. Esegui l'API in Playground per ispezionarne la risposta.
Esplora altro
API correlate
| API | Prezzo | Risposta |
|---|---|---|
AAA State Gas PricesQuesta API AAA | $0.01 per chiamata | JSON asincrono |
AAA | $0.01 per chiamata | JSON asincrono |
AAA | $0.01 per chiamata | JSON asincrono |
AAA | $0.01 per chiamata | JSON asincrono |
AAA | $0.01 per chiamata | JSON asincrono |
AAA | $0.01 per chiamata | JSON asincrono |
Domande
FAQ
Come uso l'API AAA State Gas Prices?
Invia una richiesta POST a https://api.sandbase.ai/v1/api/aaa/state-gas-prices con la tua chiave API di SandBase nell'header Authorization (Bearer) e i parametri nel body JSON. Puoi anche provarla nel Playground di questa pagina senza scrivere codice.
Quanto costa l'API AAA State Gas Prices?
$0.01 per chiamata, addebitato dal tuo saldo SandBase. Paghi solo le chiamate che effettui; non c'è alcun abbonamento.
Quali parametri accetta l'API AAA State Gas Prices?
AAA State Gas Prices non accetta parametri di input; invia un body JSON vuoto.
Cosa restituisce l'API AAA State Gas Prices?
Un risultato JSON. Questo endpoint viene eseguito in modo asincrono, quindi la risposta indica come recuperare il risultato completato. Il README di questa pagina include una risposta di esempio.
Mi serve un account sviluppatore o una chiave API AAA?
No. AAA State Gas Prices funziona tramite SandBase, quindi una sola chiave API SandBase copre questo endpoint e tutte le altre API e modelli del catalogo. Non è necessario richiedere separatamente l'accesso alle API AAA.
