# ⛽ Fuel & EV Charging Price Finder — Live Gas Prices + Chargers (`inexhaustible_glass/fuel-ev-price-finder`) Actor

Live, per-station fuel prices (every grade, cash & credit) by ZIP, city, address, or GPS coordinates — plus optional nearby EV charging station data (network, connector types, charger counts). No login, no API key, no proxy needed.

- **URL**: https://apify.com/inexhaustible_glass/fuel-ev-price-finder.md
- **Developed by:** [Hitman studio](https://apify.com/inexhaustible_glass) (community)
- **Categories:** Agents, MCP servers
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.00 / 1,000 results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

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

## ⛽ Fuel & EV Charging Price Finder — Live Gas Prices + Chargers

Live, per-station **fuel prices** (every grade, cash *and* credit) for any US
ZIP, city, full address, or GPS coordinates — plus, as a bonus most
fuel-price tools don't offer, nearby **EV charging stations** (network,
connector types, charger counts). No login, no API key, and (as tested) no
residential proxy needed.

> Keywords: gas prices api, fuel price scraper, gasbuddy scraper, gas station
> finder, EV charging station finder, fuel price by zip code, real-time gas
> prices, diesel price lookup.

### 🌟 Why this one

There are already several GasBuddy scrapers on Apify. This one earns its
place with real, tested differences, not marketing claims:

- **Every fuel grade in one call** — regular, midgrade, premium, diesel,
  E85, Unleaded 88 — plus **both cash and credit price** per grade. Several
  competing tools return only one grade per run.
- **Local price trend included** — today's area average, today's low, and
  trend direction for the searched locality, state, and the whole US —
  fields no competing GasBuddy actor on Apify currently returns.
- **A real ZIP-code fix, not a known limitation left unhandled**: a bare
  5-digit ZIP in a dense city (confirmed on `10001` New York and `60601`
  Chicago) returns **zero** stations from GasBuddy's own search — their
  geocoder doesn't resolve it the way it resolves `"Austin, TX"` or a raw
  lat/lng. This Actor automatically resolves a bare ZIP to coordinates via a
  free lookup first, so it works the same for every ZIP, not just the ones
  GasBuddy's own search happens to like.
- **EV charging stations, optionally, from the same search** — network name,
  connector types (J1772 / CCS / CHAdeMO / Tesla NACS), Level 1/2/DC-fast
  charger counts, access hours, pricing where reported. This is a second,
  genuinely useful dataset bundled with the fuel data, not a repackaging of
  it.
- **No proxy burn** — confirmed by direct testing: a plain outbound request
  (no residential/datacenter proxy) reaches GasBuddy's API successfully.
  Lower cost for you, passed on as lower pricing.
- **Honest about rate limits**: GasBuddy does apply a temporary IP-based
  rate limit (`HTTP 429`) under heavy burst traffic. This Actor backs off
  and retries automatically — see the FAQ for exactly what that means for
  your run.

### ⚙️ How it works

1. Fetches a CSRF token from GasBuddy's own homepage (the same token its own
   website's browser session would get).
2. For a bare ZIP code, resolves it to coordinates first via a free, no-key
   ZIP lookup, then searches GasBuddy by coordinates — this is what fixes
   the dense-city-ZIP gap described above. City names, full addresses, and
   raw `lat,lng` input go straight to GasBuddy's own search.
3. Calls GasBuddy's own public GraphQL API (the same one its website calls)
   to get the station list with every grade's cash/credit price, amenities,
   hours, rating, outage status, and the area's price trend.
4. If EV search is on, calls the same API's EV-charging-station endpoint
   centered on the same location.

### 🚀 Quick start

```json
{ "searches": ["90210", "Austin, TX"], "maxResultsPerSearch": 20 }
```

Or via the API, once published:

```bash
curl "https://api.apify.com/v2/acts/fuel-ev-price-finder/run-sync-get-dataset-items?token=<YOUR_TOKEN>" \
  -H "Content-Type: application/json" \
  -d '{"searches": ["90210"], "includeEvStations": true}'
```

### 📥 Input

| Field | Type | Default | Description |
|---|---|---|---|
| `searches` | array (required) | — | ZIP code, `"City, State"`, full address, or `"lat,lng"` — one per line |
| `fuelType` | select | `all` | Only list stations selling this grade (every row still shows all grades that station has) |
| `maxResultsPerSearch` | integer | `20` | Max stations per location (1–200) |
| `maxAgeDays` | integer | `0` | Ignore price reports older than this many days (`0` = no limit) |
| `includeEvStations` | boolean | `false` | Also return nearby EV charging stations as a second row type |
| `evRadiusMiles` | integer | `10` | EV search radius, only used when the above is on |

> ⚠️ **Best input formats**: `"90210"`, `"Austin, TX"`, `"123 Main St,
> Chicago, IL"`, or `"34.0901,-118.4065"`. A bare ZIP in a dense city is
> auto-corrected via ZIP lookup (see "Why this one" above) — but if that
> lookup itself is ever unavailable, prefer `"City, State"` for guaranteed
> results.

### 📤 Output

**Fuel station row** (`record_type: "fuel_station"`):

| Field | Description |
|---|---|
| `search_term` | The location this row was found for |
| `station_id`, `name`, `brands` | Station identity |
| `address_line1`, `city`, `region`, `postal_code`, `country` | Address |
| `latitude`, `longitude`, `distance_miles` | Location |
| `price_regular`, `price_midgrade`, `price_premium`, `price_diesel`, `price_e85`, `price_unl88` | Best available price per grade |
| `prices_detail` | Full cash + credit breakdown per grade, with posted timestamps |
| `fuels_available` | Which grades this station sells |
| `star_rating`, `ratings_count` | Community rating |
| `amenities` | e.g. C-Store, Car Wash, ATM, Pay At Pump |
| `has_active_outage`, `open_status`, `hours_status`, `opening_hours` | Operational status |
| `pay_at_pump_available`, `offers`, `phone` | Extras |
| `area_name`, `area_avg_price_today`, `area_avg_price_today_low`, `area_trend_direction` | Local price trend |

**EV station row** (`record_type: "ev_station"`):

| Field | Description |
|---|---|
| `name`, `network`, `network_url` | Charging station identity |
| `level1_charger_count`, `level2_charger_count`, `dc_fast_charger_count` | Charger counts by speed |
| `connector_counts` | J1772 / CCS / CHAdeMO / Tesla NACS counts |
| `pricing`, `access_hours`, `access_code`, `cards_accepted` | Usage details |
| `last_confirmed` | Last time this listing was confirmed |

```json
{
  "record_type": "fuel_station",
  "search_term": "90210",
  "station_id": "6258",
  "name": "76",
  "brands": ["76"],
  "city": "Beverly Hills",
  "region": "CA",
  "price_regular": 6.59,
  "price_midgrade": 6.74,
  "price_premium": 6.99,
  "price_diesel": 9.14,
  "star_rating": 4.2,
  "ratings_count": 74,
  "amenities": ["ATM", "C-Store", "Car Wash", "Pay At Pump"],
  "area_name": "Beverly Hills",
  "area_avg_price_today": 6.4,
  "area_trend_direction": -1
}
```

A search that fails outright (e.g. an unresolvable location) produces one
`record_type: "error"` row with a real error message — never a silent
empty result that looks like "no stations found" when it was actually a
request failure.

### 🎯 Use cases

- **Price comparison apps / widgets** — live per-grade prices by location
- **Fleet & logistics cost planning** — diesel prices along a route
- **EV route planning** — charging network/connector coverage by area
- **Market research** — regional fuel price trend tracking over time
- **Local SEO / directory sites** — real-time station data for a gas-station or EV-charger locator page
- **Personal finance / commute-cost tools** — nearest cheapest grade

### 🔌 Integration examples

**Python (apify-client):**

```python
from apify_client import ApifyClient
client = ApifyClient("<YOUR_TOKEN>")
run = client.actor("fuel-ev-price-finder").call(
    run_input={"searches": ["90210"], "includeEvStations": True}
)
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item["name"], item.get("price_regular"))
```

**JavaScript (apify-client):**

```javascript
import { ApifyClient } from 'apify-client';
const client = new ApifyClient({ token: '<YOUR_TOKEN>' });
const run = await client.actor('fuel-ev-price-finder').call({
    searches: ['Austin, TX'], fuelType: 'diesel',
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
```

### 📊 Performance & reliability

| Metric | Value (measured, not estimated) |
|---|---|
| Cost per run (1 location, 5 stations) | ~$0.002 (real cloud run, tracked via Apify REST API) |
| Proxy required | No — confirmed by direct testing, plain outbound request |
| Login / API key required | No |
| Data source | GasBuddy's own public GraphQL API (the one its website uses) |
| Bare-ZIP coverage fix | Automatic (ZIP lookup fallback), confirmed fixing dense-city ZIPs that returned 0 results otherwise |
| Rate-limit handling | Automatic backoff + retry on `HTTP 429`; a sustained block surfaces as one clear error row, not a silent empty result |
| Known failure mode | Heavy burst traffic can trigger GasBuddy's own temporary IP rate limit — see FAQ |

### ❓ FAQ

**Does this need a GasBuddy login or API key?**
No — it calls the same public endpoint GasBuddy's own website calls, with
no authenticated session.

**Why did my search return 0 stations?**
Usually one of: the ZIP/city genuinely has no reporting stations nearby, or
(for a bare ZIP) the automatic ZIP-lookup fallback itself was briefly
unavailable — retry with `"City, State"` format in that case. A real
request failure always comes back as a `record_type: "error"` row with a
message, never a silent empty result.

**Is this affiliated with GasBuddy?**
No. It's an independent tool reading the same public data GasBuddy's own
website serves to any visitor — not an official GasBuddy product.

**What happens if GasBuddy rate-limits the run?**
GasBuddy applies a temporary `HTTP 429` to IPs sending a burst of requests
too fast. The Actor backs off and retries automatically. If you're running
many searches, a `maxResultsPerSearch` in the 10–30 range per search is the
sweet spot — keep concurrency modest and you shouldn't hit it in normal use.

**How fresh are the prices?**
These are the same crowd-reported prices GasBuddy's own site shows —
freshness depends on how recently someone reported that station's price.
Use `maxAgeDays` to exclude stale reports.

**Does it cover Canada?**
GasBuddy itself has some Canadian coverage; this Actor passes through
whatever GasBuddy's search returns for the location given, so Canadian
cities may work but aren't the primary tested coverage (US is).

**Found a bug or a location that fails unexpectedly?**
A failed row always includes a real `error` message — worth reporting
through the Actor's Issues tab if it doesn't match a known limitation above.

### ⚖️ Notes

Reads only public, already-crowd-sourced price data and public station/EV
listings — no login, no private data, no scraping of personal information.

# Actor input Schema

## `searches` (type: `array`):

One per line. ZIP code (90210), city + state (Austin, TX), full address, or GPS coordinates (34.0901,-118.4065).

## `fuelType` (type: `string`):

Only list stations that sell this fuel. 'All stations' shows every nearby station regardless of fuel sold — each row still lists every grade that station has.

## `maxResultsPerSearch` (type: `integer`):

How many stations to return for each location searched.

## `maxAgeDays` (type: `integer`):

Ignore price reports older than this many days. 0 = no limit (always show the latest reported price, however old).

## `includeEvStations` (type: `boolean`):

For each location, also return nearby EV charging stations — network, connector types, charger counts. Separate rows, marked record_type: "ev_station".

## `evRadiusMiles` (type: `integer`):

Only used when 'Also find EV charging stations' is on.

## Actor input object example

```json
{
  "searches": [
    "90210",
    "Austin, TX",
    "34.0901,-118.4065"
  ],
  "fuelType": "all",
  "maxResultsPerSearch": 20,
  "maxAgeDays": 0,
  "includeEvStations": false,
  "evRadiusMiles": 10
}
```

# Actor output Schema

## `stations` (type: `string`):

No description

# 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 = {
    "searches": [
        "90210"
    ],
    "fuelType": "all",
    "maxResultsPerSearch": 20,
    "maxAgeDays": 0,
    "includeEvStations": false,
    "evRadiusMiles": 10
};

// Run the Actor and wait for it to finish
const run = await client.actor("inexhaustible_glass/fuel-ev-price-finder").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 = {
    "searches": ["90210"],
    "fuelType": "all",
    "maxResultsPerSearch": 20,
    "maxAgeDays": 0,
    "includeEvStations": False,
    "evRadiusMiles": 10,
}

# Run the Actor and wait for it to finish
run = client.actor("inexhaustible_glass/fuel-ev-price-finder").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 '{
  "searches": [
    "90210"
  ],
  "fuelType": "all",
  "maxResultsPerSearch": 20,
  "maxAgeDays": 0,
  "includeEvStations": false,
  "evRadiusMiles": 10
}' |
apify call inexhaustible_glass/fuel-ev-price-finder --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,inexhaustible_glass/fuel-ev-price-finder"
        }
    }
}
```

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/MvfmikhGEOtgnAYIl/builds/ODfw7dpIcHRGkhyCe/openapi.json
