OpenMercantil Sources API

External sources and dataset freshness

OpenAPI Specification

openmercantil-sources-api-openapi.yml Raw ↑
openapi: 3.0.3
info:
  title: OpenMercantil Public Billing Sources API
  version: 1.4.0
  description: 'Public JSON API for Spanish company information derived from BORME and other

    public sources. OpenMercantil is independent and informational; it is not

    the BOE, BORME or Registro Mercantil and does not replace official

    certificates or registry extracts. The API is free and public, requires no

    API key, and is rate-limited per IP. Versions v1.0 through v1.4 are

    available and documented at https://openmercantil.es/api/documentacion.

    '
  termsOfService: https://openmercantil.es/terminos-de-uso
  contact:
    name: OpenMercantil
    url: https://openmercantil.es/soporte
    email: social@openmercantil.es
  license:
    name: CC BY 4.0 For Derived Public-Data Outputs
    url: https://creativecommons.org/licenses/by/4.0/
servers:
- url: https://openmercantil.es
  description: Production
tags:
- name: Sources
  description: External sources and dataset freshness
paths:
  /api/v1/company/{slug}/grants:
    get:
      tags:
      - Sources
      summary: List Company Grants From BDNS
      operationId: getCompanyGrants
      description: Return public grants associated with the company from the BDNS dataset (v1.2).
      parameters:
      - name: slug
        in: path
        required: true
        schema:
          type: string
          example: inditex-sa-a15075062
      responses:
        '200':
          description: Grants list
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
  /api/v1/company/{slug}/sanctions:
    get:
      tags:
      - Sources
      summary: List Company Sanctions
      operationId: getCompanySanctions
      description: Return sanctions hits associated with the company from OpenSanctions and competition authorities (v1.2).
      parameters:
      - name: slug
        in: path
        required: true
        schema:
          type: string
          example: inditex-sa-a15075062
      responses:
        '200':
          description: Sanctions list
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
  /api/v1/company/{slug}/cnmv:
    get:
      tags:
      - Sources
      summary: Get CNMV Records For Company
      operationId: getCompanyCnmv
      description: Return CNMV (Spanish securities regulator) records for the company (v1.2).
      parameters:
      - name: slug
        in: path
        required: true
        schema:
          type: string
          example: inditex-sa-a15075062
      responses:
        '200':
          description: CNMV records
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
  /api/v1/sources/status:
    get:
      tags:
      - Sources
      summary: Get External Sources Status
      operationId: getSourcesStatus
      description: Return freshness, last-ingested timestamps, and status for each integrated external public-data source (v1.2).
      responses:
        '200':
          description: Sources status
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SourcesStatus'
        '429':
          $ref: '#/components/responses/TooManyRequests'
components:
  schemas:
    SourcesStatus:
      type: object
      properties:
        sources:
          type: array
          items:
            type: object
            properties:
              name:
                type: string
              last_ingested:
                type: string
                nullable: true
              status:
                type: string
            additionalProperties: true
      additionalProperties: true
    ErrorResponse:
      type: object
      properties:
        error:
          type: string
        message:
          type: string
      additionalProperties: true
  responses:
    TooManyRequests:
      description: Rate limit exceeded
      headers:
        Retry-After:
          description: Seconds to wait before retrying.
          schema:
            type: integer
        X-RateLimit-Limit:
          description: Maximum requests per window (60 per minute by IP on the public anonymous tier).
          schema:
            type: integer
        X-RateLimit-Remaining:
          description: Remaining requests in the current window.
          schema:
            type: integer
        X-RateLimit-Reset:
          description: Unix timestamp when the rate-limit counter resets.
          schema:
            type: integer
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    NotFound:
      description: Resource not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  securitySchemes:
    sessionCookie:
      type: apiKey
      in: cookie
      name: session
      description: Session cookie issued after web sign-in, required only for billing endpoints.