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

> Pull structured data off any public web page. You supply a JSON Schema describing the object you want and the fields are located on the page and returned under `result`, already typed.



## OpenAPI

````yaml /api-reference/openapi.json post /global/extract/json/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/json/v1:
    post:
      tags:
        - Global
        - Croma
      summary: Extract JSON
      description: >-
        Pull structured data off any public web page. You supply a JSON Schema
        describing the object you want and the fields are located on the page
        and returned under `result`, already typed.
      operationId: extract_json
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - url
                - json_schema
              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.
                json_schema:
                  type: object
                  description: >-
                    JSON Schema for the object to return. Field names and
                    nesting are yours; describe each field so it can be located
                    on the 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.
              additionalProperties: false
            example:
              url: >-
                https://www.funcionpublica.gov.co/eva/gestornormativo/norma.php?i=304
              json_schema:
                type: object
                required:
                  - title
                properties:
                  title:
                    type: string
                    description: Nombre de la norma.
                  issued_on:
                    type: string
                    description: Fecha de expedición.
      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/StructuredDataResponse'
        '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/global/extract
components:
  schemas:
    StructuredDataResponse:
      type: object
      required:
        - data
      properties:
        data:
          type: object
          required:
            - url
            - result
          properties:
            url:
              type: string
              format: uri
              description: The page that was read, after any redirects.
            result:
              type: object
              additionalProperties: true
              description: The object described by the `json_schema` you sent.
    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.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: 'Use Authorization: Bearer YOUR_API_KEY'

````