# Fuel Price Tracker: Gas Station Prices in 23 Countries (`deepurple/fuel-price-tracker`) Actor

Fuel and gas prices API: station-level prices in 23 countries incl. US, Canada, UK, Mexico, Australia, Germany, France, Spain, Brazil. Search by ZIP, city or coordinates, or get only price changes with Telegram, Slack or webhook alerts. From $0.85 per 1,000 prices.

- **URL**: https://apify.com/deepurple/fuel-price-tracker.md
- **Developed by:** [Misha Ershov](https://apify.com/deepurple) (community)
- **Categories:** Travel, E-commerce, News
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.85 / 1,000 station fuel prices

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 prices by station for the US and Canada (GasBuddy), the UK, Australia, Germany, Spain, Portugal, Mexico, France, Italy, Austria, Slovenia, Romania, Croatia, Chile, Brazil and Sweden — as an API, on a schedule, or only the prices that changed.

$0.85 per 1,000 prices · no start fee · ~30 s per run · no proxies needed.

Each output row is one station and one fuel type, so it is easy to filter, chart, and plug into spreadsheets, BI tools, or automations.

### Why this one

- **Cheaper per price than the market leader.** $0.00085 per station x grade, with no start fee.
- **Change-tracking mode.** `changes` returns only stations whose price moved since the previous run, with `previousPrice` and `change`.
- **Twenty-three countries in one Actor.** US, Canada, UK, Australia, Germany, Spain, Portugal, Mexico, France, Italy, Austria, Slovenia, Romania, Croatia, Chile, Brazil, Sweden, Greece, Poland, Czechia, Bulgaria, Hungary and Slovakia share one output format.
- **Search by ZIP, city, address text, or by coordinates plus radius.** Coordinates are routed to the country that contains them.
- **Pay only for the grades you choose.** The default run returns the regular grade only; each station x grade is one row and one charge.

Measured on the Apify platform on 2026-10-10: one run with 4 countries took 32 s and cost $0.002 in platform usage, with 0 broken prices; the US median price age was 13 h. No proxies and no CAPTCHA solving are needed, so runs are fast and cheap.

### Compare

| | This Actor | Typical alternatives |
|---|---|---|
| Price per 1,000 prices | $0.85 | $1.00 to $1.35 |
| Start fee | none | up to $0.07 per run (residential proxies and a CAPTCHA solver) |
| Change mode | yes, with `previousPrice` and `change` | usually not available |
| Countries | US, Canada, UK, Australia, Germany, Spain, Portugal, Mexico, France, Italy, Austria, Slovenia, Romania, Croatia, Chile, Brazil, Sweden, Greece, Poland, Czechia, Bulgaria, Hungary, Slovakia | often US only |
| Grades per run | the ones you choose | one grade, or all grades at a higher price |

### Use cases

- Fleet and delivery cost tracking: schedule a daily run for the regions you drive in and watch the cost per liter or gallon.
- Price-comparison apps and fuel-card dashboards: feed station-level prices into your product through the API.
- Analysts and journalists: collect regional prices over time and use `changes` mode to log every move.

### Countries and sources

| Country | Source | License | Update cadence |
|---|---|---|---|
| US | GasBuddy (crowdsourced and data-feed prices) | none stated | continuous, per report |
| Canada | GasBuddy (crowdsourced and data-feed prices) | none stated | continuous, per report |
| United Kingdom | Retailer open-data price feeds (CMA fuel price scheme), geocoded with postcodes.io | UK retailer open data (CMA fuel price scheme) | differs by retailer; feeds older than 7 days are skipped |
| Australia | PetrolSpy public station endpoint (NSW and WA government data plus crowd reports), geocoded with zippopotam.us and OpenStreetMap Nominatim | none stated | continuous, per report |
| Germany | MTS-K prices as listed on clever-tanken.de | MTS-K (Markttransparenzstelle für Kraftstoffe) | near real time |
| France | data.economie.gouv.fr, "Prix des carburants - flux instantane" | Licence Ouverte v2.0 | near real time |
| Spain | Ministerio, "Precios de carburantes" (MINETUR) | CC BY 4.0 | several times a day |
| Portugal | DGEG, "Preços de Combustíveis" | none stated | continuous |
| Mexico | CRE, public places and prices XML | none stated | several times a day |
| Italy | MIMIT daily price export | IODL 2.0 | once a day (prices as of 08:00) |
| Austria | E-Control Spritpreisrechner | none stated | continuous |
| Slovenia | goriva.si, national price portal | none stated | continuous |
| Romania | Monitorul Prețurilor (Competition Council) | none stated | continuous |
| Chile | CNE, Bencina en Línea | CNE attribution (see `license`) | continuous (station-reported) |
| Brazil | ANP, Levantamento de Preços de Combustíveis | ANP attribution (see `license`) | weekly survey |
| Sweden | Bensinpriser.nu | Bensinpriser.nu attribution (see `license`) | crowd-sourced, at most 3 days old |
| Greece | Fuelo.net (crowd-sourced) | none stated | crowd-sourced, can be several days old |
| Poland | Fuelo.net (crowd-sourced) | none stated | crowd-sourced, can be several days old |
| Czechia | Fuelo.net (crowd-sourced) | none stated | crowd-sourced, can be several days old |
| Bulgaria | Fuelo.net (crowd-sourced) | none stated | crowd-sourced, can be several days old |
| Hungary | Fuelo.net (crowd-sourced) | none stated | crowd-sourced, can be several days old |
| Slovakia | Fuelo.net (crowd-sourced) | none stated | crowd-sourced, can be several days old |
| Croatia | MZOE, Ministry of Economy fuel price portal | none stated | regulated prices, about every 2 weeks |

The European countries use official open data. Please keep the attribution that the license of each source requires when you republish the data (the `license` field is filled in for you).

### Input reference

An empty input runs the example location 77002 (Houston, US).

| Field | Description |
|---|---|
| `countries` | Multiselect of `US`, `CA`, `MX`, `GB`, `AU`, `DE`, `ES`, `PT`, `FR`, `IT`, `AT`, `SI`, `RO`, `HR`, `CL`, `BR`, `SE`, `GR`, `PL`, `CZ`, `BG`, `HU`, `SK`. Default `["US"]`. Unknown codes sent via the API are skipped with a warning. |
| `locations` | US and Canada: ZIP or postal code, or `City, ST/PROV`. Europe: postal code or city name. UK: postcode, outcode (for example `M1`) or town. Australia: postcode or suburb/city. Mexico: 5-digit CP or city. Portugal: postal code such as `1000-001`, or town. Slovenia: 4-digit postal code (`1000`) or city (`Ljubljana`). Romania: city name (`Cluj-Napoca`) or coordinates; Romanian postcodes are not supported. Croatia: city name (`Zagreb`) or coordinates; Croatian postcodes are not supported. Chile: comuna name (`Recoleta`) or coordinates; Chilean postcodes are not supported. Sweden: town or municipality name (`Malmö`) or coordinates, no postcodes. Greece, Poland, Czechia, Bulgaria, Hungary, Slovakia: town or city name or coordinates, no postcodes. Brazil: city (`Guarulhos`), `City, UF` (`Valença, RJ`) or CEP (`07178-580`). Germany: PLZ or city name; German search works by PLZ or city, not coordinates. A location is tried in every selected country; prefix it (`FR:75001`) to pin it to one country. Postal codes are searched only in the selected countries with that postal format; city names are searched in every selected country (prefix `GB:Leeds` to pin a city to one country). |
| `coordinates` | Coordinates can also be typed into Locations as `lat,lng`. Optional points `{ "lat": 48.2082, "lng": 16.3738, "radiusKm": 5 }`. A point is queried only in the selected countries whose bounding box contains it (Vienna goes to AT only, Nice to FR and IT, Madrid to ES, whichever are selected). A point inside no selected country is not queried and is listed in `failedLocations` with the error `outside selected countries`. |
| `fuelTypes` | Any of `regular`, `midgrade`, `premium`, `diesel`, `e85`, `e10`, `lpg`. Default: `regular` only. Each fuel type at a station is one row and one charge, so you pay only for the grades you choose. An explicit empty list returns all grades. |
| `mode` | `snapshot` (default) or `changes`. |
| `maxStationsPerLocation` | Default 100, max 2000. |
| `maxPriceAgeHours` | Skip older prices. `0` = no filter. Prices without a timestamp (Austria) are kept. |
| `stateKey` | Name of the saved price history for `changes` mode. Default: a hash of the input. |
| `minPriceChange` | Number, default `0`. In `changes` mode, moves smaller than this (in the station's currency, e.g. `0.05`) are ignored. |
| `brands` | List of words, default empty. Keeps only stations whose brand (or name, when the brand is empty) contains any word, case-insensitive. Dropped stations are not charged. |
| `maxDistanceKm` | Number, default `0` (off). Keeps only stations within this distance of the searched point; stations with unknown distance are dropped. Not charged for dropped stations. |
| `sortBy` | `none` (default), `price` or `distance`. Rows are sorted within each location: stations found for that location are sorted, after `maxStationsPerLocation` was applied. |
| `telegramBotToken` | Hidden field. Bot token from @BotFather, for price change alerts. |
| `telegramChatId` | Your Telegram chat id (a number; a group id starts with `-`). |
| `webhookUrl` | An http(s) URL that receives a JSON POST with the changes. |
| `slackWebhookUrl` | Hidden field. Slack incoming webhook URL (`https://hooks.slack.com/...`). |
| `discordWebhookUrl` | Hidden field. Discord channel webhook URL (`https://discord.com/api/webhooks/...`). |
| `proxyConfiguration` | Optional Apify Proxy, off by default. |

Example:

```json
{
  "countries": ["US", "FR"],
  "locations": ["77002", "Los Angeles, CA", "FR:75001"],
  "fuelTypes": ["regular", "diesel"],
  "mode": "snapshot"
}
```

### Output

One dataset item per station and fuel type:

```json
{
  "stationId": "FR:75001003",
  "country": "FR",
  "source": "fr-gouv",
  "name": null,
  "brand": null,
  "address": "8,10,10bis Rue Bailleul",
  "city": "Paris",
  "region": "Ile-de-France",
  "postalCode": "75001",
  "lat": 48.861,
  "lng": 2.341,
  "fuelType": "diesel",
  "fuelTypeRaw": "Gazole",
  "price": 2.68,
  "priceCash": null,
  "distanceKm": 1.42,
  "rating": null,
  "ratingCount": null,
  "currency": "EUR",
  "unit": "liter",
  "priceUpdatedAt": "2026-10-06T17:57:24Z",
  "scrapedAt": "2026-10-10T12:41:56Z",
  "previousPrice": null,
  "license": "Licence Ouverte v2.0"
}
```

Notes on the fields:

- `price` is always positive. Stations with no price (`0`, empty, or `- - -`) for a fuel produce no row and are not billed.
- `priceCash` is filled for the US only, when GasBuddy reports a separate cash price.
- `distanceKm` is the distance from the searched point in km, `null` when the source gives no coordinates (for example Germany and Brazil).
- `rating` and `ratingCount` come from GasBuddy (US, CA) and are `null` for other sources.
- `unit` is `gallon` for the US and `liter` in Canada and Europe. Canadian prices are CAD per liter (for example 1.729, not 172.9).
- `priceUpdatedAt` is ISO 8601 in UTC, or `null` when the source does not publish a per-price time (Austria).
- `fuelType` is normalised; `fuelTypeRaw` keeps the source's own label. Italy: self-service prices are preferred over staffed-pump prices.
- `change` (`new`, `up`, `down`) appears only in `changes` mode.

A run also stores `RUN_SUMMARY` in the default key-value store: rows fetched and emitted, rows per country, `failedLocations[]` for any location that could not be loaded after three retries, and `emptyLocations[]` (`{location, countries}`) for locations that returned no stations in any of the searched countries.

### Changes mode and scheduling

In `changes` mode the Actor keeps `{stationId|fuelType: price}` in the named key-value store `fuel-price-state` under your `stateKey`.

- First run: every row is returned with `previousPrice: null` and `change: "new"`.
- Later runs: only rows whose price is new or different are returned, with `previousPrice` and `change` set.
- `snapshot` mode returns everything but also updates the saved history, so you can switch modes freely.

To track price moves, create an Apify **Schedule** (for example every 6 hours; once a day is enough for Italy) with the same input and `mode: "changes"`.

### Integrations (Make, Zapier, n8n)

Use the Apify integration in your tool:

1. Add the Apify module/node and choose this Actor.
2. Set the input as above, with `mode: "changes"` and a fixed `stateKey`.
3. Trigger the scenario from the Actor's "run succeeded" event (or from an Apify Schedule), then read the run's dataset items.
4. Route the rows to Slack, e-mail, Google Sheets, or a database. In `changes` mode each item is a price that just moved, so no extra de-duplication is needed.

### Limitations

- US data comes from GasBuddy, which is partly crowdsourced: some stations have stale or missing prices for some grades. Use `priceUpdatedAt` and `maxPriceAgeHours`.
- US station count: a ZIP search on GasBuddy returns only the stations located in that ZIP (often around 5 in a dense downtown ZIP). If `maxStationsPerLocation` is higher, the actor adds stations from a proximity search around them until the maximum is reached or no more exist, so expect up to the maximum for typical ZIPs. `maxStationsPerLocation` counts stations, including ones with no price for the requested grades, so fewer rows than stations can be emitted. Many stations in dense areas have no price at all and yield no rows.
- Austria: the E-Control API returns the 10 nearest stations per query point and fuel; use several coordinates to cover a city. Text locations work for Vienna postal codes and the larger Austrian cities; use `coordinates` for anywhere else. Natural gas is not covered.
- Spain: enter a postal code (CP) or a town name. A postal code loads only its province, so it is fast; a town name or a coordinate point downloads the national file once per run. Premium diesel and agricultural diesel are not emitted.
- Mexico and Portugal: search is by radius around the geocoded point. Portugal supports regular, premium, diesel and LPG only; Mexico supports regular, premium and diesel (no per-price timestamp).
- Slovenia: search is by radius around the geocoded point; fuels are regular (95), premium (100, else 98), diesel and LPG. There is no per-price timestamp.
- Romania: use a city name or coordinates; postcodes are not supported. Fuels are regular, premium, diesel and LPG; prices are in RON per litre and carry the time the station reported them.
- Croatia: use a city name or coordinates; postcodes are not supported. Prices are the regulated prices currently in force (they change about every two weeks) and `priceUpdatedAt` is the date they took effect. When a station offers several grades of one type, the cheapest is returned.
- Chile: use a comuna name or coordinates; postcodes are not supported. Prices are CLP per litre for regular (93), midgrade (95), premium (97) and diesel; the self-service price is used, and the assisted price only when a station has no self-service one. LPG is not covered.
- Brazil: prices come from the ANP weekly survey (updated once a week, collection date in `priceUpdatedAt`), which covers about 400 cities; a city outside the survey returns nothing. The file has no station coordinates, so `lat`/`lng` are empty and the radius is ignored: stations are ordered by the price of your first requested fuel. Prices are BRL per litre for regular (gasolina comum), premium (gasolina aditivada), diesel (S10, or S500 when a station has no S10) and `e85`, which means hydrated ethanol (etanol) in Brazil. Midgrade, E10 and LPG are not covered (GLP is a 13 kg cylinder, GNV is CNG). A city name found in several states returns all of them; add the state (`Valença, RJ`) to narrow it.
- Sweden: prices on Bensinpriser.nu are crowd-sourced by drivers and verified station owners, and the site shows only prices from the last 3 days, so a station without a recent report has no row. Search by town or municipality name (`Malmö`, `Kiruna`, `Göteborg`) or by coordinates; Swedish postcodes are not supported. The result is the cheapest stations in that municipality (ordered by the price of your first requested fuel, not by distance), up to your station limit. Prices are SEK per litre for regular (95), premium (98), diesel and `e85` (etanol); midgrade, E10 and LPG are not covered. `priceUpdatedAt` is the report date (date only).
- Greece, Poland, Czechia, Bulgaria, Hungary, Slovakia: prices come from Fuelo.net, a crowd-sourced site, and can be several days old, so check `priceUpdatedAt`. Search by town or city name or coordinates (radius applies); postcodes are not supported. Stations whose prices Fuelo marks as approximate are skipped. Prices are per litre in EUR (GR, BG, SK), PLN (PL), CZK (CZ) or HUF (HU) for regular, midgrade (95+), premium (98), diesel and LPG; premium and diesel fall back to the 98+/diesel-plus grades only when the standard grade has no price.
- Italy: the official export updates once a day, so intraday moves are not visible. Postal-code search matches the CAP written inside the station address.
- Italy and Spain: fuel labels that do not map to a normalised type (for example CNG/Metano, GNL, AdBlue) are not emitted.
- US `unl88` (E15) is not emitted.
- France: station names and brands are not published in the open dataset, so `name` and `brand` are `null`.
- Prices are reported as published by the sources; no guarantee of accuracy is given.

### Pricing

This Actor uses pay-per-event pricing, with no start fee:

- `station-price`: $0.00085 per station x grade returned (that is $0.85 per 1,000 prices).
- `price-change`: $0.005 per changed price in `changes` mode, in addition to the station-price event.

Current prices are always shown on the Actor's page.

### Price change alerts

Get told about price moves without opening Apify:

1. Set `mode` to `changes`.
2. Create a bot with @BotFather and send it any message.
3. Put the bot token and your chat id in the input (`telegramBotToken`, `telegramChatId`).
4. Add a schedule in Apify (for example hourly).

After each run with at least one up or down change, the Actor sends a short message to Telegram. If you set `webhookUrl`, it also receives a JSON POST with `stateKey`, `changes`, `newCount` and `text`.

- Slack: create an incoming webhook in Slack and paste its URL into `slackWebhookUrl`.
- Discord: open channel settings, then Integrations, then Webhooks, and copy the URL into `discordWebhookUrl`.
- Email: Apify's built-in Gmail integration emails after every successful run. For email only when prices changed, send the webhook to Zapier or Make.

Moves smaller than `minPriceChange` are not emitted and not charged; they add up until they cross the threshold. Alerts are free, and a failed alert never fails the run.

### FAQ

#### Is there a GasBuddy API?

GasBuddy does not offer a public API for this data. This Actor returns GasBuddy station prices for the US and Canada as structured data through the Apify API, including cash and credit prices and the `postedTime` of the report.

#### How do I get gas prices by ZIP code?

Put the ZIP code in `locations`, for example `{"countries": ["US"], "locations": ["77002"]}`. You get one row per station and fuel type.

#### How do I track fuel price changes daily?

Set `mode` to `changes`, use a fixed `stateKey`, and create an Apify Schedule that runs once a day. Each run returns only the stations whose price changed since the previous run.

#### How much does it cost?

$0.00085 per station x grade ($0.85 per 1,000 prices), plus $0.005 per changed price in `changes` mode. There is no start fee. The default run returns the regular grade only.

#### Which countries are supported?

The US and Canada (GasBuddy), the UK (retailer open data), Australia (PetrolSpy), Germany (MTS-K via clever-tanken), Spain, Portugal (DGEG), Mexico (CRE), France, Italy, Austria, Slovenia, Romania, Croatia, Chile and Brazil (official government open data).

#### Where do the UK prices come from, and how fresh are they?

From the retailers' own open price feeds published under the UK CMA fuel price scheme. Freshness differs by retailer, and a feed whose last update is older than 7 days is skipped. `RUN_SUMMARY.ukFeeds` shows the status of each feed. Prices are in GBP per litre.

#### Why does a ZIP code with no gas station still return results?

Some ZIP codes have no gas station inside (e.g. Midtown Manhattan); the actor then searches around the ZIP's center.

#### Can I search by coordinates?

Yes. Pass `coordinates` with `lat`, `lng` and `radiusKm`. Each point is queried in the selected country that contains it.

#### Can I use it from Claude or ChatGPT (MCP)?

Yes. AI agents can call the Actor through the Apify MCP server; see the MCP section below.

### MCP

AI agents can run this Actor through the Apify MCP server. Add the Actor id `Deepurple/fuel-price-tracker` to the tools of your MCP client, then ask the agent for fuel prices in plain language.

### Legal

Not affiliated with GasBuddy. US prices come from GasBuddy's public website; check that your use complies with its terms.

# Actor input Schema

## `countries` (type: `array`):

Country codes: US, CA, MX, GB, AU, DE, ES, PT, FR, IT, AT, SI, RO, HR, CL, BR, SE, GR, PL, CZ, BG, HU, SK. Pick the countries to query, for example \["US", "DE"]. Each fuel price returned is one charge, so leave out countries you do not need. Unknown codes are skipped with a warning.

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

Places to search, as strings, for example "77002", "Los Angeles, CA", "DE:10115", "FR:75001" or "Malmö". A postal code or a city name; coordinates as "lat,lng" where supported. Prefix a country code ("DE:10115") to pin it to one country, otherwise it is tried in every selected country. Formats per country: see README, Input reference.

## `coordinates` (type: `array`):

Points as objects: {"lat": 48.2082, "lng": 16.3738, "radiusKm": 5}. radiusKm applies to FR, ES, IT; AT always returns the 10 nearest stations; US and CA return the nearest stations.

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

Fuel types to return. Default: regular only. Each fuel type at a station is one row and one charge, so pick only the grades you need. An explicit empty list returns all grades.

## `mode` (type: `string`):

snapshot: every current price. changes: only new or changed prices since the previous run with the same State key.

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

Upper bound of stations fetched for each location.

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

Skip prices older than this. 0 disables the filter. Prices without a timestamp (AT) are always kept.

## `stateKey` (type: `string`):

Name of the saved price history used by 'changes' mode. Defaults to a hash of the input, so identical inputs share history.

## `minPriceChange` (type: `number`):

Ignore moves smaller than this, in the station's currency (e.g. 0.05). 'changes' mode only. Ignored moves are not emitted, not charged and do not update the saved price, so small moves add up until they cross the threshold.

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

Keep only stations whose brand (or name, when the brand is empty) contains any of these words, case-insensitive. Example: \["shell", "omv"]. Empty = all brands. Dropped stations are not charged.

## `maxDistanceKm` (type: `number`):

Keep only stations within this distance of the searched point. 0 disables the filter. Stations with unknown distance (for example Germany and Brazil, or sources without coordinates) are dropped when it is set. Dropped stations are not charged.

## `sortBy` (type: `string`):

Order of rows within each location: by price (cheapest first, grouped by fuel type) or by distance (nearest first). none keeps the source order.

## `telegramBotToken` (type: `string`):

Bot token from @BotFather. Send your bot any message first.

## `telegramChatId` (type: `string`):

Your chat id (a number; a group id starts with '-').

## `webhookUrl` (type: `string`):

An http(s) URL that receives a JSON POST with the changes.

## `slackWebhookUrl` (type: `string`):

Slack incoming webhook URL (https://hooks.slack.com/...).

## `discordWebhookUrl` (type: `string`):

Discord channel webhook URL (https://discord.com/api/webhooks/...).

## `proxyConfiguration` (type: `object`):

Not needed by default. Enable Apify Proxy only if a source starts blocking requests.

## Actor input object example

```json
{
  "countries": [
    "US"
  ],
  "locations": [
    "77002",
    "Los Angeles, CA"
  ],
  "coordinates": [],
  "fuelTypes": [
    "regular"
  ],
  "mode": "snapshot",
  "maxStationsPerLocation": 100,
  "maxPriceAgeHours": 0,
  "minPriceChange": 0,
  "brands": [],
  "maxDistanceKm": 0,
  "sortBy": "none"
}
```

# Actor output Schema

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

One row per gas station: address, coordinates, fuel prices by type, update time and price change since the previous run.

# 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 = {
    "countries": [
        "US"
    ],
    "locations": [
        "77002",
        "Los Angeles, CA"
    ],
    "fuelTypes": [
        "regular"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("deepurple/fuel-price-tracker").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 = {
    "countries": ["US"],
    "locations": [
        "77002",
        "Los Angeles, CA",
    ],
    "fuelTypes": ["regular"],
}

# Run the Actor and wait for it to finish
run = client.actor("deepurple/fuel-price-tracker").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 '{
  "countries": [
    "US"
  ],
  "locations": [
    "77002",
    "Los Angeles, CA"
  ],
  "fuelTypes": [
    "regular"
  ]
}' |
apify call deepurple/fuel-price-tracker --silent --output-dataset

```

## MCP server setup

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

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/6ZqMk2FSzLnllu4Ep/builds/HQtc2khbmo6P7eRrd/openapi.json
