# DOF Mexico Official Gazette Scraper (`scrapers_lat/dof-scraper`) Actor

Extract entries from Mexico's Diario Oficial de la Federacion (official federal gazette) by keyword or publication date. Scrape title, publication date, issuing body, agency, gazette ID, nota URL and full content for sanctions, insolvency and appointment notices.

- **URL**: https://apify.com/scrapers\_lat/dof-scraper.md
- **Developed by:** [Scrapers Lat](https://apify.com/scrapers_lat) (community)
- **Categories:** News, Business, Automation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: 5.00 out of 5 stars

## Pricing

from $8.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.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use 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

<!-- actor-banner -->
[![DOF Mexico Official Gazette Scraper](https://scrapers.lat/banners/dof-scraper.png)](https://console.apify.com/actors/42VqM3vAEebILKhpr/input)
<!-- /actor-banner -->

## DOF Scraper

> Extract entries from Mexico's Diario Oficial de la Federacion, the official federal gazette with sanctions, insolvency and appointment notices going back decades

![Apify](https://img.shields.io/badge/Platform-Apify-1CE1CE?logo=apify&logoColor=white)
![Coverage](https://img.shields.io/badge/Coverage-Mexico-blue)
![Maintained](https://img.shields.io/badge/Maintained-Yes-brightgreen)
![Output](https://img.shields.io/badge/Output-JSON%20%7C%20CSV%20%7C%20Excel-orange)

<table><tr>
<td align="center"><strong>9 fields</strong><br>per record</td>
<td align="center"><strong>Mexico</strong><br>federal gazette</td>
<td align="center"><strong>JSON / CSV / Excel</strong><br>output formats</td>
<td align="center"><strong>Updated</strong><br>2026-06-20</td>
</tr></table>

<br>

### What you get

Each record is one gazette entry (nota) from the Diario Oficial de la Federacion, found by keyword or publication date. Use it to monitor sanctions, insolvency filings, appointments and any official act published by the Mexican federal government.

- **title**: the full heading (encabezado) of the gazette entry
- **publicationDate**: date the entry was published, in DD-MM-YYYY format
- **organism**: the issuing body or branch (Poder Ejecutivo, Poder Judicial, Organismos Autonomos, Convocatorias, and others)
- **agency**: the specific dependency or secretariat that issued the entry
- **gazetteId**: identifier of the gazette edition (diario) the entry belongs to
- **id**: unique nota identifier
- **url**: direct link to the entry on the official site
- **content\***: the full plain-text body of the entry
- **observedAt**: when this entry was last seen by the scraper

*\*This field only appears when Fetch Full Content is set to true.*

### Who is it for

| Use case | Who benefits |
|---|---|
| Screen company sanctions and inhabilitaciones | KYC, AML and compliance teams |
| Track concursos mercantiles (insolvency) filings | Risk analysts and credit teams |
| Monitor public-official appointments and removals | Due diligence and adverse-media researchers |
| Watch tenders and convocatorias by date | Government-contract bidders |
| Build an adverse-media feed of official acts | Legal and investigative analysts |

### Frequently Asked Questions

**What does this scraper cover and how far back does it go?**
It searches the entire public archive of the Diario Oficial de la Federacion, Mexico's official federal gazette. Keyword searches return matching entries across all available years, and date searches let you target a specific publication window.

**How many entries can I collect in one run?**
You set the limit with Max Items. A keyword like inhabilitacion or concurso returns hundreds to thousands of matching entries, and the scraper pages through them until it reaches your limit.

**Can I filter by date or by issuing body?**
Yes. Set Date From and Date To (DD-MM-YYYY) to restrict a keyword search to a publication window, and pick an Issuing Body to narrow date searches to a single branch such as the Judicial Branch or Autonomous Bodies. A search term is always required.

**How do I get the full text of an entry?**
Turn on Fetch Full Content. The scraper then fetches the complete plain-text body of every matching entry and adds it to the content field, at the cost of one extra request per entry.

**What happens when a field is not available?**
Convocatorias and similar notices have no secondary agency, so the agency field is empty for those entries. When a request fails, the scraper writes a record with an error message instead of dropping it silently.



<!-- example-tasks -->
### Example use cases

Ready-to-run example tasks, each preconfigured for a common scenario. Open one and press run, or use it as a template:

- [Mexico Decree Monitoring in the Diario Oficial Federal Gazette](https://apify.com/scrapers_lat/dof-scraper/examples/mexico-decree-monitoring-diario-oficial): Track federal decrees in Mexico's official gazette (Diario Oficial de la Federacion). Keyword search and structured export of legal notices.
- [Mexico Government Agreement Tracking in the DOF Gazette](https://apify.com/scrapers_lat/dof-scraper/examples/mexico-government-agreement-tracking-dof): Monitor government agreements (acuerdos) in Mexico's official gazette, the Diario Oficial de la Federacion. Keyword search, structured export.
- [Mexico Public Tender and Bid Monitoring in the DOF Gazette](https://apify.com/scrapers_lat/dof-scraper/examples/mexico-public-tender-monitoring-dof): Watch public tenders (licitaciones) in Mexico's official gazette, the Diario Oficial de la Federacion. Keyword search, structured export.

<!-- /example-tasks -->

<!-- related-actors -->
### Related scrapers

Need data from the same space? Here are other scrapers we build and maintain:

- [Google News Article Scraper](https://apify.com/scrapers_lat/google-news-scraper): Scrape Google News by search, topic or top headlines. Extract article titles, publisher names...
- [Instagram Profile & Posts Scraper](https://apify.com/scrapers_lat/instagram-scraper): Extract public Instagram profiles and recent posts by username without login.
- [YouTube Scraper](https://apify.com/scrapers_lat/youtube-scraper): Scrape YouTube videos and channels by search query, video URL or channel URL.
- [X (Twitter) Profiles & Tweets Scraper](https://apify.com/scrapers_lat/x-twitter-scraper): Extract public X (Twitter) tweets by tweet ID: text, author, likes, replies, media and timestamps.
- [Reddit Posts & Comments Scraper](https://apify.com/scrapers_lat/reddit-scraper): Extract Reddit posts and comments from subreddits and search results using the public Reddit feeds.
- [TikTok Creative Center Top Ads Scraper](https://apify.com/scrapers_lat/tiktok-creative-center-scraper): Scrape top-performing TikTok ads from the public Creative Center by country, time period and...

<!-- /related-actors -->

<!-- scrapers-lat-cta -->
### More scrapers at scrapers.lat

This actor is built and maintained by [scrapers.lat](https://scrapers.lat), where we publish scrapers for Latin American and US public platforms: real estate, jobs, e-commerce, company registries and government data. Browse the full catalog, see live sample output for each one, or ask us for a custom scraper at [scrapers.lat](https://scrapers.lat).

---

> This actor is an independent tool and has no affiliation with the Diario Oficial de la Federacion or the Government of Mexico. It only accesses data that is publicly available on the platform. Use it in accordance with the site's terms of service.

# Actor input Schema

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

Maximum number of gazette entries (notas) to collect. Optional.
## `searchTerm` (type: `string`):

Keyword or phrase to search the Diario Oficial de la Federacion (Mexico's official federal gazette). Examples: concurso mercantil (insolvency), inhabilitacion (sanctions), nombramiento (appointments), or any company/person name. Required.
## `searchIn` (type: `string`):

Where to match the search term: the title/index of each entry, or the full content of the gazette entry.
## `matchType` (type: `string`):

How multi-word terms are matched: all words, an exact phrase, or any of the words.
## `dateFrom` (type: `string`):

Start of the publication date range, format DD-MM-YYYY (e.g. 01-01-2026). When both Date From and Date To are set, the actor runs a date-filtered search; leave both empty to search the whole archive by keyword.
## `dateTo` (type: `string`):

End of the publication date range, format DD-MM-YYYY (e.g. 20-06-2026).
## `organism` (type: `string`):

Restrict date-filtered searches to one issuing body. Leave as All to include every body. Only applies when a date range is set.
## `withContent` (type: `boolean`):

When enabled, the actor fetches the full text content of each gazette entry (one extra request per entry) and adds it to the output.

## Actor input object example

```json
{
  "maxItems": 10,
  "searchTerm": "concurso mercantil",
  "searchIn": "title",
  "matchType": "all",
  "dateFrom": "",
  "dateTo": "",
  "organism": "all",
  "withContent": false
}
````

# Actor output Schema

## `results` (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 = {
    "maxItems": 10,
    "searchTerm": "concurso mercantil"
};

// Run the Actor and wait for it to finish
const run = await client.actor("scrapers_lat/dof-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 = {
    "maxItems": 10,
    "searchTerm": "concurso mercantil",
}

# Run the Actor and wait for it to finish
run = client.actor("scrapers_lat/dof-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "maxItems": 10,
  "searchTerm": "concurso mercantil"
}' |
apify call scrapers_lat/dof-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=scrapers_lat/dof-scraper",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "DOF Mexico Official Gazette Scraper",
        "description": "Extract entries from Mexico's Diario Oficial de la Federacion (official federal gazette) by keyword or publication date. Scrape title, publication date, issuing body, agency, gazette ID, nota URL and full content for sanctions, insolvency and appointment notices.",
        "version": "0.1",
        "x-build-id": "zVAIXwlEXqMr8hhVN"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/scrapers_lat~dof-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-scrapers_lat-dof-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/scrapers_lat~dof-scraper/runs": {
            "post": {
                "operationId": "runs-sync-scrapers_lat-dof-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/scrapers_lat~dof-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-scrapers_lat-dof-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "required": [
                    "searchTerm"
                ],
                "properties": {
                    "maxItems": {
                        "title": "Max Items",
                        "minimum": 1,
                        "maximum": 1000000,
                        "type": "integer",
                        "description": "Maximum number of gazette entries (notas) to collect. Optional."
                    },
                    "searchTerm": {
                        "title": "Search Term",
                        "type": "string",
                        "description": "Keyword or phrase to search the Diario Oficial de la Federacion (Mexico's official federal gazette). Examples: concurso mercantil (insolvency), inhabilitacion (sanctions), nombramiento (appointments), or any company/person name. Required."
                    },
                    "searchIn": {
                        "title": "Search In",
                        "enum": [
                            "title",
                            "content"
                        ],
                        "type": "string",
                        "description": "Where to match the search term: the title/index of each entry, or the full content of the gazette entry.",
                        "default": "title"
                    },
                    "matchType": {
                        "title": "Match Type",
                        "enum": [
                            "all",
                            "phrase",
                            "any"
                        ],
                        "type": "string",
                        "description": "How multi-word terms are matched: all words, an exact phrase, or any of the words.",
                        "default": "all"
                    },
                    "dateFrom": {
                        "title": "Date From",
                        "type": "string",
                        "description": "Start of the publication date range, format DD-MM-YYYY (e.g. 01-01-2026). When both Date From and Date To are set, the actor runs a date-filtered search; leave both empty to search the whole archive by keyword.",
                        "default": ""
                    },
                    "dateTo": {
                        "title": "Date To",
                        "type": "string",
                        "description": "End of the publication date range, format DD-MM-YYYY (e.g. 20-06-2026).",
                        "default": ""
                    },
                    "organism": {
                        "title": "Issuing Body (Organismo)",
                        "enum": [
                            "all",
                            "PE",
                            "PL",
                            "PJ",
                            "OA",
                            "EPEM",
                            "EF",
                            "OD",
                            "AV",
                            "CV",
                            "VG"
                        ],
                        "type": "string",
                        "description": "Restrict date-filtered searches to one issuing body. Leave as All to include every body. Only applies when a date range is set.",
                        "default": "all"
                    },
                    "withContent": {
                        "title": "Fetch Full Content",
                        "type": "boolean",
                        "description": "When enabled, the actor fetches the full text content of each gazette entry (one extra request per entry) and adds it to the output.",
                        "default": false
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
