> ## Documentation Index
> Fetch the complete documentation index at: https://docs.usecroma.com/llms.txt
> Use this file to discover all available pages before exploring further.

# DOF Publication

> Retrieve one publication from Mexico's official federal gazette (DOF) by id, including its plain text when the publication is machine-readable. Publications range from a few hundred characters to entire decrees, so the text is returned in character ranges: `content.total_length` is the full size, and when `content.has_more` is true request the next range with `offset: content.next_offset`. Scanned publications return `is_image_only: true` with `content: null`, metadata, and the official page link.



## OpenAPI

````yaml /api-reference/openapi.json post /mx/dof/publication/v1
openapi: 3.1.0
info:
  title: Croma Marketplace API
  version: 1.0.0
  description: >-
    Government-data APIs for Colombia, Peru, Mexico, and global web search.
    Croma normalizes public-sector data into structured JSON for product teams
    and AI agents.
servers:
  - url: https://api.croma.run
security: []
paths:
  /mx/dof/publication/v1:
    post:
      tags:
        - Mexico
        - DOF
      summary: DOF Publication
      description: >-
        Retrieve one publication from Mexico's official federal gazette (DOF) by
        id, including its plain text when the publication is machine-readable.
        Publications range from a few hundred characters to entire decrees, so
        the text is returned in character ranges: `content.total_length` is the
        full size, and when `content.has_more` is true request the next range
        with `offset: content.next_offset`. Scanned publications return
        `is_image_only: true` with `content: null`, metadata, and the official
        page link.
      operationId: dof_publication
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - publication_id
              properties:
                publication_id:
                  type: string
                  pattern: ^\d{1,12}$
                  description: >-
                    Publication id (`id` from publications-by-date or search
                    results).
                offset:
                  type: integer
                  minimum: 0
                  maximum: 10000000
                  default: 0
                  description: >-
                    First character of the range to return. Pass the previous
                    response's `next_offset` to continue reading.
                limit:
                  type: integer
                  minimum: 1000
                  maximum: 1000000
                  default: 200000
                  description: Maximum characters to return (1000-1000000).
              additionalProperties: false
            example:
              publication_id: '5778302'
      responses:
        '200':
          description: Successful response
          headers:
            X-Request-Id:
              description: >-
                Unique id for the request (req_…). Include it in support
                reports.
              schema:
                type: string
            X-RateLimit-Limit:
              description: Requests allowed in the current window.
              schema:
                type: integer
            X-RateLimit-Remaining:
              description: Requests left before you are throttled.
              schema:
                type: integer
            X-RateLimit-Reset:
              description: ISO 8601 timestamp when the window resets.
              schema:
                type: string
                format: date-time
            X-Cache:
              description: HIT or MISS. Cached hits still count against your quota.
              schema:
                type: string
                enum:
                  - HIT
                  - MISS
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DofPublicationResponse'
        '400':
          description: Invalid request body
          headers:
            X-Request-Id:
              description: >-
                Unique id for the request (req_…). Include it in support
                reports.
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
        '401':
          description: Missing or invalid API key
          headers:
            X-Request-Id:
              description: >-
                Unique id for the request (req_…). Include it in support
                reports.
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
        '429':
          description: Rate limit exceeded
          headers:
            X-Request-Id:
              description: >-
                Unique id for the request (req_…). Include it in support
                reports.
              schema:
                type: string
            X-RateLimit-Limit:
              description: Requests allowed in the current window.
              schema:
                type: integer
            X-RateLimit-Remaining:
              description: Requests left before you are throttled.
              schema:
                type: integer
            X-RateLimit-Reset:
              description: ISO 8601 timestamp when the window resets.
              schema:
                type: string
                format: date-time
            Retry-After:
              description: Seconds to wait before retrying.
              schema:
                type: integer
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
        '500':
          description: Internal error
          headers:
            X-Request-Id:
              description: >-
                Unique id for the request (req_…). Include it in support
                reports.
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
        '502':
          description: Upstream source returned an error
          headers:
            X-Request-Id:
              description: >-
                Unique id for the request (req_…). Include it in support
                reports.
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
      security:
        - bearerAuth: []
      externalDocs:
        description: Interactive documentation and examples
        url: https://docs.usecroma.com/guides/mexico/dof
components:
  schemas:
    DofPublicationResponse:
      type: object
      required:
        - data
      properties:
        data:
          type: object
          required:
            - found
            - publication_id
            - publication
          properties:
            found:
              type: boolean
              description: >-
                Whether a publication matched the id. When false, `publication`
                is null.
            publication_id:
              type: string
            publication:
              oneOf:
                - $ref: '#/components/schemas/DofPublicationDetail'
                - type: 'null'
    ApiError:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - type
            - code
            - message
          properties:
            type:
              type: string
              description: >-
                Broad category: invalid_request_error, authentication_error,
                not_found_error, rate_limit_error, upstream_error, api_error.
            code:
              type: string
              description: Machine-readable specific code.
            message:
              type: string
              description: Human-readable explanation, safe to surface in UI.
            param:
              type: string
              description: Field that triggered the error. Present on validation errors.
            details:
              type: object
              description: Free-form structured detail.
    DofPublicationDetail:
      type: object
      required:
        - id
        - title
        - date
        - edition
        - section
        - page
        - page_end
        - branch
        - agency
        - sub_agency
        - content
        - is_image_only
        - official_url
      properties:
        id:
          type: string
        title:
          type:
            - string
            - 'null'
        date:
          type:
            - string
            - 'null'
          format: date
        edition:
          type:
            - string
            - 'null'
          enum:
            - morning
            - evening
            - extraordinary
            - null
        section:
          type:
            - string
            - 'null'
        page:
          type:
            - integer
            - 'null'
        page_end:
          type:
            - integer
            - 'null'
        branch:
          type:
            - string
            - 'null'
        agency:
          type:
            - string
            - 'null'
        sub_agency:
          type:
            - string
            - 'null'
        content:
          oneOf:
            - $ref: '#/components/schemas/DofPublicationContent'
            - type: 'null'
          description: >-
            Requested range of the publication text; null for image-only
            (scanned) publications.
        is_image_only:
          type: boolean
        official_url:
          type: string
          format: uri
          description: Official public page for this publication.
    DofPublicationContent:
      type: object
      required:
        - text
        - offset
        - total_length
        - has_more
        - next_offset
      properties:
        text:
          type: string
          description: Requested range of the publication's plain text.
        offset:
          type: integer
          description: First character of this range.
        total_length:
          type: integer
          description: Full length of the publication text, in characters.
        has_more:
          type: boolean
          description: True when text remains beyond this range.
        next_offset:
          type:
            - integer
            - 'null'
          description: '`offset` for the next range; null when exhausted.'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: 'Use Authorization: Bearer YOUR_API_KEY'

````