> ## 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.

# Extract Markdown

> Turn any public web page into clean Markdown. `scope` keeps either the article body or the whole page, and `include_metadata` adds the page's title, author and dates. Handles pages that render themselves in the browser at `effort: max`.



## OpenAPI

````yaml /api-reference/openapi.json post /global/extract/markdown/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:
  /global/extract/markdown/v1:
    post:
      tags:
        - Global
        - Croma
      summary: Extract Markdown
      description: >-
        Turn any public web page into clean Markdown. `scope` keeps either the
        article body or the whole page, and `include_metadata` adds the page's
        title, author and dates. Handles pages that render themselves in the
        browser at `effort: max`.
      operationId: extract_markdown
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - url
              properties:
                url:
                  type: string
                  format: uri
                  maxLength: 2000
                  description: >-
                    Public http or https URL of the page to read. Loopback and
                    private addresses are not accepted.
                scope:
                  type: string
                  enum:
                    - main
                    - full
                  default: main
                  description: >-
                    `main` keeps the article body and drops navigation and
                    boilerplate; `full` keeps the whole page.
                effort:
                  type: string
                  enum:
                    - min
                    - standard
                    - max
                  default: standard
                  description: >-
                    Effort to spend on the page: `min` is fastest, `standard` is
                    the balanced default, `max` handles pages that render
                    themselves in the browser.
                country:
                  type: string
                  pattern: ^([A-Za-z]{2})?$
                  default: ''
                  description: >-
                    Optional ISO 3166-1 alpha-2 country code (e.g. `CO`) for
                    pages that serve different content by country. Omit for the
                    default route.
                include_metadata:
                  type: boolean
                  default: false
                  description: >-
                    Include the page's title, author, dates and other metadata
                    in the response.
              additionalProperties: false
            example:
              url: >-
                https://www.funcionpublica.gov.co/eva/gestornormativo/norma.php?i=304
      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/ExtractMarkdownResponse'
        '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'
        '404':
          description: Resource not found in upstream source
          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/global/extract
components:
  schemas:
    ExtractMarkdownResponse:
      type: object
      required:
        - data
      properties:
        data:
          type: object
          required:
            - url
            - markdown
            - metadata
          properties:
            url:
              type: string
              format: uri
              description: The page that was read, after any redirects.
            markdown:
              type: string
            metadata:
              oneOf:
                - $ref: '#/components/schemas/PageMetadata'
                - type: 'null'
              description: Null unless `include_metadata` was true.
    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.
    PageMetadata:
      type: object
      required:
        - title
        - description
        - author
        - site_name
        - published_at
        - modified_at
        - image
        - keywords
        - page_count
      properties:
        title:
          type:
            - string
            - 'null'
        description:
          type:
            - string
            - 'null'
        author:
          type:
            - string
            - 'null'
        site_name:
          type:
            - string
            - 'null'
        published_at:
          type:
            - string
            - 'null'
        modified_at:
          type:
            - string
            - 'null'
        image:
          type:
            - string
            - 'null'
          format: uri
        keywords:
          type: array
          items:
            type: string
        page_count:
          type:
            - integer
            - 'null'
          description: Page count for PDFs; null for HTML pages.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: 'Use Authorization: Bearer YOUR_API_KEY'

````