{
  "openapi": "3.1.0",
  "info": {
    "title": "EDINET API",
    "version": "draft-2026-07-28",
    "description": "AIsa gateway endpoints for EDINET document list and document download."
  },
  "servers": [
    {
      "url": "https://api.aisa.one/apis/v1"
    }
  ],
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "paths": {
    "/edinet/documents.json": {
      "get": {
        "x-aisa-pricing": {
          "model": "per_request",
          "currency": "USD",
          "price_usd": 1e-05,
          "cost_tier": "low"
        },
        "summary": "List EDINET documents",
        "description": "Lists every disclosure filed with Japan's EDINET on one date. date is required (YYYY-MM-DD). type=2 returns the filings under results — docID, filerName, secCode, JCN, docTypeCode, docDescription, submitDateTime, periodStart and periodEnd per filing — while type=1 returns metadata only, with the day's count under metadata.resultset.count and no results array. Measured at 612 KB for a typical business day (648 filings), and there are no filter parameters, so type=2 always returns the whole day; check the count with type=1 first when in doubt. About two thirds of filings carry a secCode (listed companies), the rest are funds and unlisted filers. A filing's docID feeds get_edinet_document_download.",
        "operationId": "get_edinet_documents",
        "tags": [
          "EDINET"
        ],
        "parameters": [
          {
            "name": "date",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date",
              "examples": [
                "2026-07-23"
              ]
            },
            "description": "File date in YYYY-MM-DD format."
          },
          {
            "name": "type",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "enum": [
                1,
                2
              ],
              "default": 1
            },
            "description": "Response mode: 1 for metadata only, 2 for metadata plus filing list."
          }
        ],
        "responses": {
          "200": {
            "description": "EDINET document-list response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "metadata": {
                      "type": "object",
                      "description": "Metadata object with title, request parameter echo, result count, processDateTime, status, and message."
                    },
                    "results": {
                      "type": "array",
                      "description": "Filing document objects when type=2.",
                      "items": {
                        "type": "object",
                        "properties": {
                          "seqNumber": {
                            "type": "integer"
                          },
                          "docID": {
                            "type": "string"
                          },
                          "filerName": {
                            "type": "string"
                          },
                          "docTypeCode": {
                            "type": "string"
                          },
                          "submitDateTime": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request parameters."
          },
          "401": {
            "description": "Invalid or missing AIsa API key."
          },
          "429": {
            "description": "Rate limit exceeded."
          },
          "500": {
            "description": "Gateway or upstream failure."
          }
        },
        "x-aisa-path": "/apis/v1/edinet/documents.json",
        "x-provider-cost-micros-usd": 0,
        "x-customer-pricing": {
          "normal": 1e-05
        }
      }
    },
    "/edinet/documents/{docID}": {
      "get": {
        "x-aisa-pricing": {
          "model": "per_request",
          "currency": "USD",
          "price_usd": 1e-05,
          "cost_tier": "low"
        },
        "summary": "Download an EDINET document",
        "description": "Downloads one filing by docID, taken from get_edinet_documents. The success response is a binary file, not JSON: type=1 returns the filing body and audit report as a ZIP archive (measured 11.9 KB, content-type application/octet-stream), type=2 the PDF (measured 15.0 KB, application/pdf). Errors still come back as JSON, so check the response content type before parsing. Because a tool result cannot usefully carry a binary payload, this endpoint stays REST-only: over MCP, stop at the docID from get_edinet_documents and fetch the file over REST.",
        "operationId": "get_edinet_document_download",
        "tags": [
          "EDINET"
        ],
        "parameters": [
          {
            "name": "docID",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "examples": [
                "S1000000"
              ]
            },
            "description": "Document management identifier from the document list API."
          },
          {
            "name": "type",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer",
              "enum": [
                1,
                2,
                3,
                4,
                5
              ]
            },
            "description": "File type to download: 1 for filing body and audit report ZIP, 2 for PDF, 3 for alternate document and attachments ZIP, 4 for English document ZIP, 5 for CSV ZIP converted from XBRL."
          }
        ],
        "responses": {
          "200": {
            "description": "Binary ZIP/PDF file content or JSON error payload depending on Content-Type.",
            "content": {
              "application/octet-stream": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "application/pdf": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request parameters."
          },
          "401": {
            "description": "Invalid or missing AIsa API key."
          },
          "404": {
            "description": "Document not found."
          },
          "429": {
            "description": "Rate limit exceeded."
          },
          "500": {
            "description": "Gateway or upstream failure."
          }
        },
        "x-aisa-path": "/apis/v1/edinet/documents/{docID}",
        "x-provider-cost-micros-usd": 0,
        "x-customer-pricing": {
          "normal": 1e-05
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer"
      }
    }
  }
}
