Diario Oficial de la Federación API
Search the DOF the way a human would — by meaning, not just exact words. Semantic + lexical search over ~160,000 publications (2002 to present), with entity detection (agencies, NOMs, decrees) and full text. All by API.
An API key is required to use this API. Official source: Diario Oficial de la Federación.
Create your accountFeatures
✓ Semantic + lexical search
BGE-M3 embeddings + BM25, fused via RRF: finds by meaning, and by exact match for identifiers (NOMs, official letters).
✓ Subsection search
search/deep groups hits by article/annex within each publication, not just at document level.
✓ Entities (NER)
~6.6M detected entities (agencies, standards, people, places) with autocomplete and "where is this entity mentioned?".
✓ 2002–present coverage
~160K document units, updated daily (the previous day's issue is ingested automatically).
Endpoints
GET https://api.tlaloc.sh/mx/v1/dof/search?q={query}
The 6 endpoints
Public prefix https://api.tlaloc.sh/mx/v1/dof:
| Method | Endpoint | What it does | Price |
|---|---|---|---|
| GET | /search |
Semantic + lexical search over publications | 0.05 u |
| GET | /search/deep |
Subsection-level search (article/annex) grouped by publication | 0.05 u |
| GET | /entities |
Entity autocomplete (prefix) | 0.05 u |
| GET | /entities/units |
Publications mentioning an entity (alias-expanded) | 0.05 u |
| GET | /units/{id} |
Full text + detected entities (with ?highlights=true → + NER offset highlights, 1.00 u) |
0.10 u |
| GET | /ejemplares/{id} |
Table of contents of a full issue | 0.10 u |
Request example (curl)
curl "https://api.tlaloc.sh/mx/v1/dof/search?q=teletrabajo&top_k=5" \
-H "Authorization: Bearer tlmx_..."
Python example
import requests
r = requests.get(
"https://api.tlaloc.sh/mx/v1/dof/search",
params={"q": "obligaciones de teletrabajo", "top_k": 5},
headers={"Authorization": "Bearer tlmx_..."},
)
for hit in r.json()["results"]:
print(hit["fecha"], hit["title"])
JavaScript example
const res = await fetch(
"https://api.tlaloc.sh/mx/v1/dof/search?q=teletrabajo&top_k=5",
{ headers: { Authorization: "Bearer tlmx_..." } }
);
const { results } = await res.json();
Typical flow: /search (or /entities → /entities/units) → /units/{id} to read the full text.
Use Cases
Regulatory monitoring (compliance/fintech)
Watch the DOF by topic, agency or NOM automatically.
AI-assisted legal research
Connect an assistant (via Tlaloc's MCP) to ask, in natural language, what was published and where. 6 DOF tools live at /mx/mcp.
Regtech / legaltech
Build alerts, dashboards and workflows over official publications without hand-scraping PDFs.
Due diligence
Find every publication mentioning a company, agency or standard.
Frequently Asked Questions
What is Tlaloc's DOF API?
Search over Mexico's official gazette (Diario Oficial de la Federación): semantic (by meaning) + lexical (exact word/identifier), with entity detection and full text, 2002 to present, via your tlmx_ API key.
How is it different from the DOF open data?
The DOF ships raw PDFs and open-data dumps; Tlaloc adds ready-to-consume semantic search, entities (NER) and subsection structure by API — no downloading or processing PDFs yourself.
Does it cover the whole DOF?
~160,000 document units from 2002 to present, updated daily (the previous day's issue is ingested automatically).
How much does it cost?
Search & entities 0.05 u, document 0.10 u, document with NER annotations 1.00 u, issue TOC 0.10 u (1 u = $1 MXN, VAT included). Billed only on success.
How do I authenticate?
With an Authorization: Bearer tlmx_... token created in the console. Prepaid via SPEI, no card, no subscription.
Can I use it from an AI assistant?
Yes — the ideal case: connect Tlaloc's MCP server to Claude or ChatGPT and search the DOF in natural language. 6 DOF tools are live at https://api.tlaloc.sh/mx/mcp (buscar_dof, buscar_entidades_dof, obtener_documento_dof, and more).