Gasoline Prices API

API ID 3927

The Gasoline Prices API provides accurate information on fuel costs in the United States, allowing applications to retrieve current prices, trends, and location-specific details.

67% uptime 134 ms avg response

API Documentation

Endpoints

Request

Pass the ZIP code of your choice and the type of fuel that you want to check into. 

The API will deliver with the prices of relevant gas stations in the given ZIP. 

Note: If no information is available for the station, you can use its ID in the Station Data endpoint to perform the query.

Endpoint ID: 4649
GET https://zylalabs.com/api/3927/gasoline+prices+api/4649/prices
INPUT PARAMETERS

Prices — Endpoint Features

Object Description
zip Required Enter a zip code
type Required Types supported: regular, mid-grade, premium, diesel

Free test requests remaining: 3 of 3.


INPUT PARAMETERS

zip
type
API EXAMPLE RESPONSE
JSON
{"success":true,"result":[{"currency":"usd","name":"Alaska","gasoline":"3.312","midGrade":"3.549","premium":"3.776","diesel":"3.541"},{"currency":"usd","name":"Alabama","gasoline":"2.804","midGrade":"3.242","premium":"3.640","diesel":"3.471"},{"currency":"usd","name":"Arkansas","gasoline":"2.779","midGrade":"3.192","premium":"3.570","diesel":"3.323"},{"currency":"usd","name":"Arizona","gasoline":"3.155","midGrade":"3.485","premium":"3.803","diesel":"3.643"},{"currency":"usd","name":"California","gasoline":"4.449","midGrade":"4.679","premium":"4.852","diesel":"4.996"},{"currency":"usd","name":"Colorado","gasoline":"2.984","midGrade":"3.367","premium":"3.688","diesel":"3.417"},{"currency":"usd","name":"Connecticut","gasoline":"3.097","midGrade":"3.718","premium":"4.063","diesel":"3.845"},{"currency":"usd","name":"District of Columbia","gasoline":"3.279","midGrade":"3.866","premium":"4.254","diesel":"3.918"},{"currency":"usd","name":"Delaware","gasoline":"3.203","midGrade":"3.718","premium":"4.016","diesel":"3.772"},{"currency":"usd","name":"Florida","gasoline":"3.217","midGrade":"3.655","premium":"3.970","diesel":"3.676"},{"currency":"usd","name":"Georgia","gasoline":"2.966","midGrade":"3.404","premium":"3.801","diesel":"3.663"},{"currency":"usd","name":"Hawaii","gasoline":"4.555","midGrade":"4.794","premium":"5.040","diesel":"5.307"},{"currency":"usd","name":"Iowa","gasoline":"2.911","midGrade":"3.230","premium":"3.667","diesel":"3.434"},{"currency":"usd","name":"Idaho","gasoline":"3.046","midGrade":"3.306","premium":"3.552","diesel":"3.435"},{"currency":"usd","name":"Illinois","gasoline":"3.280","midGrade":"3.837","premium":"4.286","diesel":"3.650"},{"currency":"usd","name":"Indiana","gasoline":"3.029","midGrade":"3.562","premium":"4.053","diesel":"3.687"},{"currency":"usd","name":"Kansas","gasoline":"2.811","midGrade":"3.139","premium":"3.440","diesel":"3.316"},{"currency":"usd","name":"Kentucky","gasoline":"2.770","midGrade":"3.273","premium":"3.696","diesel":"3.350"},{"currency":"usd","name":"Louisiana","gasoline":"2.777","midGrade":"3.187","premium":"3.557","diesel":"3.377"},{"currency":"usd","name":"Massachusetts","gasoline":"3.043","midGrade":"3.637","premium":"4.000","diesel":"3.799"},{"currency":"usd","name":"Maryland","gasoline":"3.310","midGrade":"3.857","premium":"4.148","diesel":"3.851"},{"currency":"usd","name":"Maine","gasoline":"3.082","midGrade":"3.620","premium":"4.063","diesel":"3.939"},{"currency":"usd","name":"Michigan","gasoline":"3.103","midGrade":"3.628","premium":"4.186","diesel":"3.568"},{"currency":"usd","name":"Minnesota","gasoline":"3.004","midGrade":"3.386","premium":"3.791","diesel":"3.483"},{"currency":"usd","name":"Missouri","gasoline":"2.836","midGrade":"3.181","premium":"3.493","diesel":"3.327"},{"currency":"usd","name":"Mississippi","gasoline":"2.686","midGrade":"3.108","premium":"3.481","diesel":"3.321"},{"currency":"usd","name":"Montana","gasoline":"2.948","midGrade":"3.252","premium":"3.557","diesel":"3.308"},{"currency":"usd","name":"North Carolina","gasoline":"2.918","midGrade":"3.354","premium":"3.744","diesel":"3.612"},{"currency":"usd","name":"North Dakota","gasoline":"2.913","midGrade":"3.214","premium":"3.509","diesel":"3.531"},{"currency":"usd","name":"Nebraska","gasoline":"2.919","midGrade":"3.136","premium":"3.574","diesel":"3.378"},{"currency":"usd","name":"New Hampshire","gasoline":"2.980","midGrade":"3.548","premium":"3.949","diesel":"3.795"},{"currency":"usd","name":"New Jersey","gasoline":"3.100","midGrade":"3.664","premium":"3.903","diesel":"3.795"},{"currency":"usd","name":"New Mexico","gasoline":"2.939","midGrade":"3.342","premium":"3.646","diesel":"3.546"},{"currency":"usd","name":"Nevada","gasoline":"3.660","midGrade":"3.975","premium":"4.213","diesel":"3.796"},{"currency":"usd","name":"New York","gasoline":"3.177","midGrade":"3.687","premium":"4.074","diesel":"3.949"},{"currency":"usd","name":"Ohio","gasoline":"2.988","midGrade":"3.522","premium":"4.030","diesel":"3.567"},{"currency":"usd","name":"Oklahoma","gasoline":"2.701","midGrade":"3.073","premium":"3.366","diesel":"3.151"},{"currency":"usd","name":"Oregon","gasoline":"3.544","midGrade":"3.789","premium":"4.027","diesel":"3.838"},{"currency":"usd","name":"Pennsylvania","gasoline":"3.372","midGrade":"3.803","premium":"4.157","diesel":"4.085"},{"currency":"usd","name":"Rhode Island","gasoline":"3.009","midGrade":"3.700","premium":"4.069","diesel":"3.817"},{"currency":"usd","name":"South Carolina","gasoline":"2.870","midGrade":"3.309","premium":"3.682","diesel":"3.544"},{"currency":"usd","name":"South Dakota","gasoline":"2.921","midGrade":"3.114","premium":"3.556","diesel":"3.411"},{"currency":"usd","name":"Tennessee","gasoline":"2.772","midGrade":"3.197","premium":"3.586","diesel":"3.438"},{"currency":"usd","name":"Texas","gasoline":"2.729","midGrade":"3.186","premium":"3.541","diesel":"3.387"},{"currency":"usd","name":"Utah","gasoline":"2.992","midGrade":"3.242","premium":"3.459","diesel":"3.384"},{"currency":"usd","name":"Virginia","gasoline":"3.098","midGrade":"3.572","premium":"3.935","diesel":"3.710"},{"currency":"usd","name":"Vermont","gasoline":"3.149","midGrade":"3.661","premium":"4.075","diesel":"3.757"},{"currency":"usd","name":"Washington","gasoline":"3.943","midGrade":"4.199","premium":"4.429","diesel":"4.376"},{"currency":"usd","name":"Wisconsin","gasoline":"2.982","midGrade":"3.454","premium":"3.967","diesel":"3.428"},{"currency":"usd","name":"West Virginia","gasoline":"2.975","midGrade":"3.385","premium":"3.814","diesel":"3.604"},{"currency":"usd","name":"Wyoming","gasoline":"2.945","midGrade":"3.215","premium":"3.516","diesel":"3.412"}]}
Prices — CODE SNIPPETS

curl --location --request GET 'https://zylalabs.com/api/3927/gasoline+prices+api/4649/prices?zip=90001&type=regular' --header 'Authorization: Bearer YOUR_API_KEY' 


    
Request

To use this endpoint, you must specify a station ID.

Note: You can obtain the ID from the Get Prices endpoint.

Endpoint ID: 24541
GET https://zylalabs.com/api/3927/gasoline+prices+api/24541/station+data
INPUT PARAMETERS

Station Data — Endpoint Features

Object Description
station_id Required

Free test requests remaining: 3 of 3.


INPUT PARAMETERS

API EXAMPLE RESPONSE
JSON
{"status":"success","data":{"station_id":"90002","name":"Exxon","address":{"line1":"3399 Branch Ave   , Temple Hills, MD, 20746","line2":"","city":"Temple Hills","state":"MD","postal_code":"20746","country":""},"coordinates":{"lat":"38.8473202","lng":"-76.9530353"},"phone":"","open_status":"","opening_hours":"","rating":{"overall":null,"count":null},"currency":"USD","price_unit":"dollars_per_gallon","fuels":[],"brands":[],"amenities":[],"nearby_station_ids":[]}}
Station Data — CODE SNIPPETS

curl --location --request GET 'https://zylalabs.com/api/3927/gasoline+prices+api/24541/station+data&station_id=Required' --header 'Authorization: Bearer YOUR_API_KEY' 


    

API Access Key & Authentication

After signing up, every developer is assigned a personal API access key, a unique combination of letters and digits provided to access to our API endpoint. To authenticate with the Gasoline Prices API simply include your bearer token in the Authorization header.

Headers
Header Description
Authorization Required Should be Bearer access_key. See "Your API Access Key" above when you are subscribed.

Simple Transparent Pricing

No long-term commitment. Upgrade, downgrade, or cancel anytime. Free Trial includes up to 50 requests.

(Save 2 months with annual billing 🎉)

🚀 Enterprise Plan
Custom Volume

  • Custom Rate Limit
  • Team & Access Management
  • SLA-backed Uptime
  • Specialized Customer Support
  • Real-Time API Monitoring
  • Enterprise Security & Compliance
Minimum annual contract: USD 10,000

Trusted by leading companies

Overview

About the API:  

The Gasoline Prices API is presented as a dynamic and resilient platform, providing users with complete and accurate information on fuel expenses in the United States. In a landscape marked by constant fluctuations in fuel prices, this API emerges as an essential resource for applications that strive to deliver accurate and timely data to users.

A notable feature of the API is the provision of location-specific details. By providing accurate gas prices tailored to specific regions, the API enables applications to disseminate highly relevant data. This functionality is valuable for users who are looking for optimal fuel prices nearby or planning profitable refueling stops during their trips.

Designed with seamless integration in mind, the Gasoline Prices API ensures accessibility for users with varying experience levels, making it easy to effortlessly incorporate gasoline price data into your applications.

The versatility of the API makes it suitable for a wide variety of applications in various industries. Whether used for fuel price comparison, route planning, expense monitoring, or environmental impact assessments, the API can be tailored to meet a variety of needs, making it a valuable asset for users looking to enrich your applications with accurate and relevant fuel price data.

As a cornerstone in the fuel price information space, the Gasoline Prices API equips users with a powerful tool to enhance their applications. With its accuracy, location-specific information, historical data analysis capabilities, and easy-to-use integration, the API enables a broad spectrum of applications to provide users with timely and relevant information, ultimately fostering more informed decision making. in the midst of the complex panorama of fuel prices.

 

Gasoline Prices API FAQs

To use this API just run your single endpoint and you will get gas prices from different states.

Gasoline Prices API is a robust and dynamic tool that provides users with access to complete and accurate information on fuel prices throughout the United States.

Zyla provides a wide range of integration methods for almost all programming languages. You can use these codes to integrate with your project as you need.

There are different plans suits everyone including a free trial for small amount of requests, but it’s rate is limit to prevent abuse of the service.

The GET Fuel Costs endpoint returns current gasoline prices for each state in the U.S., including regular, mid-grade, premium gasoline, and diesel prices.

The response data includes fields such as "currency," "name" (state), "gasoline," "midGrade," "premium," and "diesel," providing a comprehensive view of fuel prices by state.

The response data is structured as a JSON object with a "success" boolean and a "result" array containing individual state objects, each with specific fuel price fields.

The endpoint provides location-specific fuel prices, including regular, mid-grade, premium gasoline, and diesel costs for all U.S. states.

The GET Fuel Costs endpoint does not require any parameters; it retrieves data for all states by default, ensuring comprehensive coverage.

Data accuracy is maintained through regular updates from reliable sources, ensuring that users receive the most current fuel price information available.

Typical use cases include fuel price comparison, route planning based on fuel costs, and expense tracking for personal or fleet management applications.

Users can parse the JSON response to extract specific fuel prices for states, enabling applications to display current prices, perform comparisons, or analyze trends over time.

General FAQs

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.

Prices are listed in USD (United States Dollar), EUR (Euro), CAD (Canadian Dollar), AUD (Australian Dollar), and GBP (British Pound). We accept all major debit and credit cards. Our payment system uses the latest security technology and is powered by Stripe, one of the world's most reliable payment companies. If you have any trouble paying by card, just contact us at [email protected]

Additionally, if you already have an active subscription in any of these currencies (USD, EUR, CAD, AUD, GBP), that currency will remain for subsequent subscriptions. You can change the currency at any time as long as you don't have any active subscriptions.
The local currency shown on the pricing page is based on the country of your IP address and is provided for reference only. The actual prices are in USD (United States Dollar). When you make a payment, the charge will appear on your card statement in USD, even if you see the equivalent amount in your local currency on our website. This means you cannot pay directly with your local currency.
Occasionally, a bank may decline the charge due to its fraud protection settings. We suggest reaching out to your bank initially to check if they are blocking our charges. Also, you can access the Billing Portal and change the card associated to make the payment. If these does not work and you need further assistance, please contact our team at [email protected]
Prices are determined by a recurring monthly or yearly subscription, depending on the chosen plan.
API calls are deducted from your plan based on successful requests. Each plan comes with a specific number of calls that you can make per month. Only successful calls, indicated by a Status 200 response, will be counted against your total. This ensures that failed or incomplete requests do not impact your monthly quota.
Zyla API Hub works on a recurring monthly subscription system. Your billing cycle will start the day you purchase one of the paid plans, and it will renew the same day of the next month. So be aware to cancel your subscription beforehand if you want to avoid future charges.
To upgrade your current subscription plan, simply go to the pricing page of the API and select the plan you want to upgrade to. The upgrade will be instant, allowing you to immediately enjoy the features of the new plan. Please note that any remaining calls from your previous plan will not be carried over to the new plan, so be aware of this when upgrading. You will be charged the full amount of the new plan.
To check how many API calls you have left for the current month, refer to the 'X-Zyla-API-Calls-Monthly-Remaining' field in the response header. For example, if your plan allows 1,000 requests per month and you've used 100, this field in the response header will indicate 900 remaining calls.

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.

The 'X-Zyla-RateLimit-Reset' header shows the number of seconds until your rate limit resets. This tells you when your request count will start fresh. For example, if it displays 3,600, it means 3,600 seconds are left until the limit resets.

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.

After 7 days, you will be charged the full amount for the plan you were subscribed to during the trial. Therefore, it's important to cancel before the trial period ends. Refund requests for forgetting to cancel on time are not accepted.
When you subscribe to an API free trial, you can make up to 50 API calls. If you wish to make additional API calls beyond this limit, the API will prompt you to perform an "Start Your Paid Plan." You can find the "Start Your Paid Plan" button in your profile under Subscription -> Choose the API you are subscribed to -> Pricing tab.
You can contact us through our chat channel to receive immediate assistance. We are always online from 8 am to 5 pm (EST). If you reach us after that time, we will get back to you as soon as possible. Additionally, you can contact us via email at [email protected]

Please have a look at our Refund Policy: https://zylalabs.com/terms#refund


Related APIs