Tlaloc DOF API

Search over the **Diario Oficial de la Federación** — the full corpus, updated daily. Search publications by meaning or keywords, browse the entities they mention (organizations, companies, programs…), and fetch full texts and issue TOCs. Typical flow: `/v1/dof/search` (or `/v1/dof/entities` → `/v1/dof/entities/units`) → `/v1/dof/units/{unit_id}`.

GitHub OpenAPI

Operations 6

GET /v1/dof/search Search the DOF #
GET /v1/dof/search/deep DOF subsection search #
GET /v1/dof/entities DOF entity autocomplete #
GET /v1/dof/entities/units Units mentioning a DOF entity #
GET /v1/dof/units/{unit_id} DOF unit content + highlights #
GET /v1/dof/ejemplares/{ejemplar_id} DOF issue table of contents #

Specifications

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/tlaloc-sh:tlaloc-sh-dof-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

tlaloc-sh-dof-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Mexico DOF API
  description: 'Mexican data services — ZIP codes, phone numbers, CURP/RFC validation, Banxico CEP payment proofs, CFDI (status/query/issue/cancel), and search over the Diario Oficial de la Federación (DOF).


    Authenticate every `/v1` call with `Authorization: Bearer `. Usage is billed per operation, only on success — see the pricing page for rates.'
  version: 1.0.0
servers:
- url: /mx
tags:
- name: DOF
  description: 'Search over the **Diario Oficial de la Federación** — the full corpus, updated daily. Search publications by meaning or keywords, browse the entities they mention (organizations, companies, programs…), and fetch full texts and issue TOCs. Typical flow: `/v1/dof/search` (or `/v1/dof/entities` → `/v1/dof/entities/units`) → `/v1/dof/units/{unit_id}`.'
paths:
  /v1/dof/search:
    get:
      tags:
      - DOF
      summary: Search the DOF
      description: 'Search every publication in the DOF by meaning or exact keywords, with

        optional date/type/dependency filters. Results carry the unit id, issue

        (*ejemplar*) date and matching context; fetch the full text with

        `/v1/dof/units/{unit_id}`.'
      operationId: dof_search_v1_dof_search_get
      security:
      - HTTPBearer: []
      parameters:
      - name: q
        in: query
        required: true
        schema:
          type: string
          minLength: 2
          description: Natural-language or keyword query.
          title: Q
        description: Natural-language or keyword query.
      - name: top_k
        in: query
        required: false
        schema:
          type: integer
          maximum: 100
          minimum: 1
          description: Number of results.
          default: 10
          title: Top K
        description: Number of results.
      - name: fecha_from
        in: query
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          description: Only units published on/after this date (`YYYY-MM-DD`).
          title: Fecha From
        description: Only units published on/after this date (`YYYY-MM-DD`).
      - name: fecha_to
        in: query
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          description: Only units published on/before this date (`YYYY-MM-DD`).
          title: Fecha To
        description: Only units published on/before this date (`YYYY-MM-DD`).
      - name: type
        in: query
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          description: Filter by unit type as indexed by DOF (e.g. `decreto`, `acuerdo`, `aviso`).
          title: Type
        description: Filter by unit type as indexed by DOF (e.g. `decreto`, `acuerdo`, `aviso`).
      - name: dep
        in: query
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          description: Text match on the issuing dependency (e.g. `"Secretaría de Gobernación"`).
          title: Dep
        description: Text match on the issuing dependency (e.g. `"Secretaría de Gobernación"`).
      - name: lexical
        in: query
        required: false
        schema:
          type: string
          pattern: ^(auto|on|off)$
          description: 'Exact-keyword matching: `auto` (default) combines it with meaning-based ranking when it helps, `on` forces it, `off` ranks by meaning only.'
          default: auto
          title: Lexical
        description: 'Exact-keyword matching: `auto` (default) combines it with meaning-based ranking when it helps, `on` forces it, `off` ranks by meaning only.'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                title: Response Dof Search V1 Dof Search Get
        '401':
          description: Missing or invalid API key
        '402':
          description: Insufficient balance
        '502':
          description: DOF service unreachable or upstream 5xx
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /v1/dof/search/deep:
    get:
      tags:
      - DOF
      summary: DOF subsection search
      description: 'Search *within* units at subsection granularity — finds the specific

        passage (article, clause, annex) that matches instead of the whole

        publication. Slower and deeper than `/v1/dof/search`; use it when the plain

        search surfaces the right document but not the right place in it.'
      operationId: dof_search_deep_v1_dof_search_deep_get
      security:
      - HTTPBearer: []
      parameters:
      - name: q
        in: query
        required: true
        schema:
          type: string
          minLength: 2
          description: Natural-language or keyword query.
          title: Q
        description: Natural-language or keyword query.
      - name: top_k
        in: query
        required: false
        schema:
          type: integer
          maximum: 50
          minimum: 1
          description: Number of results.
          default: 10
          title: Top K
        description: Number of results.
      - name: fecha_from
        in: query
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          description: Only units published on/after this date (`YYYY-MM-DD`).
          title: Fecha From
        description: Only units published on/after this date (`YYYY-MM-DD`).
      - name: fecha_to
        in: query
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          description: Only units published on/before this date (`YYYY-MM-DD`).
          title: Fecha To
        description: Only units published on/before this date (`YYYY-MM-DD`).
      - name: type
        in: query
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          description: Filter by unit type as indexed by DOF (e.g. `decreto`, `acuerdo`, `aviso`).
          title: Type
        description: Filter by unit type as indexed by DOF (e.g. `decreto`, `acuerdo`, `aviso`).
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                title: Response Dof Search Deep V1 Dof Search Deep Get
        '401':
          description: Missing or invalid API key
        '402':
          description: Insufficient balance
        '502':
          description: DOF service unreachable or upstream 5xx
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /v1/dof/entities:
    get:
      tags:
      - DOF
      summary: DOF entity autocomplete
      description: 'Autocomplete over the entities mentioned across the whole DOF corpus

        (organizations, companies, programs, people…). Each suggestion carries its

        canonical/normalized name, surface variants, and mention counts — feed the

        `norm` value to `/v1/dof/entities/units` to list where it appears.'
      operationId: dof_entities_v1_dof_entities_get
      security:
      - HTTPBearer: []
      parameters:
      - name: q
        in: query
        required: true
        schema:
          type: string
          minLength: 2
          description: Entity name prefix or fragment.
          title: Q
        description: Entity name prefix or fragment.
      - name: limit
        in: query
        required: false
        schema:
          type: integer
          maximum: 20
          minimum: 1
          description: Number of suggestions.
          default: 10
          title: Limit
        description: Number of suggestions.
      - name: type
        in: query
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          description: Filter by entity type (e.g. `dependencia`, `organismo`, `empresa`, `persona`, `programa`, `documento`).
          title: Type
        description: Filter by entity type (e.g. `dependencia`, `organismo`, `empresa`, `persona`, `programa`, `documento`).
      - name: min_mentions
        in: query
        required: false
        schema:
          type: integer
          minimum: 1
          description: Hide entities mentioned fewer times than this across the corpus.
          default: 3
          title: Min Mentions
        description: Hide entities mentioned fewer times than this across the corpus.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                title: Response Dof Entities V1 Dof Entities Get
        '401':
          description: Missing or invalid API key
        '402':
          description: Insufficient balance
        '502':
          description: DOF service unreachable or upstream 5xx
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /v1/dof/entities/units:
    get:
      tags:
      - DOF
      summary: Units mentioning a DOF entity
      description: 'Every DOF unit that mentions a given entity, with mention counts and

        publication dates — the drill-down companion to `/v1/dof/entities`.'
      operationId: dof_entities_units_v1_dof_entities_units_get
      security:
      - HTTPBearer: []
      parameters:
      - name: norm
        in: query
        required: true
        schema:
          type: string
          minLength: 2
          description: Normalized entity name, as returned in `norm` by `/v1/dof/entities`.
          title: Norm
        description: Normalized entity name, as returned in `norm` by `/v1/dof/entities`.
      - name: top_k
        in: query
        required: false
        schema:
          type: integer
          maximum: 20
          minimum: 1
          description: Number of units.
          default: 20
          title: Top K
        description: Number of units.
      - name: order
        in: query
        required: false
        schema:
          type: string
          pattern: ^(mentions|recent)$
          description: '`mentions` = most-mentioning units first; `recent` = newest first.'
          default: mentions
          title: Order
        description: '`mentions` = most-mentioning units first; `recent` = newest first.'
      - name: fecha_from
        in: query
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          description: Only units published on/after this date (`YYYY-MM-DD`).
          title: Fecha From
        description: Only units published on/after this date (`YYYY-MM-DD`).
      - name: fecha_to
        in: query
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          description: Only units published on/before this date (`YYYY-MM-DD`).
          title: Fecha To
        description: Only units published on/before this date (`YYYY-MM-DD`).
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                title: Response Dof Entities Units V1 Dof Entities Units Get
        '401':
          description: Missing or invalid API key
        '402':
          description: Insufficient balance
        '502':
          description: DOF service unreachable or upstream 5xx
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /v1/dof/units/{unit_id}:
    get:
      tags:
      - DOF
      summary: DOF unit content + highlights
      description: 'Full text of one DOF unit (a single publication inside an issue), plus

        its detected entities and optional highlight offsets for rendering. Unit ids

        come from the search and entity endpoints.'
      operationId: dof_unit_v1_dof_units__unit_id__get
      security:
      - HTTPBearer: []
      parameters:
      - name: unit_id
        in: path
        required: true
        schema:
          type: string
          title: Unit Id
      - name: include_entities
        in: query
        required: false
        schema:
          type: boolean
          description: Attach the entities detected in the unit.
          default: true
          title: Include Entities
        description: Attach the entities detected in the unit.
      - name: max_entities
        in: query
        required: false
        schema:
          type: integer
          description: Cap on attached entities.
          default: 20
          title: Max Entities
        description: Cap on attached entities.
      - name: highlights
        in: query
        required: false
        schema:
          type: boolean
          description: Attach character-offset highlights for the detected entities.
          default: false
          title: Highlights
        description: Attach character-offset highlights for the detected entities.
      - name: max_highlights
        in: query
        required: false
        schema:
          type: integer
          maximum: 5000
          description: Cap on highlight spans.
          default: 500
          title: Max Highlights
        description: Cap on highlight spans.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                title: Response Dof Unit V1 Dof Units  Unit Id  Get
        '401':
          description: Missing or invalid API key
        '402':
          description: Insufficient balance
        '502':
          description: DOF service unreachable or upstream 5xx
        '404':
          description: Unknown unit id
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /v1/dof/ejemplares/{ejemplar_id}:
    get:
      tags:
      - DOF
      summary: DOF issue table of contents
      description: 'Table of contents of one DOF issue (*ejemplar*): every unit it contains

        with titles and ids, e.g. `01012025-MAT` for the 2025-01-01 morning

        edition.'
      operationId: dof_ejemplar_v1_dof_ejemplares__ejemplar_id__get
      security:
      - HTTPBearer: []
      parameters:
      - name: ejemplar_id
        in: path
        required: true
        schema:
          type: string
          title: Ejemplar Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                title: Response Dof Ejemplar V1 Dof Ejemplares  Ejemplar Id  Get
        '401':
          description: Missing or invalid API key
        '402':
          description: Insufficient balance
        '502':
          description: DOF service unreachable or upstream 5xx
        '404':
          description: Unknown ejemplar id
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
            - type: string
            - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
      - loc
      - msg
      - type
      title: ValidationError
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer