{
  "openapi": "3.1.0",
  "info": {
    "title": "Edgar — SEC EDGAR Financial Statements API",
    "version": "1.1.0",
    "description": "Free SEC EDGAR company financial data for people and AI agents: a directory of 8,000+ US public companies plus standardized financial statements, metric history and rankings built from SEC XBRL filings. All endpoints are GET, return JSON, and need no API key. The same data is available as an MCP server (5 tools) at https://edgar.morningbrief.link/mcp.",
    "contact": {
      "name": "Morning Brief",
      "url": "https://morningbrief.link/docs"
    }
  },
  "servers": [
    {
      "url": "https://edgar.morningbrief.link"
    }
  ],
  "tags": [
    {
      "name": "Status"
    },
    {
      "name": "Companies"
    },
    {
      "name": "Financials"
    },
    {
      "name": "MCP"
    }
  ],
  "paths": {
    "/": {
      "get": {
        "tags": [
          "Status"
        ],
        "summary": "Service status & dataset catalog",
        "description": "Live catalog of every dataset with row counts, freshness and routes, plus a deep health check against a known anchor company. (Browsers sending Accept: text/html get the HTML landing page instead.)",
        "parameters": [],
        "responses": {
          "200": {
            "description": "OK — JSON object with the requested data.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/status": {
      "get": {
        "tags": [
          "Status"
        ],
        "summary": "Service status & dataset catalog",
        "description": "Same catalog as GET /, including the deep health check (503 when the anchor query fails).",
        "parameters": [],
        "responses": {
          "200": {
            "description": "OK — JSON object with the requested data.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/health": {
      "get": {
        "tags": [
          "Status"
        ],
        "summary": "Health check",
        "description": "Returns { ok: true, service: \"edgar-api\", version }.",
        "parameters": [],
        "responses": {
          "200": {
            "description": "OK — JSON object with the requested data.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/companies/search": {
      "get": {
        "tags": [
          "Companies"
        ],
        "summary": "Search companies",
        "description": "Search the 8,000+ company directory by name/ticker text or SIC industry.",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": false,
            "description": "Search text matched against company name and ticker.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sic",
            "in": "query",
            "required": false,
            "description": "Exact SIC industry code.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sic_prefix",
            "in": "query",
            "required": false,
            "description": "SIC code prefix (industry group).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Max rows to return.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 1000
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK — JSON object with the requested data.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/companies/company": {
      "get": {
        "tags": [
          "Companies"
        ],
        "summary": "Get one company",
        "description": "Directory record for a single company by ticker or CIK, including its loaded financial coverage.",
        "parameters": [
          {
            "name": "ticker",
            "in": "query",
            "required": false,
            "description": "Company ticker symbol, e.g. NVDA (either ticker or cik is required).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "cik",
            "in": "query",
            "required": false,
            "description": "SEC CIK number (either ticker or cik is required).",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK — JSON object with the requested data.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/companies/industries": {
      "get": {
        "tags": [
          "Companies"
        ],
        "summary": "List industries",
        "description": "SIC industries present in the directory, with company counts.",
        "parameters": [],
        "responses": {
          "200": {
            "description": "OK — JSON object with the requested data.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/financials/statements": {
      "get": {
        "tags": [
          "Financials"
        ],
        "summary": "Standardized financial statements",
        "description": "Standardized statement figures for one company (income, balance sheet, cash flow concepts) from SEC filings.",
        "parameters": [
          {
            "name": "ticker",
            "in": "query",
            "required": false,
            "description": "Company ticker symbol, e.g. NVDA (either ticker or cik is required).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "cik",
            "in": "query",
            "required": false,
            "description": "SEC CIK number (either ticker or cik is required).",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "period",
            "in": "query",
            "required": false,
            "description": "annual or quarterly.",
            "schema": {
              "type": "string",
              "default": "annual"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK — JSON object with the requested data.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/financials/metric": {
      "get": {
        "tags": [
          "Financials"
        ],
        "summary": "Metric history for one company",
        "description": "Time series of one concept (e.g. revenue) for one company.",
        "parameters": [
          {
            "name": "ticker",
            "in": "query",
            "required": false,
            "description": "Company ticker symbol, e.g. NVDA (either ticker or cik is required).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "cik",
            "in": "query",
            "required": false,
            "description": "SEC CIK number (either ticker or cik is required).",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "concept",
            "in": "query",
            "required": false,
            "description": "Concept key, e.g. revenue — see /v1/financials/concepts.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "period",
            "in": "query",
            "required": false,
            "description": "annual, quarterly or all.",
            "schema": {
              "type": "string",
              "default": "all"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK — JSON object with the requested data.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/financials/concepts": {
      "get": {
        "tags": [
          "Financials"
        ],
        "summary": "List financial concepts",
        "description": "Concept keys available for metric queries and rankings.",
        "parameters": [],
        "responses": {
          "200": {
            "description": "OK — JSON object with the requested data.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/financials/leaders": {
      "get": {
        "tags": [
          "Financials"
        ],
        "summary": "Rank companies by a metric",
        "description": "Companies ranked by the latest value of one concept (e.g. revenue leaders).",
        "parameters": [
          {
            "name": "concept",
            "in": "query",
            "required": false,
            "description": "Concept key, e.g. revenue.",
            "schema": {
              "type": "string",
              "default": "revenue"
            }
          },
          {
            "name": "period",
            "in": "query",
            "required": false,
            "description": "annual or quarterly.",
            "schema": {
              "type": "string",
              "default": "annual"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Max rows to return.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 1000
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK — JSON object with the requested data.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/mcp": {
      "post": {
        "tags": [
          "MCP"
        ],
        "summary": "MCP server endpoint (streamable HTTP)",
        "description": "Model Context Protocol endpoint — 5 tools: search_companies, get_company, get_financials, get_metric_history, list_financial_concepts. Send JSON-RPC 2.0 (initialize, tools/list, tools/call). No auth.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "description": "JSON-RPC 2.0 request."
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "JSON-RPC response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Error": {
        "type": "object",
        "properties": {
          "error": {
            "type": "string"
          }
        }
      }
    }
  }
}