# Costco Gas Prices Tracker - US & Canada, Regular/Premium/Diesel (`yugenox/costco-gas-prices-tracker`) Actor

Costco's own posted gas prices for every Costco gas station in the US and Canada: regular, premium and diesel, with address, coordinates, gas station hours and diesel availability. Changes-only mode for daily monitoring adds the previous price and the change. No login.

- **URL**: https://apify.com/yugenox/costco-gas-prices-tracker.md
- **Developed by:** [Yugenox Corp](https://apify.com/yugenox) (community)
- **Categories:** E-commerce, Business
- **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 station saveds

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

## Costco Gas Prices Tracker

Get **Costco's own posted gas prices** for every Costco gas station in the **United States and Canada** in one run: regular, premium and diesel, with the station's address, coordinates, gas station hours and whether it sells diesel. Turn on **changes-only mode** and schedule it daily or hourly to get just the stations whose price moved, with the previous price and the change.

No login, no location inputs needed: one run covers about 690 Costco gas stations in roughly a minute.

### Why this actor

- **Official prices, not crowd reports.** Prices come from Costco's own warehouse pages, the same numbers Costco shows its members, rather than user-submitted reports.
- **Every Costco station in one run.** No ZIP codes or radius searches; filter by country, state / province or warehouse number if you want fewer.
- **Built for monitoring.** Changes-only mode remembers the last prices in your Apify account and returns only the changes, at a lower rate for unchanged stations.
- **State / province summary.** Every run also stores the min, median and max price per state or province and grade, with the cheapest station.

### Use cases

- Fleet operators and Costco Business members choosing where to fuel
- Fuel-price apps, maps and "Costco gas price today" pages
- Analysts tracking Costco as a regional price leader against other retailers
- Alerts when your local Costco changes its price

### Input

| Field | What it does |
|---|---|
| Country | US, Canada, or both (default) |
| States / provinces | Optional codes such as `WA`, `TX`, `ON`, `BC` |
| Warehouse numbers | Optional, e.g. `1200`, `524` |
| Fuel types | regular, premium, diesel (default all) |
| Only stations whose price changed | Changes-only mode for scheduled runs |
| Include Business Centers | On by default |
| Max stations | Cap on saved rows (0 = no limit) |

Example: `{"country": "US", "states": ["WA", "OR"], "fuelTypes": ["regular", "diesel"]}`

### Output

One row per station (trimmed real row, 2026-11-07):

```json
{
  "warehouseId": "156",
  "name": "E Edmonton",
  "country": "CA",
  "state": "AB",
  "city": "Edmonton",
  "address": "13650 50 St Nw",
  "postalCode": "T5A 4Y3",
  "latitude": 53.59615938,
  "longitude": -113.4160303,
  "regular": 1.249,
  "premium": 1.499,
  "diesel": null,
  "currency": "CAD",
  "unit": "litre",
  "pricesPerGallon": { "regular": 4.728, "premium": 5.674, "diesel": null },
  "sellsDiesel": false,
  "gasStationHours": [{ "days": "Mon-Fri", "open": "06:00", "close": "21:30", "closed": false }],
  "warehouseUrl": "https://www.costco.ca/w/-/ab/edmonton/156",
  "observedAt": "2026-11-07T20:49:52.478Z",
  "changeStatus": null
}
```

US prices are USD per gallon, Canadian prices CAD per litre, exactly as Costco posts them; `pricesPerLitre` and `pricesPerGallon` give every grade in both units. In changes-only mode rows also carry `previousRegular` / `previousPremium` / `previousDiesel`, `deltaRegular` / `deltaPremium` / `deltaDiesel` and `previousObservedAt`.

The **SUMMARY** record in the run's key-value store has min / median / max per state or province and grade, plus the cheapest station.

### Price

- **$1.00 per 1,000 stations saved** ($0.001 per row)
- Changes-only mode: unchanged stations cost **$0.20 per 1,000 checked**; changed stations are $1.00 per 1,000
- **$0.003 per run start**

A full US + Canada sweep (about 690 stations) costs about $0.69. A daily changes-only run where 100 stations moved costs about $0.22.

Stations with no posted price and stations that could not be read are never charged.

### Tips

- Schedule changes-only runs (e.g. every morning) for a cheap daily price feed.
- Use `fuelTypes: ["diesel"]` to list only the stations that sell diesel.
- Find a warehouse number at the end of its Costco warehouse page URL.

### FAQ

**Is it legal to scrape Costco?**
This actor reads publicly available prices that Costco shows to every visitor without logging in, at a modest pace, and respects Costco's robots.txt. Scraping public data is generally legal, but check the rules that apply to your use and your country, and consult a lawyer if you are unsure.

**Does it access any private data?**
No. It reads public station information and posted prices only. There is no login and no personal data.

**How fresh are the prices?**
Each row's `observedAt` is the moment the price was read from Costco. Costco does not publish when it last changed a price, so schedule runs as often as you need.

**Why is a station missing?**
Some stations have no posted price at a given moment (for example a station that is closed or just opened). They are skipped and not charged; the run's status message tells you how many.

**What about Costco gas stations outside North America?**
This version covers the US and Canada.

# Actor input Schema

## `country` (type: `string`):

Which Costco gas stations to check: the US (USD per gallon), Canada (CAD per litre) or both.

## `states` (type: `array`):

Optional two-letter state or province codes, e.g. WA, CA, TX, ON, BC. Leave empty for all.

## `warehouseIds` (type: `array`):

Optional Costco warehouse numbers (the number at the end of a costco.com/w/... warehouse page, e.g. 1200 or 524). Leave empty for all stations.

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

Grades to return: regular, premium, diesel. Leave empty for all. Choosing only diesel skips stations without diesel.

## `changesOnly` (type: `boolean`):

For scheduled runs. Remembers each station's last prices in your account; the first run saves every station (baseline), later runs save only stations whose price changed, with the previous price and the change. Unchanged stations are charged at the lower 'checked' rate.

## `includeBusinessCenters` (type: `boolean`):

Include gas stations at Costco Business Centers.

## `maxStations` (type: `integer`):

Maximum station rows to save (0 = no limit). A full US + Canada sweep is about 690 stations.

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

Apify datacenter proxy (included in every plan) is the default and is all this actor needs.

## Actor input object example

```json
{
  "country": "CA",
  "states": [],
  "warehouseIds": [],
  "fuelTypes": [],
  "changesOnly": false,
  "includeBusinessCenters": true,
  "maxStations": 20,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

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

Posted prices per station.

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

Min, median and max price per state or province and grade, with the cheapest station.

## `run` (type: `string`):

Status and statistics for this run.

## `report` (type: `string`):

RUN_REPORT: how the run ended, counts and requests.

# 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 = {
    "country": "CA",
    "maxStations": 20,
    "proxyConfiguration": {
        "useApifyProxy": true
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("yugenox/costco-gas-prices-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 = {
    "country": "CA",
    "maxStations": 20,
    "proxyConfiguration": { "useApifyProxy": True },
}

# Run the Actor and wait for it to finish
run = client.actor("yugenox/costco-gas-prices-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 '{
  "country": "CA",
  "maxStations": 20,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}' |
apify call yugenox/costco-gas-prices-tracker --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,yugenox/costco-gas-prices-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/MtqYrQywEFH5lltHw/builds/OamslM2FCJgREtt3B/openapi.json
