# GasBuddy Gas Prices Scraper $0.16/1K: Fuel Prices by ZIP & City (`zaiq/gasbuddy-scraper`) Actor

Gas station fuel prices from GasBuddy for any US ZIP code, Canadian postal code or city: regular, midgrade, premium and diesel, cash and credit, when each was posted, plus address, brand, coordinates, rating and amenities. $0.16 per 1,000 stations.

- **URL**: https://apify.com/zaiq/gasbuddy-scraper.md
- **Developed by:** [Zaiq](https://apify.com/zaiq) (community)
- **Categories:** Automation, Travel
- **Features:** Limited permissions
- **Stats:** 1 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.12 / 1,000 stations

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 Gas Prices Scraper: fuel prices by ZIP code, postal code or city

![GasBuddy Gas Prices Scraper: Fuel Prices by ZIP & City](https://api.apify.com/v2/key-value-stores/4VJNANhwKgqPpXtAi/records/hero-gasbuddy-scraper.jpg)

Get **gas station fuel prices from GasBuddy** for any **US ZIP code**, **Canadian postal code** or **city**: **regular, midgrade, premium and diesel** (and E85 or UNL88 where sold), **cash and credit**, and **when each price was posted**. Every row also carries the station's **address, brand, coordinates, star rating and amenities**.

Each row shows the **price change since your last run**, so a **daily schedule becomes a fuel price tracker**. Built for **fleet and logistics teams**, **fuel retailers watching competitors**, **price-comparison apps**, **analysts** and **AI agents**. **No login**, no GasBuddy account. From **$0.12 per 1,000 stations**.

### What you get

| Field | What it holds |
|---|---|
| Station | `stationId`, `name`, `brands`, `address`, `city`, `state`, `postalCode`, `country`, `latitude`, `longitude`, `url` |
| Prices (per grade) | `regularPrice`, `regularCredit`, `regularCash`, `regularPostedAt`, `regularAgeHours`, and the same for `midgrade`, `premium`, `diesel` (`e85`, `unl88` where sold) |
| Units | `currency` (USD or CAD), `priceUnit` (per gallon in the US, per litre in Canada, in dollars) |
| Station details | `grades`, `starRating`, `ratingsCount`, `amenities`, `outage` |
| Tracking | `previousPrice`, `priceChange`, `priceChangePercent`, `priceStatus` (first-seen, unchanged, dropped, raised), `firstSeenAt` |

### What people use it for

- **Fleet fuel planning:** find the cheapest diesel along your routes every morning
- **Competitor pricing:** watch every station around yours and see who moved
- **Price-comparison apps:** feed local gas prices into your own map or app
- **Market analysis:** average prices by city, brand or grade over time
- **Expense checks:** compare drivers' fuel receipts with the posted price
- **AI agents:** answer "where is gas cheapest near 77002" with real prices

### How to use it

1. Type **ZIP codes, postal codes or cities** (Houston, TX), one per line.
2. Choose how many **stations per location** and, if you like, a fuel or brands.
3. Click **Start**, then set a **schedule** to track price changes.

### Input

| Field | Example | Notes |
|---|---|---|
| ZIP codes, postal codes or cities | `77002`, `M5V 2T6`, `Houston, TX` | Up to 200 |
| Stations per location | `50` | Up to 5,000; big cities list thousands |
| Fuel GasBuddy searches by | `regular` | Rows still carry every price |
| Only prices posted in the last (hours) | `24` | 0 = any age |
| Brands | `sample brand` | Optional name or brand words |
| Compare with my last run | on | Free; Tracking name keeps lists apart |

### Output

Each result is one row in the run's dataset (download it as JSON, CSV, Excel, XML or HTML, or read it through the API). An example row (values shortened):

```json
{
  "stationId": "100001",
  "name": "Sample Fuel Stop",
  "brands": [
    "Sample Brand"
  ],
  "address": "100 Sample Ave",
  "city": "Houston",
  "state": "TX",
  "postalCode": "77002",
  "country": "US",
  "latitude": 29.7565,
  "longitude": -95.3653,
  "currency": "USD",
  "priceUnit": "per gallon",
  "regularPrice": 3.09,
  "regularCredit": 3.09,
  "regularCash": 2.89,
  "regularPostedAt": "2026-11-07T03:12:28.961Z",
  "regularAgeHours": 7.2,
  "midgradePrice": 3.79,
  "premiumPrice": 4.29,
  "dieselPrice": 4.99,
  "grades": [
    "regular",
    "midgrade",
    "premium",
    "diesel"
  ],
  "starRating": 3.7,
  "ratingsCount": 32,
  "amenities": [
    "C-Store",
    "Pay At Pump",
    "Restrooms",
    "Air Pump"
  ],
  "outage": false,
  "searchLocation": "Houston, TX",
  "url": "https://www.gasbuddy.com/station/100001",
  "previousPrice": 3.19,
  "priceChange": -0.1,
  "priceChangePercent": -3.1,
  "priceStatus": "dropped",
  "scrapedAt": "2026-11-07T10:26:36Z"
}
```

A record named `SUMMARY` in the run's key-value store says what each input returned, with any notes (for example an account that does not exist), what was charged and how much traffic the run used.

### Pricing

- **$0.00016 per station** ($0.16 per 1,000), **$0.12 per 1,000 on Gold and above**
- One station row carries every grade, cash and credit
- Stations with no price on GasBuddy, and places GasBuddy does not recognise, are free
- Price tracking is free
- Apify's $0.00005 start charge counts towards your Maximum cost per run.
- Launch price. It may rise later; Apify emails every user 14 days before any price increase takes effect, and a rise can happen at most once a month.

What typical jobs cost at the list price:

| Job | Cost |
|---|---|
| One ZIP code (a few stations) | about $0.0006 |
| 50 stations in a city | $0.008 |
| 300 stations across two cities | $0.048 |
| The same 300 stations every day for a month | $1.44 ($1.08 on Gold) |

On Apify's Scale and Business plans the per-event prices are lower (Store discounts). Set **Maximum cost per run** and the Actor stops cleanly when it is reached: you never pay more than that.

### Tips

- A US ZIP code often has only a handful of stations; a city (Houston, TX) lists thousands. Use the stations limit to control cost.
- Canadian prices are converted from cents per litre to dollars per litre.
- Use one Tracking name per list you watch, so each keeps its own price history.
- `regularAgeHours` tells you how fresh a price is; GasBuddy prices come from drivers and feeds, so some are a day or more old.

### Use it through the API

**Python**

```python
from apify_client import ApifyClient

client = ApifyClient("<YOUR_APIFY_TOKEN>")
run = client.actor("zaiq/gasbuddy-scraper").call(run_input={"locations": ["Houston, TX", "77002"], "maxStationsPerLocation": 50})
for row in client.dataset(run.default_dataset_id).iterate_items():
    print(row)
```

**JavaScript**

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

const client = new ApifyClient({ token: '<YOUR_APIFY_TOKEN>' });
const run = await client.actor('zaiq/gasbuddy-scraper').call({"locations": ["Houston, TX", "77002"], "maxStationsPerLocation": 50});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
```

**HTTP (one call, results back)**

```bash
curl -X POST 'https://api.apify.com/v2/acts/zaiq~gasbuddy-scraper/run-sync-get-dataset-items?token=<YOUR_APIFY_TOKEN>' \
  -H 'Content-Type: application/json' \
  -d '{"locations": ["Houston, TX", "77002"], "maxStationsPerLocation": 50}'
```

### Integrations and schedules

- **Schedules:** run it every hour, day or week from the Apify Console (Schedules) and keep a history of results.
- **Make, Zapier, n8n, Google Sheets, Slack, Airtable:** connect it through Apify's integrations, or send each finished run to a **webhook**.
- **Datasets:** results stay in the run's dataset; export them or read them by API whenever you need them.

### Use it with AI agents (MCP)

Add Apify's MCP server with this Actor already pinned (`https://mcp.apify.com?tools=zaiq/gasbuddy-scraper`) to Claude, ChatGPT, Cursor, VS Code or any MCP client. The agent can find this Actor and run it for you: ask it for "which stations near 77002 have the cheapest diesel right now". AI agents can also pay for runs directly through Apify's agentic payments.

### Limits

- Prices are what GasBuddy shows at the time of the run, reported by drivers and data feeds; they can be hours or days old (see the posted time).
- Stations without any price are left out of the results (and are free).
- The names of the people who reported prices are not included.
- US and Canada only.
- Apify's free plan: the first 10 stations.

### FAQ

**Do I need a GasBuddy account?**

No. It reads what GasBuddy shows any visitor.

**Can I search by city?**

Yes: Houston, TX or Calgary, AB. A city returns stations across the whole city, many more than a ZIP code.

**Are Canadian prices in cents?**

No. GasBuddy shows Canadian prices in cents per litre; rows convert them to dollars per litre, with currency CAD.

**How does price tracking work?**

Each station's price (regular grade, else the first grade it sells) is compared with your last run. The history is kept in a store in your own Apify account, free.

**What if a place is not found?**

The run says so in its summary and nothing is charged for it.

**How fresh are the prices?**

Each grade has its posted time and age in hours. In a 300-station test in Houston and Dallas the median regular price was about 10 hours old.

### Related Actors from Zaiq

- [google-maps-leads-scraper](https://apify.com/zaiq/google-maps-leads-scraper): every business in an area, with contacts
- [car-listings-scraper](https://apify.com/zaiq/car-listings-scraper): used car listings and prices
- [google-shopping-scraper](https://apify.com/zaiq/google-shopping-scraper): product prices across shops

### Support

Questions, a site that changed, or a field you need? Open an issue on this Actor's **Issues** tab: we answer there, usually within a day.

***

Also found as: gasbuddy scraper, gas prices, fuel prices, gas prices api, gas station prices, diesel prices, gasbuddy api, fuel price tracker, gas prices by zip code, cheapest gas.

# Actor input Schema

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

Where to look, one per line: a US ZIP code (77002), a Canadian postal code (M5V 2T6) or a city with its state or province (Houston, TX; Calgary, AB). Up to 200.

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

How many stations to read for each location, up to 5,000. A large city lists thousands.

## `fuel` (type: `string`):

Stations that sell this fuel are listed. Every row still carries every price the station has.

## `maxPriceAgeHours` (type: `integer`):

Optional: GasBuddy leaves out prices older than this. 0 means any age.

## `brands` (type: `array`):

Optional: keep only stations whose name or brand contains one of these words.

## `trackPrices` (type: `boolean`):

Each row shows the price change since your last run (regular grade, else the first grade with a price), from a store in your own Apify account. Free.

## `trackingName` (type: `string`):

Optional: keep a separate price history for each list you watch.

## Actor input object example

```json
{
  "locations": [
    "Houston, TX"
  ],
  "maxStationsPerLocation": 10,
  "fuel": "regular",
  "maxPriceAgeHours": 0,
  "trackPrices": true
}
```

# Actor output Schema

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

Dataset: the results.

## `summary` (type: `string`):

What each input returned, and notes.

# 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": [
        "Houston, TX"
    ],
    "maxStationsPerLocation": 10
};

// Run the Actor and wait for it to finish
const run = await client.actor("zaiq/gasbuddy-scraper").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": ["Houston, TX"],
    "maxStationsPerLocation": 10,
}

# Run the Actor and wait for it to finish
run = client.actor("zaiq/gasbuddy-scraper").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": [
    "Houston, TX"
  ],
  "maxStationsPerLocation": 10
}' |
apify call zaiq/gasbuddy-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,zaiq/gasbuddy-scraper"
        }
    }
}
```

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/jGKOJAwnPiCEaw8mu/builds/iL6wSZqfoOc0GZPIS/openapi.json
