The US Diesel Price API is designed to deliver structured access to diesel fuel price data by state, based on data from World Population Review. It supports endpoints for retrieving all U.S. states, and querying diesel fuel prices, rankings, and historical trends. Each data column from the source is exposed via individual endpoints, allowing developers to build precise and flexible data-driven applications, dashboards, and analytics tools.
{"states":["Hawaii","California","Washington","Pennsylvania","New York","Maine","Oregon","Nevada","Connecticut","Massachusetts","Vermont","District of Columbia","New Hampshire","Rhode Island","Maryland","Delaware","New Jersey","Indiana","Florida","Illinois","West Virginia","Virginia","Alaska","Arizona","Idaho","Georgia","Michigan","North Carolina","Ohio","Utah","North Dakota","Minnesota","New Mexico","Wyoming","Montana","Iowa","Colorado","Alabama","South Carolina","Tennessee","Wisconsin","South Dakota","Nebraska","Kentucky","Kansas","Arkansas","Louisiana","Missouri","Mississippi","Texas","Oklahoma"]}
curl --location --request POST 'https://zylalabs.com/api/6725/us+diesel+price+api/10030/get+all+states+available+in+dataset' --header 'Authorization: Bearer YOUR_API_KEY' --header 'Content-Type: application/json' --data-raw '{}'
{"state":"Hawaii","latest_diesel_price_per_gallon":"$5.29"}
curl --location --request POST 'https://zylalabs.com/api/6725/us+diesel+price+api/10031/get+latest+diesel+price+by+state' --header 'Authorization: Bearer YOUR_API_KEY' --header 'Content-Type: application/json' --data-raw '{"state":"Required"}'
{"state":"Hawaii","historical_2023_diesel_price_per_gallon":"$5.15"}
curl --location --request POST 'https://zylalabs.com/api/6725/us+diesel+price+api/10032/get+historical+diesel+price+by+state' --header 'Authorization: Bearer YOUR_API_KEY' --header 'Content-Type: application/json' --data-raw '{"state":"Required"}'
| Header | Description |
|---|---|
Authorization
|
[Required] Should be Bearer access_key. See "Your API Access Key" above when you are subscribed. |
No long-term commitment. Upgrade, downgrade, or cancel anytime. Free Trial includes up to 50 requests.
The US Diesel Price API provides access to the latest and historical diesel fuel prices across U.S. states. Users can retrieve data on diesel prices, rankings, and analyze price trends by filtering on specific states or value ranges.
You can filter diesel price data by state by using the specific endpoints provided by the API. Each state has its own endpoint that allows you to query the diesel prices relevant to that state.
Yes, the US Diesel Price API allows users to access historical diesel price data. You can query historical trends to analyze how diesel prices have changed over time.
The API offers structured access to diesel fuel price data, including endpoints for retrieving all U.S. states, querying diesel prices, rankings, and historical trends. This flexibility enables developers to build data-driven applications, dashboards, and analytics tools.
Each endpoint returns structured JSON data. The "get all states" endpoint returns a list of U.S. states. The "get latest diesel price by state" endpoint provides the current diesel price for a specified state, while the "get historical diesel price by state" endpoint returns the historical diesel price for that state in 2023.
Key fields include "state" for the name of the state, "latest_diesel_price_per_gallon" for current prices, and "historical_2023_diesel_price_per_gallon" for historical prices. These fields provide essential information for analysis.
The response data is organized in a JSON format, with each endpoint returning a structured object. For example, the latest price endpoint returns an object containing the state name and its corresponding diesel price, making it easy to parse and utilize in applications.
The primary parameter for the "get latest diesel price by state" and "get historical diesel price by state" endpoints is the "state" parameter, which must be specified to retrieve data for that particular state. Users can obtain valid state names from the "get all states" endpoint.
The "get all states" endpoint provides a comprehensive list of U.S. states. The "get latest diesel price by state" endpoint offers current diesel prices, while the "get historical diesel price by state" endpoint provides historical price data for 2023, allowing for trend analysis.
Users can utilize the returned data by integrating it into applications for real-time monitoring of diesel prices, generating reports, or conducting trend analysis. For instance, developers can create dashboards that visualize price changes over time or compare prices across states.
The US Diesel Price API sources its data from World Population Review, ensuring that the information is reliable and up-to-date. This reputable source contributes to the accuracy of the diesel price data provided through the API.
Typical use cases include fuel price monitoring for logistics companies, trend analysis for market research, and integration into mobile apps for consumers seeking the best diesel prices. The API's structured data supports various analytical and reporting needs.
Please have a look at our Refund Policy: https://zylalabs.com/terms#refund
To obtain your API key, you first need to sign in to your account and subscribe to the API you want to use. Once subscribed, go to your Profile, open the Subscription section, and select the specific API. Your API key will be available there and can be used to authenticate your requests.
You can’t switch APIs during the free trial. If you subscribe to a different API, your trial will end and the new subscription will start as a paid plan.
If you don’t cancel before the 7th day, your free trial will end automatically and your subscription will switch to a paid plan under the same plan you originally subscribed to, meaning you will be charged and gain access to the API calls included in that plan.
The free trial ends when you reach 50 API requests or after 7 days, whichever comes first.
No, the free trial is available only once, so we recommend using it on the API that interests you the most. Most of our APIs offer a free trial, but some may not include this option.
Yes, we offer a 7-day free trial that allows you to make up to 50 API calls at no cost, so you can test our APIs without any commitment.
Zyla API Hub is like a big store for APIs, where you can find thousands of them all in one place. We also offer dedicated support and real-time monitoring of all APIs. Once you sign up, you can pick and choose which APIs you want to use. Just remember, each API needs its own subscription. But if you subscribe to multiple ones, you'll use the same key for all of them, making things easier for you.
Service Level:
100%
Response Time:
260ms
Service Level:
100%
Response Time:
1,575ms
Service Level:
50%
Response Time:
1,321ms
Service Level:
100%
Response Time:
3,862ms
Service Level:
100%
Response Time:
17ms
Service Level:
100%
Response Time:
309ms
Service Level:
100%
Response Time:
913ms
Service Level:
100%
Response Time:
452ms
Service Level:
100%
Response Time:
748ms
Service Level:
100%
Response Time:
693ms
Service Level:
100%
Response Time:
5,262ms
Service Level:
100%
Response Time:
55ms
Service Level:
100%
Response Time:
9,221ms
Service Level:
100%
Response Time:
9,572ms
Service Level:
100%
Response Time:
218ms
Service Level:
100%
Response Time:
3,232ms
Service Level:
100%
Response Time:
853ms
Service Level:
100%
Response Time:
61ms
Service Level:
100%
Response Time:
55ms
Service Level:
100%
Response Time:
59ms