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.
To obtain your API key, first sign in to your account and navigate to the API you want to use. From the API's Pricing section, choose a plan and complete the subscription process. Once subscribed, return to the API page and you will see your API Access Key displayed at the top of the documentation page. You can use this key 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.
The free trial lasts for 7 days and allows you to make up to 50 API requests.
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. If the API offers a free trial, you will see a "Free 7-Day Trial" option in its Pricing section. The trial lasts for 7 days and allows up to 50 API requests, enabling you to evaluate the API before subscribing to a paid plan.
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.
You can monitor your API usage through the response headers included with every request:
x-zyla-api-calls-monthly-used: Shows the total number of API requests you have used during the current billing period.
x-zyla-api-calls-monthly-remaining: Shows the number of API requests you have remaining for the current billing period.
Yes, you can cancel your subscription at any time. Simply go to the Pricing section of the API you're subscribed to and click the "Unsubscribe" button.
Please note that upgrades, downgrades, and cancellations take effect immediately. Once your subscription is canceled, access to the service will end immediately, regardless of any remaining API calls in your quota.
Please have a look at our Refund Policy: https://zylalabs.com/terms#refund
Service Level:
100%
Response Time:
260ms
Service Level:
50%
Response Time:
1,321ms
Service Level:
100%
Response Time:
3,862ms
Service Level:
100%
Response Time:
1,575ms
Service Level:
100%
Response Time:
913ms
Service Level:
100%
Response Time:
309ms
Service Level:
100%
Response Time:
17ms
Service Level:
100%
Response Time:
421ms
Service Level:
100%
Response Time:
1,070ms
Service Level:
100%
Response Time:
748ms