# Mexico DOF Scraper: Diario Oficial de la Federación API (`daperk/dof-mexico-scraper`) Actor

DOF Mexico scraper: every publication of the Diario Oficial de la Federación (DOF hoy) as JSON. Decretos, acuerdos, NOM, aranceles, SAT rules, plus tipo de cambio FIX, UDIS and TIIE. Daily alerts, keyword filters. No login.

- **URL**: https://apify.com/daperk/dof-mexico-scraper.md
- **Developed by:** [Daniel Pena](https://apify.com/daperk) (community)
- **Categories:** News, Business, Automation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.00 / 1,000 dof notes

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

## Mexico DOF Scraper: Diario Oficial de la Federacion API

Get every publication from Mexico's **Diario Oficial de la Federacion (DOF)** as clean JSON, CSV or Excel. Decrees, agreements, NOMs (Normas Oficiales Mexicanas), tariff changes, SAT and Hacienda resolutions, Banxico circulars and more. You can also pull the **official daily exchange rate (tipo de cambio FIX), UDIS and TIIE** published in the DOF.

Data comes from the official public SIDOF open data service of the Secretaria de Gobernacion. No login, no cookies, no proxy, no browser. Runs in seconds and costs very little.

**Extrae el Diario Oficial de la Federacion (DOF) en JSON.** Decretos, acuerdos, NOM, resoluciones, tipo de cambio, UDIS y TIIE. Filtra por fecha, palabra clave, dependencia y tipo de documento. Ideal para alertas diarias.

### What you can do with it

- **Daily regulatory alerts.** Schedule it every morning with "Only new notes" on and send new DOF items to Slack, email, Google Sheets or a webhook.
- **Trade and customs monitoring.** Track tariff (arancel) changes, import and export rules, cupos and anti-dumping resolutions from Secretaria de Economia.
- **NOM tracking.** Every note gets a `nomCodes` list (for example `PROY-NOM-018-SSA-2026`) and a `docType` like `NOM` or `PROYECTO_NOM`, so you can follow new standards and public consultations.
- **Tax and compliance.** Follow SAT Resolucion Miscelanea Fiscal changes, IEPS fuel stimulus updates and Hacienda agreements.
- **Finance data.** Get the official DOF values for DOLAR FIX, UDIS, TIIE 28, 91 and 182 days and TIIE de fondeo for any date range.
- **Legal research and AI.** Turn on full text to feed DOF publications to an LLM, a search index or a RAG pipeline.

### Input

| Field | What it does |
|---|---|
| `dateFrom` / `dateTo` | Date range (YYYY-MM-DD or "7 days"). Max 366 days per run. |
| `daysBack` | If no From date, how many days back from To date (default 7). |
| `keywords` | Match words in the title or agency. Accents and case are ignored. |
| `keywordMode` | `any` or `all`. |
| `excludeKeywords` | Drop notes with these words. |
| `agencies` | Partial match on the issuing agency, like `SECRETARIA DE ECONOMIA`. |
| `powers` | `PE` Ejecutivo, `PL` Legislativo, `PJ` Judicial, `OA` Organismos Autonomos. |
| `docTypes` | `DECRETO`, `ACUERDO`, `NOM`, `PROYECTO_NOM`, `RESOLUCION`, `CIRCULAR`, `CONVOCATORIA` and more. |
| `editions` | `MAT` morning, `VES` evening, `EXT` extraordinary. |
| `includeFullText` | Adds the plain text of each note. |
| `includeIndicators` | Adds daily DOLAR, UDIS and TIIE values. |
| `includeAvisos` | Adds the "Avisos judiciales y generales" section (off by default). |
| `onlyNew` + `stateKey` | Alerts mode. Skips notes you already got in earlier runs. |
| `maxItems` | Stop after this many notes. Newest days go first. |

#### Example input

```json
{
  "daysBack": 30,
  "keywords": ["arancel", "importacion", "norma oficial mexicana"],
  "agencies": ["SECRETARIA DE ECONOMIA"],
  "includeIndicators": true,
  "maxItems": 200
}
```

### Output

One row per DOF note:

```json
{
  "type": "nota",
  "id": 5802610,
  "date": "2026-10-30",
  "edition": "Matutina",
  "title": "Aviso de consulta publica del Proyecto de Norma Oficial Mexicana PROY-NOM-018-SSA-2026, Para la practica de terapias dialiticas.",
  "docType": "PROYECTO_NOM",
  "nomCodes": ["PROY-NOM-018-SSA-2026"],
  "power": "Poder Ejecutivo",
  "powerCode": "PE",
  "agency": "SECRETARIA DE SALUD",
  "page": 44,
  "order": 15,
  "isAviso": false,
  "hasPdf": true,
  "hasWordDoc": true,
  "url": "https://dof.gob.mx/nota_detalle.php?codigo=5802610&fecha=30/10/2026",
  "sidofUrl": "https://sidof.segob.gob.mx/notas/5802610",
  "fullText": null
}
```

And, if you turn on indicators, one row per indicator per day:

```json
{ "type": "indicador", "date": "2026-10-30", "indicator": "DOLAR", "value": 18.8148, "unit": "MXN per USD", "rawValue": "18.8148" }
```

The dataset has two views in the Console: **DOF notes** and **Indicators**.

### Pricing

Pay per event. You only pay for rows you get.

| Event | Price |
|---|---|
| DOF note | $0.002 ($2 per 1,000) |
| DOF note with full text | $0.005 ($5 per 1,000), charged instead of the normal note |
| Financial indicator | $0.001 ($1 per 1,000) |

A normal weekday has about 15 to 30 notes (without the paid avisos section). A daily alert for one topic usually costs a few cents a month. You can set a max cost per run in Apify and the Actor stops cleanly when it is reached.

### What it costs for common jobs

You pay per row you get. Filters run before charging, so notes you filter out are free.

| Job | Settings | Rows per month (approx.) | Cost per month |
|---|---|---|---|
| Daily alert on one topic (for example tariffs) | `onlyNew`, 2 or 3 keywords, daily schedule | 20 to 60 notes | $0.04 to $0.12 |
| Whole DOF every day, titles and links | `onlyNew`, no filters, daily schedule | 330 to 660 notes | $0.66 to $1.32 |
| Whole DOF every day with full text (for AI or search) | `onlyNew`, `includeFullText` | 330 to 660 notes | $1.65 to $3.30 |
| FIX, UDIS and TIIE for one full year | `includeIndicators`, 366 day range | about 1,500 values | about $1.50, one time |
| One year of NOM publications | `docTypes: ["NOM", "PROYECTO_NOM"]`, 366 day range | depends on the year | $0.002 per note |

How we got these numbers: a normal weekday has about 15 to 30 notes without the paid avisos section, and the DOF publishes about 22 days a month. Apify also adds its small default fee for each run start. Set a max cost per run and the Actor stops cleanly at that limit.

### How it compares

| | This Actor | Reading dof.gob.mx by hand | Calling the SIDOF service yourself |
|---|---|---|---|
| Time per day | None after setup | 10 to 30 minutes | None after you build it |
| Setup | Click Start | None | Write and maintain code for dates, editions, header rows and avisos |
| Filters by keyword, agency, type, edition | Yes, accents ignored | Browser search only | You build them |
| Only new notes (alerts) | Yes, built in | No | You build it |
| NOM codes pulled out of titles | Yes | No | You build it |
| FIX, UDIS and TIIE in the same run | Yes | Separate page | Separate calls |
| Export to Sheets, Slack, Zapier, Make, n8n | Yes, Apify integrations | Copy and paste | You build it |
| Price | From $2 per 1,000 notes | Free | Free, plus your time and server |

**When something else is a better fit**

- You only need the exchange rate and nothing from the DOF. Banxico's own SIE API is free and is the original source for FIX. It asks you to request a token first.
- You read one or two notes a week. Reading dof.gob.mx by hand is free and fast enough.
- You need a legal opinion about a publication. This Actor gives you the data, not legal advice.

### Use it from AI agents (MCP)

This Actor works as a tool for Claude, ChatGPT, Cursor and other MCP clients through the Apify MCP server. Prompts that work well:

- "List every NOM and PROYECTO_NOM published in the DOF in the last 30 days, with links."
- "What did Secretaria de Economia publish in the DOF this week about aranceles or importacion?"
- "Give me the DOLAR FIX, UDIS and TIIE 28 values from the DOF for every day of October 2026."

Inputs are dates, keywords and agencies, outputs are flat JSON with links to the official note, and filtered out notes are free, so agents can call it without running up a bill.

### Schedule it

Create a daily schedule in Apify (for example 8:00 Mexico City time, Monday to Friday) with "Only new notes" on. Each morning you get only the new DOF publications for your topics, and Apify integrations can send them to Slack, email, Google Sheets, Zapier, Make or n8n.

### How it works

1. For each day in your range (newest first) it reads the official SIDOF day index.
2. It skips agency header rows, robots.txt blocked notes and, by default, the paid avisos section.
3. It applies your filters, then saves each matching note. Full text and indicators are optional extra requests.
4. In alerts mode it remembers note IDs in a named key-value store so the next run only returns new items.

### Good to know

- The DOF usually does not publish on Saturdays, Sundays and some holidays. Empty days are normal.
- Dates use Mexico City time.
- `docType` is detected from the title, so treat it as a helpful label, not a legal classification.
- Full text is never downloaded for the avisos section, because it is mostly court edicts that name private people.
- The Actor reads robots.txt on sidof.segob.gob.mx and skips any note listed there. If robots.txt cannot be read, the run stops with no results and no charge.

### Legal

This Actor only reads public government publications from Mexico's official gazette, which is published for anyone to read. It does not log in, does not bypass any protection and respects robots.txt. You are responsible for how you use the data, including any personal data that may appear in official texts. This is not legal advice and this Actor is not affiliated with the Gobierno de Mexico, Segob or the DOF.

### How to get today's DOF (DOF hoy)

Set **Days back** to 1 and click **Start**. You get every note published in today's Diario Oficial de la Federacion with title, agency, document type, NOM codes and direct links. Schedule it every morning with "Only new notes" on for a daily DOF alert.

### How to monitor NOMs and tariff changes in the DOF

Filter by keywords like `NOM`, `arancel`, `cupo` or `importacion` and by agency (Secretaria de Economia, SAT, Hacienda). Each matching publication arrives once, ready for Slack, email or Google Sheets.

### Como obtener el tipo de cambio FIX, UDIS y TIIE del DOF

Activa los indicadores y elige un rango de fechas. Recibes el tipo de cambio FIX (dolar), UDIS y TIIE de 28, 91 y 182 dias publicados en el DOF, una fila por dia.

### FAQ

**Is there an official DOF API?** The SIDOF service used here is public, but it is not documented for developers and it is easy to get wrong (date formats, editions, header rows, avisos). This Actor gives you a clean, stable output and filters.

**Can I get older years?** Yes, any date the SIDOF service has. Split long ranges into runs of up to 366 days.

**Can I get only Diario Oficial tariff changes?** Use `agencies: ["SECRETARIA DE ECONOMIA"]` with `keywords: ["arancel", "cupo", "importacion"]`.

**Something is broken?** Open an issue on the Issues tab with your input and the date. I usually reply within 1 to 2 business days.

**Related searches:** DOF, DOF hoy, Diario Oficial de la Federacion, Diario Oficial de la Federacion API, DOF Mexico scraper, Mexico official gazette, NOM Norma Oficial Mexicana, tipo de cambio FIX DOF, UDIS hoy, TIIE, aranceles Mexico, Resolucion Miscelanea Fiscal, monitoreo regulatorio Mexico, tipo de cambio dof hoy, tipo de cambio dof api, dof tipo de cambio, dof publicaciones, dof nom 035, dof sat, dof udis, dof usd mxn.

# Actor input Schema

## `dateFrom` (type: `string`):

First day to check (YYYY-MM-DD) or a relative value like "7 days". Leave empty to use 'Days back'. Max range per run is 366 days.

## `dateTo` (type: `string`):

Last day to check (YYYY-MM-DD). Leave empty for today (Mexico City time).

## `daysBack` (type: `integer`):

Used only when 'From date' is empty. 0 = only the 'To date' day. 7 = the last 8 days.

## `keywords` (type: `array`):

Only return notes whose title or agency contains these words. Accents and case are ignored ("energia" matches "Energía"). Leave empty to get everything.

## `keywordMode` (type: `string`):

'any' = at least one keyword. 'all' = every keyword must appear.

## `excludeKeywords` (type: `array`):

Drop notes whose title or agency contains any of these words.

## `agencies` (type: `array`):

Only these issuing agencies (partial match). Examples: SECRETARIA DE ECONOMIA, SECRETARIA DE HACIENDA, BANCO DE MEXICO, SECRETARIA DE SALUD.

## `powers` (type: `array`):

Leave empty for all.

## `docTypes` (type: `array`):

Only these types (detected from the title). Leave empty for all.

## `editions` (type: `array`):

Morning, evening and extraordinary editions. Leave empty for all three.

## `includeAvisos` (type: `boolean`):

Adds the paid notices section (titles look like 'Aviso REF:581469'). Off by default because it is mostly court edicts. Full text is never fetched for these.

## `includeFullText` (type: `boolean`):

Download the full plain text of each note. Costs more per note and is slower (one extra request per note).

## `maxTextChars` (type: `integer`):

Cut the full text after this many characters.

## `includeIndicators` (type: `boolean`):

Also save the daily official values: DOLAR (tipo de cambio FIX), UDIS, TIIE 28/91/182 days and TIIE de fondeo.

## `onlyNew` (type: `boolean`):

Skip notes this Actor already returned in earlier runs with the same 'State name'. Turn this on for a daily schedule so you only get (and pay for) new items.

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

Name for the 'already seen' list used by 'Only new notes'. Use a different name for each saved task.

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

Stop after this many notes. Newest days are processed first.

## `requestDelayMs` (type: `integer`):

Polite pause between calls to the government server.

## Actor input object example

```json
{
  "daysBack": 7,
  "keywordMode": "any",
  "includeAvisos": false,
  "includeFullText": false,
  "maxTextChars": 20000,
  "includeIndicators": false,
  "onlyNew": false,
  "stateKey": "default",
  "maxItems": 500,
  "requestDelayMs": 400
}
```

# Actor output Schema

## `notes` (type: `string`):

Notes published in the Diario Oficial de la Federacion.

## `indicators` (type: `string`):

FIX exchange rate, UDIS and TIIE values.

# 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 = {
    "daysBack": 7
};

// Run the Actor and wait for it to finish
const run = await client.actor("daperk/dof-mexico-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 = { "daysBack": 7 }

# Run the Actor and wait for it to finish
run = client.actor("daperk/dof-mexico-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 '{
  "daysBack": 7
}' |
apify call daperk/dof-mexico-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,daperk/dof-mexico-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/IojDrkApsJUtIQMSd/builds/xKLYsPEHbWRqwbBAe/openapi.json
