# Gas Station Prices Monitor - GasBuddy Fuel & Diesel by ZIP (`neverempty/gas-station-prices-monitor`) Actor

Gas and diesel prices per station for many US ZIP codes, cities or Canadian postal codes in one run, from GasBuddy: regular, midgrade, premium, diesel and E85, cash and credit, with update time. Monitoring mode returns only stations whose price changed, with the old price.

- **URL**: https://apify.com/neverempty/gas-station-prices-monitor.md
- **Developed by:** [NeverEmpty](https://apify.com/neverempty) (community)
- **Categories:** Travel, E-commerce
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.92 / 1,000 station returneds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## GasBuddy Scraper & Gas Price Monitor - Station Fuel and Diesel Prices

Scrape **gas and diesel prices for each station from GasBuddy** by US ZIP code, city or Canadian postal code, for many locations in one run, and export them to CSV, Excel or JSON. Each row is one station with its name, brand, address, and the regular, midgrade, premium, diesel, E85 and UNL88 prices, cash and credit, with the time each price was posted. You pay **$0.98 per 1,000 stations** on the Apify Free plan, down to **$0.92** on Gold and above, with no start fee. Turn on `monitoringMode` and schedule it, and later runs return only the stations whose price changed, with the old price and the difference. Example: ZIP code 78704, 20 stations in 26 seconds.

### What can I do with this GasBuddy scraper?

- **Get station prices for a whole area.** Paste ZIP codes (`78704`), cities (`Dallas, TX`) or Canadian postal codes (`M5V 3L9`) and get the stations GasBuddy lists there, as one table.
- **Read many locations in one run.** Add up to 500 locations. Each row keeps the location you typed, so you can sort the table by area.
- **Watch prices every hour or every day.** Turn on `monitoringMode` and schedule the run. Each later run returns only the stations whose price changed (`changeType: "changed"`, with the old and new price and the difference), stations new to the list (`new`) and stations that left it (`removed`).
- **Compare cash and credit prices.** Each fuel has a credit price, a cash price and the time it was posted, so you can see which stations give a cash discount and how fresh each price is.
- **Track diesel for a fleet or a route.** Choose `diesel` in **Fuel types** and list the ZIP codes along the route. Each row also carries the other fuel prices GasBuddy shows for that station.
- **Feed a dashboard, a pricing model or an AI agent.** Every row has the same fields, and prices are numbers in the unit GasBuddy shows (`USD per gallon` in the US, `CAD cents per liter` in Canada).

### What data do you get?

| Field | What it is |
|---|---|
| `stationId`, `stationUrl` | GasBuddy's ID for the station, stable across runs, and a link to its GasBuddy page |
| `stationName`, `brand` | The station name and the fuel brand |
| `address`, `city`, `state`, `zip`, `country` | Where the station is |
| `regularPrice`, `regularCashPrice`, `regularPostedAt` | Regular: credit price, cash price, and when the price was posted |
| `midgradePrice`, `premiumPrice`, `dieselPrice`, `e85Price`, `unl88Price` (each with `…CashPrice` and `…PostedAt`) | The same for midgrade, premium, diesel, E85 and UNL88 |
| `priceUnit` | `USD per gallon` or `CAD cents per liter` |
| `fuelsSold` | The fuels the station sells |
| `starRating`, `ratingsCount` | The station rating on GasBuddy and how many ratings it has |
| `temporarilyClosed` | Whether GasBuddy marks the station as temporarily closed |
| `changeType`, `changes` | Monitoring mode: `new`, `changed` or `removed`, and for a change the fuel, `credit` or `cash`, the previous and current price and the difference |
| `inputLocation`, `scrapedAt`, `status` | The location you typed, when the row was read, and `ok` for a station row |

A price is `null` when GasBuddy has no recent price for that fuel at that station.

### How to export gas prices to CSV or Excel

1. Type your ZIP codes, cities or postal codes into **Locations**, one per line.
2. Pick the fuels in **Fuel types**, for example **Regular** and **Diesel**.
3. Click **Start**. When the run ends, open the **Output** tab and download the dataset as CSV, Excel or JSON.

### Input

```json
{
  "locations": ["78704", "Dallas, TX", "M5V 3L9"],
  "fuelTypes": ["regular", "diesel"],
  "maxStationsPerLocation": 100,
  "monitoringMode": false
}
```

- `locations`: US ZIP codes, Canadian postal codes, or a city with its state or province. Up to 500.
- `fuelTypes`: `regular`, `midgrade`, `premium`, `diesel`, `e85`, `unl88`. Empty means `regular`.
- `maxStationsPerLocation`: how many stations to return for each location and fuel, in GasBuddy's order (cheapest first). Default 100, up to 2,000. A ZIP code usually lists 10 to 60 stations; a big city lists thousands.
- `monitoringMode`: return only changes from the last run of the same locations and fuels.
- `resetMonitoringState`: forget what earlier runs remembered and start again.

### Output example

```json
{
  "status": "ok",
  "changeType": "changed",
  "changes": [{ "fuel": "regular", "priceType": "credit", "previous": 154.9, "current": 151.9, "difference": -3 }],
  "stationId": "201037",
  "stationName": "Pioneer",
  "brand": "On the Run",
  "address": "8765 Hwy 50",
  "city": "Vaughan",
  "state": "ON",
  "country": "CA",
  "regularPrice": 151.9,
  "regularCashPrice": null,
  "regularPostedAt": "2026-11-08T20:54:44.656Z",
  "dieselPrice": 240.9,
  "priceUnit": "CAD cents per liter",
  "fuelsSold": ["regular", "midgrade", "premium", "diesel"],
  "starRating": 4.4,
  "ratingsCount": 327,
  "temporarilyClosed": false,
  "stationUrl": "https://www.gasbuddy.com/station/201037",
  "inputLocation": "Toronto, ON",
  "scrapedAt": "2026-11-08T20:55:55.615Z"
}
```

### How much does it cost?

**$0.98 per 1,000 stations** on the Free plan, with lower prices on paid Apify plans. There is no start fee.

| Apify plan | Price per 1,000 stations |
|---|---|
| Free | $0.98 |
| Bronze | $0.96 |
| Silver | $0.94 |
| Gold and above | $0.92 |

You are charged only for rows with `status: "ok"`. Each station is returned once per location per run, even when you choose several fuels.

**Monitoring mode:** the first run returns every station with a price as `new`. Later runs return and charge only the `new`, `changed` and `removed` stations. A run in which nothing changed returns one free `no-changes` row and charges nothing.

For example, a daily watch on 10 ZIP codes where 30 stations change price costs about $0.03 a day on the Free plan.

Free: stations without a recent price for the fuels you chose, locations that are not found, inputs that are not locations, a second entry of the same location, and every row in the [list below](#rows-you-are-not-charged-for).

To keep a run inside a budget, set `maxStationsPerLocation`, or set a maximum total charge when you start the run. The run stops at that amount and says so in a `budget-reached` row.

### FAQ

**How do I get gas prices by ZIP code?**
Type the ZIP codes into `locations` and run the Actor. Each station near that ZIP code is one row with its prices for every fuel GasBuddy shows.

**How do I get diesel prices for many stations?**
Set `fuelTypes` to `diesel`. Stations without a recent diesel price are skipped and not charged.

**How do I get an alert when a station changes its price?**
Turn on `monitoringMode`, schedule the Actor hourly or daily, and connect a webhook, Zapier, Make or an Apify integration to the run. The station rows of each run are only the changes.

**What counts as a change?**
A new credit or cash price for one of the fuels you chose. When GasBuddy drops a price because it is old, that is not a change; the last price is kept and compared when a new one is posted.

**Can I scrape a whole city?**
Yes. Type it with its state or province, for example `Dallas, TX`. A big city lists thousands of stations, cheapest first. Set `maxStationsPerLocation` to how many you need; a free `result-limit` row says how many GasBuddy lists.

**Does it work in Canada?**
Yes. Use a postal code (`M5V 3L9`) or a city with its province (`Toronto, ON`). Canadian prices come in `CAD cents per liter`.

**Do I need a GasBuddy account?**
No. You don't need a GasBuddy account, a cookie or an API key.

**Can I run this from an API or an AI agent?**
Yes. Call the Actor through the Apify API, or from an AI agent through the Apify MCP server, with a list of locations. The rows come back as JSON.

### Rows you are not charged for

| `status` | What it means |
|---|---|
| `no-changes` | Monitoring mode: no price changed at any location since the last run. |
| `no-results` | GasBuddy lists no station with a recent price for this location and these fuels. |
| `result-limit` | The location has more stations than were returned, because of `maxStationsPerLocation`. The row says how many GasBuddy lists. |
| `not-found` | GasBuddy does not know this location. Nothing is guessed and no other place is used instead. |
| `bad-input` | The entry is not a ZIP code, a postal code or a city with its state or province. |
| `duplicate-input` | The same location was given more than once, also in another spelling such as ZIP+4. It was read and charged once. |
| `budget-reached` | The run reached the maximum total charge you set. Stations that did not fit were not returned and not charged, and the locations not read are named. |
| `blocked` | GasBuddy did not return this location this time. The run names the locations it did not read, so you can run them again later. |
| `unreadable` | GasBuddy's answer could not be read. Nothing is guessed. Run the location again later. |

### Limitations

- The Actor returns the station prices GasBuddy shows publicly for the US and Canada. Prices are the ones GasBuddy users and stations have posted, with the time of each post.
- GasBuddy lists the stations of a location cheapest first. When `maxStationsPerLocation` is lower than the list, the stations near the cutoff can change from run to run. In monitoring mode a station that moves into the stations you watch is remembered without being returned, and `removed` is reported only for locations that were read to the end. For a full watch, set `maxStationsPerLocation` high enough to cover the whole list.
- Use one monitoring schedule per set of locations and fuels. Two runs of the same watch at the same moment can return the same change twice, and both runs are charged for it.
- Use the data in line with the rules that apply to you, including GasBuddy's terms.

### Need help or a missing field?

If something does not work as expected, open the **Issues** tab and tell us what happened, with the run ID. Requests for new fields and filters are welcome; the ones asked for most go into the next version.

### Thanks for using this Actor

We build these tools for people who run them every day, and we improve them from what users tell us.

- **Missing a field, or need another filter?** Tell us in the **Issues** tab. If the data is there, we add it.
- **Found a bug or a wrong value?** Post the run ID in the **Issues** tab. Wrong data is the thing we fix first.

If this Actor saved you time, a short review helps other people find it.

# Actor input Schema

## `locations` (type: `array`):

Places to search: a US ZIP code (78704), a Canadian postal code (M5V 3L9) or a city with its state or province ("Dallas, TX", "Toronto, ON"). Add up to 500 locations in one run; each station comes back as its own row with the location you gave. A location GasBuddy does not know, or one in another format, gets one free row saying so, and the other locations are still read.

## `fuelTypes` (type: `array`):

The fuels to search and watch. Empty = regular. Each station row also carries every other fuel price GasBuddy shows for it.

## `maxStationsPerLocation` (type: `integer`):

How many stations to return for each location and fuel type, in GasBuddy's order (cheapest first). Default 100. A ZIP code usually lists 10 to 60 stations; a big city lists thousands. Each station row is charged once. For monitoring, set it high enough to cover the whole list.

## `monitoringMode` (type: `boolean`):

Remember the stations and prices between runs and return only stations whose price changed (with the old price and the difference), stations new to the list and stations that left it. The first run returns every station as new. Schedule it hourly or daily for each set of locations.

## `resetMonitoringState` (type: `boolean`):

Start monitoring again from zero for these locations and fuel types: this run returns every station as new.

## Actor input object example

```json
{
  "locations": [
    "78704"
  ],
  "monitoringMode": false,
  "resetMonitoringState": false
}
```

# Actor output Schema

## `results` (type: `string`):

One row per gas station for each location: name, brand, address, regular, midgrade, premium, diesel, E85 and UNL88 credit and cash prices with the time each was updated, rating and a link to the station on GasBuddy. In monitoring mode, only stations whose price changed (with the old price and the difference), new stations and removed stations. Locations not found, locations with no stations, wrong inputs, refused requests and runs that hit their maximum charge come back as free rows that say why.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "locations": [
        "78704"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("neverempty/gas-station-prices-monitor").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "locations": ["78704"] }

# Run the Actor and wait for it to finish
run = client.actor("neverempty/gas-station-prices-monitor").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "locations": [
    "78704"
  ]
}' |
apify call neverempty/gas-station-prices-monitor --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,neverempty/gas-station-prices-monitor"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/oXEg4TazmSt7E21py/builds/7BUVRjtp37FgspwRK/openapi.json
