# ANP Weekly Fuel Prices Brazil (`scrapewise/anp-precos-combustiveis`) Actor

Average, minimum and maximum weekly fuel prices by municipality, product and brand from ANP

- **URL**: https://apify.com/scrapewise/anp-precos-combustiveis.md
- **Developed by:** [Scrapewise Data](https://apify.com/scrapewise) (community)
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.85 / 1,000 fuel price delivereds

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?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## ANP Fuel Prices Brazil / Preços de Combustíveis

Weekly fuel prices from the official ANP survey: average, minimum and maximum by municipality, or the price, brand and address of every surveyed gas station. For fleet managers, gas stations, price comparison apps and journalists.

### Use cases

- A fleet manager compares diesel prices across the cities on a route every week.
- A gas station benchmarks its price against every competitor of the same brand in town.
- A newsroom or BI team tracks gasoline and ethanol prices by state over time.

### Two levels

| `nivel` | One row per | Rows per week | Fields |
|---|---|---|---|
| `municipio` (default) | municipality and product | ~3,900 | average, minimum, maximum, standard deviation, stations surveyed |
| `posto` | surveyed gas station and product | ~20,000 | price, brand, CNPJ, company name, address, collection date |

Products: gasolina comum, gasolina aditivada, etanol hidratado, óleo diesel, óleo diesel S10, GLP (13 kg) and GNV.

### Input examples

```json
{ "uf": "SP", "municipio": "São Paulo", "produto": "gasolina" }
```

```json
{ "nivel": "posto", "municipio": "São Paulo", "bandeira": "IPIRANGA", "produto": "gasolina comum", "maxItems": 10 }
```

All filters are optional and accent-insensitive.

### Output examples

Real runs on 11/09/2026 (survey week 30/08 to 05/09/2026; `coletado_em` and `url_origem` omitted).

Municipality level:

```json
{"semana_inicio": "2026-08-30", "semana_fim": "2026-09-05", "uf": "SP", "municipio": "SAO PAULO", "produto": "GASOLINA ADITIVADA", "postos_pesquisados": 181, "unidade_medida": "R$/l", "preco_medio_revenda": 6.68, "preco_minimo_revenda": 5.89, "preco_maximo_revenda": 8.99, "desvio_padrao_revenda": 0.5262, "coef_variacao_revenda": 0.079}
{"semana_inicio": "2026-08-30", "semana_fim": "2026-09-05", "uf": "SP", "municipio": "SAO PAULO", "produto": "GASOLINA COMUM", "postos_pesquisados": 210, "unidade_medida": "R$/l", "preco_medio_revenda": 6.31, "preco_minimo_revenda": 5.44, "preco_maximo_revenda": 8.97, "desvio_padrao_revenda": 0.4658, "coef_variacao_revenda": 0.074}
```

Gas station level:

```json
{"data_coleta": "2026-08-31", "uf": "SP", "municipio": "SAO PAULO", "cnpj": "08442236000190", "razao_social": "AUTO POSTO JOSE MARIA LISBOA LTDA", "nome_fantasia": "JM LISBOA", "endereco": "AVENIDA NOVE DE JULHO 3062", "bairro": "JARDIM PAULISTA", "cep": "01406000", "bandeira": "VIBRA", "produto": "GASOLINA COMUM", "unidade_medida": "R$ / litro", "preco_revenda": 7.19}
{"data_coleta": "2026-08-31", "uf": "SP", "municipio": "SAO PAULO", "cnpj": "09305931000172", "razao_social": "AUTO POSTO SYSTEM LTDA", "nome_fantasia": null, "endereco": "AVENIDA CELSO GARCIA 4314", "bairro": "TATUAPE", "cep": "03064000", "bandeira": "IPIRANGA", "produto": "GASOLINA COMUM", "unidade_medida": "R$ / litro", "preco_revenda": 6.09}
{"data_coleta": "2026-08-31", "uf": "SP", "municipio": "SAO PAULO", "cnpj": "08813667000115", "razao_social": "COMERCIO VAREJISTA DE COMBUSTIVEIS SUCESSO LTDA.", "nome_fantasia": null, "endereco": "AVENIDA ENGENHEIRO ARMANDO DE ARRUDA PEREIRA 1646", "bairro": "JABAQUARA", "cep": "04308001", "bandeira": "VIBRA", "produto": "GASOLINA COMUM", "unidade_medida": "R$ / litro", "preco_revenda": 6.39}
```

### Pricing

**US$ 1.00 per 1,000 results delivered, no monthly subscription.** The full weekly station file (~20,000 prices) costs about US$ 20.

### How to use

- **API**: call this Actor's `run-sync-get-dataset-items` endpoint with your Apify API token and one of the inputs above.
- **Schedule**: ANP publishes the survey once a week (usually Friday or Saturday). A weekly Apify Schedule on Saturday keeps your table current.
- **Integrations**: connect through the official Apify app for n8n, Make or Zapier and send the dataset to Google Sheets, a database or Slack.

### Limitations

- Always returns the latest week ANP has published. For history, schedule it weekly and keep the datasets.
- ANP surveys a sample of stations in ~400 municipalities, not every station in Brazil.
- Brand (`bandeira`) exists only at the station level; `BRANCA` means an unbranded station.
- The spreadsheet is found on ANP's page on every run because its file name changes weekly. If ANP changes the page or the file layout, the run fails with a clear error instead of returning an empty dataset. Open an issue and it will be fixed.

This Actor only collects publicly available data published by ANP (Agência Nacional do Petróleo) and respects the source's terms of use.

### Em português

Preços semanais de combustível do levantamento oficial da ANP: médio, mínimo e máximo por município, ou o preço, a bandeira e o endereço de cada posto pesquisado. Serve para gestor de frota comparar diesel entre as cidades de uma rota, posto comparar o próprio preço com os concorrentes da mesma bandeira, e redação ou time de BI acompanhar gasolina e etanol por estado.

**Preço: US$ 1,00 por 1.000 resultados entregues, sem mensalidade.**

# Actor input Schema

## `nivel` (type: `string`):

municipio: one row per municipality and product with average, minimum and maximum price (~3,900 rows per week). posto: one row per surveyed gas station with its price, brand and address (~20,000 rows per week).

## `uf` (type: `string`):

Two-letter state code, e.g. SP, RJ. Optional.

## `municipio` (type: `string`):

Municipality name, accents optional (e.g. São Paulo, Rio de Janeiro). Optional.

## `produto` (type: `string`):

Part of the product name: gasolina, etanol, diesel, s10, glp, gnv. Optional.

## `bandeira` (type: `string`):

Fuel brand, e.g. VIBRA, IPIRANGA, RAIZEN, BRANCA (unbranded). Only used when level is 'posto'.

## `maxItems` (type: `integer`):

Maximum number of results to return.

## Actor input object example

```json
{
  "nivel": "municipio",
  "uf": "SP",
  "maxItems": 30
}
```

# Actor output Schema

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

No description

## `resultsCsv` (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 = {
    "uf": "SP"
};

// Run the Actor and wait for it to finish
const run = await client.actor("scrapewise/anp-precos-combustiveis").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 = { "uf": "SP" }

# Run the Actor and wait for it to finish
run = client.actor("scrapewise/anp-precos-combustiveis").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 '{
  "uf": "SP"
}' |
apify call scrapewise/anp-precos-combustiveis --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,scrapewise/anp-precos-combustiveis"
        }
    }
}
```

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/PYFACaI6YctY4t6PZ/builds/yaXrgsMO3Z2h42PjM/openapi.json
