{
 "openapi": "3.1.0",
 "info": {
  "title": "Divr API",
  "version": "1",
  "summary": "La API de la bolsa española: dividendos, calendario, resultados, cuentas anuales, ratios y hechos relevantes de las cotizadas en BME, desde la CNMV.",
  "description": "Datos de las empresas cotizadas en BME leídos de los registros oficiales de la CNMV y de BME. Cada cifra dice de qué documento sale, con qué fórmula se calculó o por qué falta. Plan gratuito: 100 peticiones al día, clave al momento en https://api.divr.es/docs#clave. Las cifras de los ejemplos son inventadas; sólo las respuestas reales son datos.",
  "contact": {
   "name": "Divr",
   "url": "https://api.divr.es"
  }
 },
 "externalDocs": {
  "description": "Documentación, explorador y clave gratis",
  "url": "https://api.divr.es/docs"
 },
 "servers": [
  {
   "url": "https://api.divr.es"
  }
 ],
 "security": [
  {
   "bearer": []
  }
 ],
 "tags": [
  {
   "name": "Empresas"
  },
  {
   "name": "Dividendos"
  },
  {
   "name": "Hechos relevantes"
  },
  {
   "name": "Otros mercados"
  },
  {
   "name": "Sistema"
  }
 ],
 "paths": {
  "/v1/issuers": {
   "get": {
    "operationId": "listIssuers",
    "summary": "Catálogo de emisores",
    "description": "Todos los valores del mercado continuo, también los que no se sirven, con el motivo. Es el punto de partida: de aquí salen los id del resto.",
    "tags": [
     "Empresas"
    ],
    "parameters": [],
    "responses": {
     "200": {
      "description": "OK",
      "headers": {
       "X-RateLimit-Limit": {
        "$ref": "#/components/headers/Limit"
       },
       "X-RateLimit-Remaining": {
        "$ref": "#/components/headers/Remaining"
       },
       "X-RateLimit-Reset": {
        "$ref": "#/components/headers/Reset"
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Catalog"
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "429": {
      "$ref": "#/components/responses/RateLimited"
     },
     "500": {
      "$ref": "#/components/responses/Internal"
     }
    }
   }
  },
  "/v1/issuers/{id}/annual": {
   "get": {
    "operationId": "getAnnual",
    "summary": "Cuentas anuales de un emisor",
    "description": "Un objeto por ejercicio, desde el XBRL que el emisor deposita en la CNMV (desde 2016). Cada cifra dice si es reportada, derivada o un hueco con motivo.",
    "tags": [
     "Empresas"
    ],
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "description": "Ticker con sufijo (TEF.MC), ISIN o NIF del emisor. Salen de GET /v1/issuers.",
      "schema": {
       "type": "string"
      },
      "example": "TEF.MC"
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "headers": {
       "X-RateLimit-Limit": {
        "$ref": "#/components/headers/Limit"
       },
       "X-RateLimit-Remaining": {
        "$ref": "#/components/headers/Remaining"
       },
       "X-RateLimit-Reset": {
        "$ref": "#/components/headers/Reset"
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Annual"
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "429": {
      "$ref": "#/components/responses/RateLimited"
     },
     "500": {
      "$ref": "#/components/responses/Internal"
     }
    }
   }
  },
  "/v1/issuers/{id}/results": {
   "get": {
    "operationId": "getResults",
    "summary": "Resultados por periodo",
    "description": "Lo que la empresa presentó en cada periodo: H1, H2 (ejercicio menos H1), FY y, si hay, Q1–Q4.",
    "tags": [
     "Empresas"
    ],
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "description": "Ticker con sufijo (TEF.MC), ISIN o NIF del emisor. Salen de GET /v1/issuers.",
      "schema": {
       "type": "string"
      },
      "example": "TEF.MC"
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "headers": {
       "X-RateLimit-Limit": {
        "$ref": "#/components/headers/Limit"
       },
       "X-RateLimit-Remaining": {
        "$ref": "#/components/headers/Remaining"
       },
       "X-RateLimit-Reset": {
        "$ref": "#/components/headers/Reset"
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Results"
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "429": {
      "$ref": "#/components/responses/RateLimited"
     },
     "500": {
      "$ref": "#/components/responses/Internal"
     }
    }
   }
  },
  "/v1/issuers/{id}/ratios": {
   "get": {
    "operationId": "getRatios",
    "summary": "Ratios por ejercicio",
    "description": "Márgenes, ROE, ROA, deuda neta, deuda neta/EBITDA, payout y crecimiento, calculados de /annual con su fórmula y entradas.",
    "tags": [
     "Empresas"
    ],
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "description": "Ticker con sufijo (TEF.MC), ISIN o NIF del emisor. Salen de GET /v1/issuers.",
      "schema": {
       "type": "string"
      },
      "example": "TEF.MC"
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "headers": {
       "X-RateLimit-Limit": {
        "$ref": "#/components/headers/Limit"
       },
       "X-RateLimit-Remaining": {
        "$ref": "#/components/headers/Remaining"
       },
       "X-RateLimit-Reset": {
        "$ref": "#/components/headers/Reset"
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Ratios"
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "429": {
      "$ref": "#/components/responses/RateLimited"
     },
     "500": {
      "$ref": "#/components/responses/Internal"
     }
    }
   }
  },
  "/v1/issuers/{id}/dividends": {
   "get": {
    "operationId": "getIssuerDividends",
    "summary": "Dividendos de un emisor",
    "description": "Tres bloques que no se mezclan: events (anunciado a la CNMV, con la frase de la que sale cada fecha), market (calendario de BME) y estimates (ventana estimada a partir de años anteriores).",
    "tags": [
     "Dividendos"
    ],
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "description": "Ticker con sufijo (TEF.MC), ISIN o NIF del emisor. Salen de GET /v1/issuers.",
      "schema": {
       "type": "string"
      },
      "example": "TEF.MC"
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "headers": {
       "X-RateLimit-Limit": {
        "$ref": "#/components/headers/Limit"
       },
       "X-RateLimit-Remaining": {
        "$ref": "#/components/headers/Remaining"
       },
       "X-RateLimit-Reset": {
        "$ref": "#/components/headers/Reset"
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Dividends"
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "429": {
      "$ref": "#/components/responses/RateLimited"
     },
     "500": {
      "$ref": "#/components/responses/Internal"
     }
    }
   }
  },
  "/v1/events": {
   "get": {
    "operationId": "getDividendCalendar",
    "summary": "Calendario de dividendos del mercado español",
    "description": "Qué se paga entre dos fechas en todos los emisores españoles, más ampliaciones liberadas (scrip) y fechas de presentación de resultados anunciadas.",
    "tags": [
     "Dividendos"
    ],
    "parameters": [
     {
      "name": "from",
      "in": "query",
      "required": false,
      "description": "Primer día. Por defecto, hoy.",
      "schema": {
       "type": "string",
       "format": "date"
      },
      "example": "2026-10-01"
     },
     {
      "name": "to",
      "in": "query",
      "required": false,
      "description": "Último día. Por defecto, hoy + 90. Ventana máxima: 400 días.",
      "schema": {
       "type": "string",
       "format": "date"
      },
      "example": "2026-12-31"
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "headers": {
       "X-RateLimit-Limit": {
        "$ref": "#/components/headers/Limit"
       },
       "X-RateLimit-Remaining": {
        "$ref": "#/components/headers/Remaining"
       },
       "X-RateLimit-Reset": {
        "$ref": "#/components/headers/Reset"
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Calendar"
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/BadRequest"
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "429": {
      "$ref": "#/components/responses/RateLimited"
     },
     "500": {
      "$ref": "#/components/responses/Internal"
     }
    }
   }
  },
  "/v1/filings": {
   "get": {
    "operationId": "listFilings",
    "summary": "Hechos relevantes del mercado",
    "description": "Cada comunicación de los registros de la CNMV (Otra Información Relevante e Información Privilegiada): dividendos, resultados, juntas, consejo, recompras. Por defecto, la última semana.",
    "tags": [
     "Hechos relevantes"
    ],
    "parameters": [
     {
      "name": "id",
      "in": "query",
      "required": false,
      "description": "Ticker, ISIN o NIF para filtrar a un emisor.",
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "from",
      "in": "query",
      "required": false,
      "description": "Primer día de publicación.",
      "schema": {
       "type": "string",
       "format": "date"
      }
     },
     {
      "name": "to",
      "in": "query",
      "required": false,
      "description": "Último día de publicación. Máximo 400 días.",
      "schema": {
       "type": "string",
       "format": "date"
      }
     },
     {
      "name": "topic",
      "in": "query",
      "required": false,
      "description": "Tema.",
      "schema": {
       "type": "string",
       "enum": [
        "dividendo",
        "resultados",
        "junta",
        "consejo",
        "recompra"
       ]
      }
     },
     {
      "name": "register",
      "in": "query",
      "required": false,
      "description": "Registro. Sin él, los dos.",
      "schema": {
       "type": "string",
       "enum": [
        "oir",
        "ip"
       ]
      }
     },
     {
      "name": "limit",
      "in": "query",
      "required": false,
      "description": "De 1 a 500. Por defecto 100, las más recientes primero.",
      "schema": {
       "type": "integer",
       "minimum": 1,
       "maximum": 500
      }
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "headers": {
       "X-RateLimit-Limit": {
        "$ref": "#/components/headers/Limit"
       },
       "X-RateLimit-Remaining": {
        "$ref": "#/components/headers/Remaining"
       },
       "X-RateLimit-Reset": {
        "$ref": "#/components/headers/Reset"
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Filings"
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/BadRequest"
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "429": {
      "$ref": "#/components/responses/RateLimited"
     },
     "500": {
      "$ref": "#/components/responses/Internal"
     }
    }
   }
  },
  "/v1/issuers/{id}/filings": {
   "get": {
    "operationId": "listIssuerFilings",
    "summary": "Hechos relevantes de un emisor",
    "description": "Lo mismo que /v1/filings para un emisor; por defecto, el último año.",
    "tags": [
     "Hechos relevantes"
    ],
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "description": "Ticker con sufijo (TEF.MC), ISIN o NIF del emisor. Salen de GET /v1/issuers.",
      "schema": {
       "type": "string"
      },
      "example": "TEF.MC"
     },
     {
      "name": "from",
      "in": "query",
      "required": false,
      "description": "Primer día.",
      "schema": {
       "type": "string",
       "format": "date"
      }
     },
     {
      "name": "to",
      "in": "query",
      "required": false,
      "description": "Último día.",
      "schema": {
       "type": "string",
       "format": "date"
      }
     },
     {
      "name": "topic",
      "in": "query",
      "required": false,
      "description": "Tema.",
      "schema": {
       "type": "string",
       "enum": [
        "dividendo",
        "resultados",
        "junta",
        "consejo",
        "recompra"
       ]
      }
     },
     {
      "name": "register",
      "in": "query",
      "required": false,
      "description": "Registro.",
      "schema": {
       "type": "string",
       "enum": [
        "oir",
        "ip"
       ]
      }
     },
     {
      "name": "limit",
      "in": "query",
      "required": false,
      "description": "De 1 a 500.",
      "schema": {
       "type": "integer",
       "minimum": 1,
       "maximum": 500
      }
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "headers": {
       "X-RateLimit-Limit": {
        "$ref": "#/components/headers/Limit"
       },
       "X-RateLimit-Remaining": {
        "$ref": "#/components/headers/Remaining"
       },
       "X-RateLimit-Reset": {
        "$ref": "#/components/headers/Reset"
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Filings"
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/BadRequest"
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "404": {
      "$ref": "#/components/responses/NotFound"
     },
     "429": {
      "$ref": "#/components/responses/RateLimited"
     },
     "500": {
      "$ref": "#/components/responses/Internal"
     }
    }
   }
  },
  "/v1/us/dividends": {
   "get": {
    "operationId": "getUSDividendCalendar",
    "summary": "Calendario de dividendos de EE. UU. (Nasdaq)",
    "description": "Por ex-date y, opcionalmente, por símbolo. Sólo el bloque market.",
    "tags": [
     "Otros mercados"
    ],
    "parameters": [
     {
      "name": "symbol",
      "in": "query",
      "required": false,
      "description": "Filtra a un valor.",
      "schema": {
       "type": "string"
      },
      "example": "KO"
     },
     {
      "name": "from",
      "in": "query",
      "required": false,
      "description": "Primer ex-date. Por defecto, hoy.",
      "schema": {
       "type": "string",
       "format": "date"
      }
     },
     {
      "name": "to",
      "in": "query",
      "required": false,
      "description": "Último ex-date. Por defecto, hoy + 45. Máximo 400 días.",
      "schema": {
       "type": "string",
       "format": "date"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "headers": {
       "X-RateLimit-Limit": {
        "$ref": "#/components/headers/Limit"
       },
       "X-RateLimit-Remaining": {
        "$ref": "#/components/headers/Remaining"
       },
       "X-RateLimit-Reset": {
        "$ref": "#/components/headers/Reset"
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/MarketDividends"
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/BadRequest"
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "429": {
      "$ref": "#/components/responses/RateLimited"
     },
     "500": {
      "$ref": "#/components/responses/Internal"
     }
    }
   }
  },
  "/v1/market/dividends": {
   "get": {
    "operationId": "getMarketDividends",
    "summary": "Dividendos de cualquier valor (NYSE, Londres…)",
    "description": "Yahoo bajo demanda y, para EE. UU., también Nasdaq, juntados por ex-date. Cada fila dice de qué fuente sale.",
    "tags": [
     "Otros mercados"
    ],
    "parameters": [
     {
      "name": "symbol",
      "in": "query",
      "required": true,
      "description": "Símbolo, con sufijo fuera de EE. UU.",
      "schema": {
       "type": "string"
      },
      "example": "DGE.L"
     },
     {
      "name": "from",
      "in": "query",
      "required": false,
      "description": "Por defecto, hace 30 días.",
      "schema": {
       "type": "string",
       "format": "date"
      }
     },
     {
      "name": "to",
      "in": "query",
      "required": false,
      "description": "Por defecto, dentro de un año. Máximo 400 días.",
      "schema": {
       "type": "string",
       "format": "date"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "headers": {
       "X-RateLimit-Limit": {
        "$ref": "#/components/headers/Limit"
       },
       "X-RateLimit-Remaining": {
        "$ref": "#/components/headers/Remaining"
       },
       "X-RateLimit-Reset": {
        "$ref": "#/components/headers/Reset"
       }
      },
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/MarketDividends"
        }
       }
      }
     },
     "400": {
      "$ref": "#/components/responses/BadRequest"
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "429": {
      "$ref": "#/components/responses/RateLimited"
     },
     "500": {
      "$ref": "#/components/responses/Internal"
     }
    }
   }
  },
  "/health": {
   "get": {
    "operationId": "health",
    "summary": "Salud del servicio",
    "tags": [
     "Sistema"
    ],
    "security": [],
    "description": "Sin clave. 200 si el servicio llega a su base de datos; 503 si no.",
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "string",
           "example": "ok"
          }
         }
        }
       }
      }
     },
     "503": {
      "description": "Base de datos no disponible"
     }
    }
   }
  }
 },
 "components": {
  "securitySchemes": {
   "bearer": {
    "type": "http",
    "scheme": "bearer",
    "description": "Authorization: Bearer <clave>. Nunca en la URL."
   }
  },
  "headers": {
   "Limit": {
    "description": "Peticiones al día del plan.",
    "schema": {
     "type": "integer"
    }
   },
   "Remaining": {
    "description": "Peticiones que quedan hoy.",
    "schema": {
     "type": "integer"
    }
   },
   "Reset": {
    "description": "Segundos Unix de la próxima medianoche UTC.",
    "schema": {
     "type": "integer"
    }
   }
  },
  "responses": {
   "BadRequest": {
    "description": "Parámetro que no se entiende (fechas, ventana de más de 400 días, falta symbol).",
    "content": {
     "application/json": {
      "schema": {
       "$ref": "#/components/schemas/Error"
      }
     }
    }
   },
   "Unauthorized": {
    "description": "Falta la clave o no vale.",
    "content": {
     "application/json": {
      "schema": {
       "$ref": "#/components/schemas/Error"
      }
     }
    }
   },
   "NotFound": {
    "description": "issuer_unknown, issuer_no_source (permanente), issuer_not_ingested (transitorio) o events_not_scanned.",
    "content": {
     "application/json": {
      "schema": {
       "$ref": "#/components/schemas/Error"
      }
     }
    }
   },
   "RateLimited": {
    "description": "Cupo del plan gratuito agotado; vuelve a las 00:00 UTC (Retry-After).",
    "content": {
     "application/json": {
      "schema": {
       "$ref": "#/components/schemas/Error"
      }
     }
    }
   },
   "Internal": {
    "description": "Falló. Nunca un 200 parcial; se puede reintentar.",
    "content": {
     "application/json": {
      "schema": {
       "$ref": "#/components/schemas/Error"
      }
     }
    }
   }
  },
  "schemas": {
   "Figure": {
    "type": "object",
    "description": "Una cifra nunca es un escalar: dice de dónde sale o por qué falta.",
    "properties": {
     "value": {
      "description": "El valor, o null si falta."
     },
     "origin": {
      "type": "string",
      "description": "reported (sale de un documento), derived (calculada) u otra fuente nombrada (p. ej. nasdaq_calendar)."
     },
     "doc": {
      "type": "integer",
      "description": "Documento del que sale, si es reportada."
     },
     "concept": {
      "type": "string",
      "description": "Concepto XBRL, si es reportada."
     },
     "formula": {
      "type": "string"
     },
     "inputs": {
      "type": "array",
      "items": {
       "type": "string"
      }
     },
     "quote": {
      "type": "string",
      "description": "La frase del anuncio de la que sale, en dividendos."
     },
     "unit": {
      "type": "string",
      "enum": [
       "fraction",
       "currency"
      ]
     },
     "reason": {
      "type": "string",
      "description": "Por qué falta: no_existe_en_taxonomia, no_reportado, no_aplica_al_emisor, error_de_parseo, denominador_cero, denominador_negativo, sin_ejercicio_anterior, cambio_de_perimetro…"
     }
    },
    "required": [
     "value"
    ],
    "additionalProperties": true
   },
   "Error": {
    "type": "object",
    "properties": {
     "error": {
      "type": "object",
      "properties": {
       "code": {
        "type": "string",
        "enum": [
         "issuer_unknown",
         "issuer_no_source",
         "issuer_not_ingested",
         "events_not_scanned",
         "bad_request",
         "unauthorized",
         "plan_not_allowed",
         "rate_limited",
         "not_found",
         "method_not_allowed",
         "not_implemented",
         "internal_error"
        ]
       },
       "message": {
        "type": "string"
       },
       "ticker": {
        "type": "string"
       }
      },
      "additionalProperties": true
     }
    },
    "additionalProperties": true
   },
   "Coverage": {
    "type": "object",
    "properties": {
     "from": {
      "type": "integer"
     },
     "to": {
      "type": "integer"
     },
     "missing": {
      "type": "array",
      "items": {
       "type": "integer"
      }
     }
    },
    "additionalProperties": true
   },
   "Issuer": {
    "type": "object",
    "properties": {
     "ticker": {
      "type": "string"
     },
     "isin": {
      "type": "string"
     },
     "nif": {
      "type": "string"
     },
     "lei": {
      "type": "string"
     },
     "name": {
      "type": "string"
     },
     "ingestion": {
      "type": "string",
      "enum": [
       "loaded",
       "not_ingested",
       "identity_unverified",
       "no_source"
      ]
     },
     "coverage": {
      "$ref": "#/components/schemas/Coverage"
     }
    },
    "additionalProperties": true
   },
   "Catalog": {
    "type": "object",
    "properties": {
     "generated_at": {
      "type": "string",
      "format": "date-time"
     },
     "issuers": {
      "type": "array",
      "items": {
       "$ref": "#/components/schemas/Issuer"
      }
     }
    },
    "additionalProperties": true
   },
   "Annual": {
    "type": "object",
    "properties": {
     "issuer": {
      "$ref": "#/components/schemas/Issuer"
     },
     "coverage": {
      "$ref": "#/components/schemas/Coverage"
     },
     "years": {
      "type": "array",
      "items": {
       "type": "object",
       "properties": {
        "year": {
         "type": "integer"
        },
        "perimeter": {
         "type": "string"
        },
        "taxonomy": {
         "type": "string"
        },
        "currency": {
         "type": "string"
        },
        "sources": {
         "type": "array",
         "items": {
          "type": "object",
          "additionalProperties": true
         }
        },
        "fields": {
         "type": "object",
         "additionalProperties": {
          "$ref": "#/components/schemas/Figure"
         }
        }
       },
       "additionalProperties": true
      }
     }
    },
    "additionalProperties": true
   },
   "Results": {
    "type": "object",
    "properties": {
     "issuer": {
      "$ref": "#/components/schemas/Issuer"
     },
     "years": {
      "type": "array",
      "items": {
       "type": "object",
       "properties": {
        "year": {
         "type": "integer"
        },
        "periods": {
         "type": "array",
         "items": {
          "type": "object",
          "properties": {
           "period": {
            "type": "string",
            "enum": [
             "H1",
             "H2",
             "FY",
             "Q1",
             "Q2",
             "Q3",
             "Q4"
            ]
           },
           "period_start": {
            "type": "string",
            "format": "date"
           },
           "period_end": {
            "type": "string",
            "format": "date"
           },
           "perimeter": {
            "type": "string"
           },
           "currency": {
            "type": "string"
           },
           "source": {
            "oneOf": [
             {
              "type": "object",
              "properties": {
               "url": {
                "type": "string"
               },
               "filed": {
                "type": "string"
               }
              },
              "additionalProperties": true
             },
             {
              "type": "null"
             }
            ]
           },
           "fields": {
            "type": "object",
            "additionalProperties": {
             "$ref": "#/components/schemas/Figure"
            }
           }
          },
          "additionalProperties": true
         }
        }
       },
       "additionalProperties": true
      }
     },
     "quarters": {
      "type": "object",
      "properties": {
       "available": {
        "type": "boolean"
       },
       "reason": {
        "type": "string"
       }
      },
      "additionalProperties": true
     }
    },
    "additionalProperties": true
   },
   "Ratios": {
    "type": "object",
    "properties": {
     "ratios_version": {
      "type": "string"
     },
     "years": {
      "type": "array",
      "items": {
       "type": "object",
       "properties": {
        "year": {
         "type": "integer"
        },
        "ratios": {
         "type": "object",
         "additionalProperties": {
          "$ref": "#/components/schemas/Figure"
         }
        }
       },
       "additionalProperties": true
      }
     }
    },
    "additionalProperties": true
   },
   "DividendEvent": {
    "type": "object",
    "properties": {
     "kind": {
      "type": "string"
     },
     "status": {
      "type": "string"
     },
     "amount_gross": {
      "$ref": "#/components/schemas/Figure"
     },
     "ex_date": {
      "$ref": "#/components/schemas/Figure"
     },
     "record_date": {
      "$ref": "#/components/schemas/Figure"
     },
     "payment_date": {
      "$ref": "#/components/schemas/Figure"
     },
     "confirmed_by_bme": {
      "type": "boolean"
     },
     "source": {
      "type": "object",
      "additionalProperties": true
     }
    },
    "additionalProperties": true
   },
   "Estimate": {
    "type": "object",
    "properties": {
     "payment_window": {
      "type": "object",
      "properties": {
       "from": {
        "type": "string",
        "format": "date"
       },
       "to": {
        "type": "string",
        "format": "date"
       },
       "expected": {
        "type": "string",
        "format": "date"
       }
      },
      "additionalProperties": true
     },
     "amount_gross": {
      "$ref": "#/components/schemas/Figure"
     },
     "basis_years": {
      "type": "array",
      "items": {
       "type": "integer"
      }
     },
     "dispersion_days": {
      "type": "integer"
     }
    },
    "additionalProperties": true
   },
   "Dividends": {
    "type": "object",
    "properties": {
     "coverage": {
      "type": "object",
      "properties": {
       "scanned_through": {
        "type": "string"
       },
       "stale": {
        "type": "boolean"
       }
      },
      "additionalProperties": true
     },
     "events": {
      "type": "array",
      "items": {
       "$ref": "#/components/schemas/DividendEvent"
      }
     },
     "market": {
      "type": "array",
      "items": {
       "type": "object",
       "additionalProperties": true
      }
     },
     "market_coverage": {
      "type": "object",
      "properties": {
       "served_through": {
        "type": "string"
       }
      },
      "additionalProperties": true
     },
     "estimates": {
      "type": "array",
      "items": {
       "$ref": "#/components/schemas/Estimate"
      }
     }
    },
    "additionalProperties": true
   },
   "Calendar": {
    "type": "object",
    "properties": {
     "events": {
      "type": "array",
      "items": {
       "$ref": "#/components/schemas/DividendEvent"
      }
     },
     "market": {
      "type": "array",
      "items": {
       "type": "object",
       "additionalProperties": true
      }
     },
     "estimates": {
      "type": "array",
      "items": {
       "$ref": "#/components/schemas/Estimate"
      }
     },
     "bonus_issues": {
      "type": "array",
      "items": {
       "type": "object",
       "properties": {
        "rights_from": {
         "type": "string",
         "format": "date"
        },
        "rights_to": {
         "type": "string",
         "format": "date"
        },
        "admission_date": {
         "type": "string",
         "format": "date"
        },
        "new_shares": {}
       },
       "additionalProperties": true
      }
     },
     "results_dates": {
      "type": "array",
      "items": {
       "type": "object",
       "properties": {
        "date": {
         "type": "string",
         "format": "date"
        },
        "fiscal_year": {
         "type": "integer"
        },
        "period": {
         "type": "string"
        },
        "quote": {
         "type": "string"
        },
        "source": {
         "type": "object",
         "additionalProperties": true
        }
       },
       "additionalProperties": true
      }
     }
    },
    "additionalProperties": true
   },
   "Filings": {
    "type": "object",
    "properties": {
     "filings": {
      "type": "array",
      "items": {
       "type": "object",
       "properties": {
        "register": {
         "type": "string",
         "enum": [
          "oir",
          "ip"
         ]
        },
        "registro": {
         "type": "string"
        },
        "published_at": {
         "type": "string",
         "format": "date-time"
        },
        "issuer": {
         "oneOf": [
          {
           "type": "object",
           "properties": {
            "nif": {
             "type": "string"
            },
            "name": {
             "type": "string"
            },
            "ticker": {
             "type": "string"
            }
           },
           "additionalProperties": true
          },
          {
           "type": "null"
          }
         ]
        },
        "entity": {
         "type": "string"
        },
        "title": {
         "type": "string"
        },
        "category": {
         "type": "string"
        },
        "topics": {
         "type": "array",
         "items": {
          "type": "string"
         }
        },
        "url": {
         "type": "string"
        }
       },
       "additionalProperties": true
      }
     },
     "coverage": {
      "type": "object",
      "properties": {
       "stored_from": {
        "type": "string"
       },
       "scanned_through": {
        "type": "string"
       },
       "stale": {
        "type": "boolean"
       }
      },
      "additionalProperties": true
     },
     "truncated": {
      "type": "boolean"
     }
    },
    "additionalProperties": true
   },
   "MarketDividends": {
    "type": "object",
    "properties": {
     "coverage": {
      "type": "object",
      "additionalProperties": true
     },
     "market": {
      "type": "array",
      "items": {
       "type": "object",
       "properties": {
        "symbol": {
         "type": "string"
        },
        "company": {
         "type": "string"
        },
        "amount": {
         "$ref": "#/components/schemas/Figure"
        },
        "annual_dividend": {},
        "ex_date": {},
        "record_date": {},
        "payment_date": {},
        "announced_on": {},
        "source": {}
       },
       "additionalProperties": true
      }
     }
    },
    "additionalProperties": true
   }
  }
 }
}