The Diario Oficial de la Federación (DOF) is the official source where Mexican laws, decrees, agreements, NOMs and government notices are published. It is indispensable for compliance, legal teams and fintechs — but checking it by hand (or downloading and processing its PDFs) does not scale. This guide shows how to search the DOF by API: by meaning, not just exact words, with entity detection and full text, from 2002 to present.
The problem with the traditional ways of consulting the DOF
- The official search and the open data ship PDFs and raw dumps: useful, but you have to download, extract text and structure every issue.
- Exact-word search misses nuance: "home office obligations" won't find "teletrabajo" even though they mean the same thing.
- There is no ready-made entity layer (which NOM, which agency, which decree) to filter or join on.
The alternative: semantic + lexical search by API
Tlaloc's DOF API combines two engines:
- Semantic (embeddings): finds by meaning — "teletrabajo" retrieves home-office and remote-work results too.
- Lexical (BM25): for exact identifiers (a NOM, an official letter number) that admit no synonyms.
Both are fused (RRF) to give you the best of both worlds. On top, every publication carries detected entities (agencies, standards, people) and you can fetch the full text with offsets.
Your first search in 3 steps
1. Create your account
Generate a tlmx_ key in the console (prepaid via SPEI, no card).
2. Search
curl "https://api.tlaloc.sh/mx/v1/dof/search?q=teletrabajo&top_k=5" \
-H "Authorization: Bearer tlmx_..."
The same from Python:
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"])
3. Read the document you care about
curl "https://api.tlaloc.sh/mx/v1/dof/units/{id}" \
-H "Authorization: Bearer tlmx_..."
Search by entity (NOM, agency, decree)
# 1. autocomplete the entity
curl "https://api.tlaloc.sh/mx/v1/dof/entities?q=NOM-035" \
-H "Authorization: Bearer tlmx_..."
# 2. where is it mentioned? (use the `norm` field from the previous response)
curl "https://api.tlaloc.sh/mx/v1/dof/entities/units?norm=NOM-035-STPS-2018" \
-H "Authorization: Bearer tlmx_..."
Real use cases
- Regulatory monitoring for compliance/fintech: automatic alerts by topic or agency.
- AI-assisted legal research: connect Tlaloc's MCP server to Claude/ChatGPT and ask in natural language. 6 DOF tools are live at
/mx/mcp(buscar_dof,buscar_entidades_dof,obtener_documento_dof…). - Due diligence: every publication that mentions a company or standard.
Pricing (transparent, per request)
Search and entities $0.05, document $0.10, document with NER annotations $1.00, issue table of contents $0.10 (1 u = $1 MXN, VAT included). You only pay for successful responses. Details on the pricing page.
Start today
Explore the DOF service page and the OpenAPI documentation. Create your account and run your first search in minutes.