{
 "openapi": "3.1.0",
 "info": {
  "title": "The Filing Radar API",
  "version": "1.0.0",
  "description": "SEC EDGAR filings, parsed: Form 4 insider trades (buys/sells, dollar values, cluster buys, 10b5-1 plan flag), 8-Ks tagged by item, 13D/13G stakes, S-1/F-1 IPO filings, late filings and Form 144s, company filing histories, and 8-K summaries checked against the filing. Not investment advice. Docs: https://thefilingradar.com/developers",
  "contact": {
   "url": "https://thefilingradar.com/contact"
  },
  "termsOfService": "https://thefilingradar.com/terms"
 },
 "servers": [
  {
   "url": "https://thefilingradar.com"
  }
 ],
 "security": [
  {
   "bearer": []
  },
  {
   "apiKeyHeader": []
  }
 ],
 "paths": {
  "/v1/insiders": {
   "get": {
    "operationId": "listInsiderTrades",
    "summary": "Parsed Form 4 insider trades, newest first",
    "parameters": [
     {
      "name": "buys",
      "in": "query",
      "required": false,
      "description": "1 = open-market purchases only (code P)",
      "schema": {
       "type": "string",
       "enum": [
        "1"
       ]
      }
     },
     {
      "name": "cluster",
      "in": "query",
      "required": false,
      "description": "1 = only buys where 2+ different insiders bought the same company in the window",
      "schema": {
       "type": "string",
       "enum": [
        "1"
       ]
      }
     },
     {
      "name": "planned",
      "in": "query",
      "required": false,
      "description": "0 = exclude 10b5-1 plan trades, 1 = only those",
      "schema": {
       "type": "string",
       "enum": [
        "0",
        "1"
       ]
      }
     },
     {
      "name": "min_value",
      "in": "query",
      "required": false,
      "description": "Minimum trade value in dollars",
      "schema": {
       "type": "integer",
       "minimum": 0
      }
     },
     {
      "name": "ticker",
      "in": "query",
      "required": false,
      "description": "Only this ticker, e.g. AAPL",
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "day",
      "in": "query",
      "required": false,
      "description": "An archived day (YYYY-MM-DD, Eastern time) instead of the live feed",
      "schema": {
       "type": "string",
       "format": "date"
      }
     },
     {
      "name": "since",
      "in": "query",
      "required": false,
      "description": "Unix time: only rows after it",
      "schema": {
       "type": "integer"
      }
     },
     {
      "name": "limit",
      "in": "query",
      "required": false,
      "description": "1-500, default 100",
      "schema": {
       "type": "integer",
       "minimum": 1,
       "maximum": 500
      }
     },
     {
      "name": "from",
      "in": "query",
      "schema": {
       "type": "string",
       "format": "date"
      },
      "description": "History: start day (YYYY-MM-DD, back to 2020-01-01). Switches to the history store: open-market buys and sells only. Trial keys: last 90 days."
     },
     {
      "name": "to",
      "in": "query",
      "schema": {
       "type": "string",
       "format": "date"
      },
      "description": "History: end day (default today)."
     }
    ],
    "responses": {
     "200": {
      "description": "Insider trades",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "data": {
           "type": "array",
           "items": {
            "$ref": "#/components/schemas/InsiderTrade"
           }
          },
          "count": {
           "type": "integer"
          },
          "more": {
           "type": "boolean",
           "description": "More rows matched than limit returned"
          },
          "updated": {
           "type": [
            "integer",
            "null"
           ],
           "description": "Unix time of the last feed refresh (null for an archived day)"
          }
         }
        }
       }
      }
     },
     "400": {
      "description": "Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "Missing or invalid API key",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "402": {
      "description": "Plan not active or trial ended",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Per-minute or daily limit reached",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/v1/filings": {
   "get": {
    "operationId": "listFilings",
    "summary": "The live feed (or one archived day), newest first",
    "parameters": [
     {
      "name": "kind",
      "in": "query",
      "required": false,
      "description": "Filing type; omit for all",
      "schema": {
       "type": "string",
       "enum": [
        "8-K",
        "insider",
        "stake",
        "ipo",
        "flag"
       ]
      }
     },
     {
      "name": "ticker",
      "in": "query",
      "required": false,
      "description": "Only this ticker, e.g. AAPL",
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "day",
      "in": "query",
      "required": false,
      "description": "An archived day (YYYY-MM-DD, Eastern time) instead of the live feed",
      "schema": {
       "type": "string",
       "format": "date"
      }
     },
     {
      "name": "since",
      "in": "query",
      "required": false,
      "description": "Unix time: only rows after it",
      "schema": {
       "type": "integer"
      }
     },
     {
      "name": "limit",
      "in": "query",
      "required": false,
      "description": "1-500, default 100",
      "schema": {
       "type": "integer",
       "minimum": 1,
       "maximum": 500
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Filings",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "data": {
           "type": "array",
           "items": {
            "$ref": "#/components/schemas/Filing"
           }
          },
          "count": {
           "type": "integer"
          },
          "more": {
           "type": "boolean",
           "description": "More rows matched than limit returned"
          },
          "updated": {
           "type": [
            "integer",
            "null"
           ],
           "description": "Unix time of the last feed refresh (null for an archived day)"
          }
         }
        }
       }
      }
     },
     "400": {
      "description": "Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "Missing or invalid API key",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "402": {
      "description": "Plan not active or trial ended",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Per-minute or daily limit reached",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/v1/company/{ticker}": {
   "get": {
    "operationId": "getCompany",
    "summary": "Company details and its latest 80 filings",
    "parameters": [
     {
      "name": "ticker",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      },
      "example": "NVDA"
     }
    ],
    "responses": {
     "200": {
      "description": "Company",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "data": {
           "$ref": "#/components/schemas/Company"
          }
         }
        }
       }
      }
     },
     "400": {
      "description": "Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "Missing or invalid API key",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "402": {
      "description": "Plan not active or trial ended",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Per-minute or daily limit reached",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "Unknown ticker",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/v1/summaries": {
   "get": {
    "operationId": "listSummaries",
    "summary": "The newest published 8-K summaries",
    "parameters": [
     {
      "name": "ticker",
      "in": "query",
      "required": false,
      "description": "Only this ticker",
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "since",
      "in": "query",
      "required": false,
      "description": "Unix time the summary was written",
      "schema": {
       "type": "integer"
      }
     },
     {
      "name": "limit",
      "in": "query",
      "required": false,
      "description": "1-500, default 100",
      "schema": {
       "type": "integer",
       "minimum": 1,
       "maximum": 500
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Summaries",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "data": {
           "type": "array",
           "items": {
            "$ref": "#/components/schemas/Summary"
           }
          },
          "count": {
           "type": "integer"
          },
          "more": {
           "type": "boolean",
           "description": "More rows matched than limit returned"
          },
          "updated": {
           "type": [
            "integer",
            "null"
           ],
           "description": "Unix time of the last feed refresh (null for an archived day)"
          }
         }
        }
       }
      }
     },
     "400": {
      "description": "Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "Missing or invalid API key",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "402": {
      "description": "Plan not active or trial ended",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Per-minute or daily limit reached",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/v1/summaries/{accession}": {
   "get": {
    "operationId": "getSummary",
    "summary": "One filing's published summary (never generated on request)",
    "parameters": [
     {
      "name": "accession",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "pattern": "^[0-9]{10}-[0-9]{2}-[0-9]{6}$"
      },
      "example": "0001193125-26-437964"
     }
    ],
    "responses": {
     "200": {
      "description": "Summary",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "data": {
           "$ref": "#/components/schemas/Summary"
          }
         }
        }
       }
      }
     },
     "400": {
      "description": "Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "Missing or invalid API key",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "402": {
      "description": "Plan not active or trial ended",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Per-minute or daily limit reached",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "No published summary",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/v1/usage": {
   "get": {
    "operationId": "getUsage",
    "summary": "Your plan, calls today and limits (counts as a call)",
    "responses": {
     "200": {
      "description": "Usage",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "plan": {
           "type": "string",
           "enum": [
            "trial",
            "developer",
            "business"
           ]
          },
          "calls_today": {
           "type": "integer"
          },
          "daily_limit": {
           "type": "integer"
          },
          "per_minute": {
           "type": "integer"
          },
          "resets": {
           "type": "string"
          },
          "trial_ends": {
           "type": [
            "integer",
            "null"
           ]
          }
         }
        }
       }
      }
     },
     "400": {
      "description": "Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "Missing or invalid API key",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "402": {
      "description": "Plan not active or trial ended",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Per-minute or daily limit reached",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/v1/transactions": {
   "get": {
    "summary": "Full Form 4/5 transaction history (Business plan)",
    "description": "Every reported transaction line since 2006, all transaction codes, derivative and non-derivative.",
    "parameters": [
     {
      "name": "from",
      "in": "query",
      "required": true,
      "schema": {
       "type": "string",
       "format": "date"
      },
      "description": "Start day (YYYY-MM-DD, back to 2006-01-01)."
     },
     {
      "name": "to",
      "in": "query",
      "schema": {
       "type": "string",
       "format": "date"
      },
      "description": "End day (default today)."
     },
     {
      "name": "ticker",
      "in": "query",
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "code",
      "in": "query",
      "schema": {
       "type": "string"
      },
      "description": "One transaction code letter: P buy, S sale, A grant, M exercise, F tax withholding, G gift."
     },
     {
      "name": "derivative",
      "in": "query",
      "schema": {
       "type": "integer",
       "enum": [
        0,
        1
       ]
      }
     },
     {
      "name": "min_value",
      "in": "query",
      "schema": {
       "type": "integer"
      }
     },
     {
      "name": "limit",
      "in": "query",
      "schema": {
       "type": "integer",
       "maximum": 500
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Transactions, newest filed first"
     },
     "403": {
      "description": "Not on the Business plan"
     }
    }
   }
  }
 },
 "components": {
  "securitySchemes": {
   "bearer": {
    "type": "http",
    "scheme": "bearer",
    "description": "Authorization: Bearer fr_live_..."
   },
   "apiKeyHeader": {
    "type": "apiKey",
    "in": "header",
    "name": "X-API-Key"
   }
  },
  "schemas": {
   "Error": {
    "type": "object",
    "properties": {
     "error": {
      "type": "string"
     }
    }
   },
   "InsiderTrade": {
    "type": "object",
    "properties": {
     "kind": {
      "const": "insider"
     },
     "t": {
      "type": "integer",
      "description": "Unix time EDGAR accepted the filing"
     },
     "acc": {
      "type": "string",
      "description": "Accession number"
     },
     "company": {
      "type": "string"
     },
     "ticker": {
      "type": "string"
     },
     "who": {
      "type": "string",
      "description": "Reporting insider"
     },
     "role": {
      "type": "string",
      "description": "e.g. Chief Executive Officer, Director, 10% owner"
     },
     "code": {
      "type": "string",
      "description": "Main SEC transaction code: P purchase, S sale, A grant, M/X option exercise, F tax withholding, G gift, ..."
     },
     "action": {
      "type": "string",
      "description": "Plain-English action, e.g. Bought, Sold"
     },
     "shares": {
      "type": "integer",
      "description": "Shares in the main transaction code, summed across the filing"
     },
     "value": {
      "type": "integer",
      "description": "Dollar value (shares x price), summed"
     },
     "avg_price": {
      "type": [
       "number",
       "null"
      ]
     },
     "planned": {
      "type": "boolean",
      "description": "Filed as made under a Rule 10b5-1 trading plan"
     },
     "cluster": {
      "type": "boolean",
      "description": "2+ different insiders bought this company in the current window"
     },
     "date": {
      "type": "string",
      "description": "Transaction date (periodOfReport)"
     },
     "link": {
      "type": "string",
      "format": "uri"
     }
    }
   },
   "Filing": {
    "type": "object",
    "description": "A feed row. Fields vary by kind; insider rows match InsiderTrade.",
    "properties": {
     "kind": {
      "type": "string",
      "enum": [
       "8-K",
       "insider",
       "stake",
       "ipo",
       "flag"
      ]
     },
     "t": {
      "type": "integer"
     },
     "acc": {
      "type": "string"
     },
     "company": {
      "type": "string"
     },
     "ticker": {
      "type": "string"
     },
     "headline": {
      "type": "string"
     },
     "form": {
      "type": "string"
     },
     "tags": {
      "type": "array",
      "description": "8-K items as [name, level]; level is red, big, earn or empty",
      "items": {
       "type": "array",
       "items": {
        "type": "string"
       }
      }
     },
     "who": {
      "type": "string",
      "description": "Stakes: the filer"
     },
     "active": {
      "type": "boolean",
      "description": "Stakes: true for 13D, false for 13G"
     },
     "amended": {
      "type": "boolean"
     },
     "level": {
      "type": "string",
      "description": "Flags: red or empty"
     },
     "link": {
      "type": "string",
      "format": "uri"
     }
    }
   },
   "Company": {
    "type": "object",
    "properties": {
     "ticker": {
      "type": "string"
     },
     "cik": {
      "type": "string"
     },
     "name": {
      "type": "string"
     },
     "industry": {
      "type": "string"
     },
     "exchanges": {
      "type": "array",
      "items": {
       "type": "string"
      }
     },
     "website": {
      "type": "string"
     },
     "state": {
      "type": "string"
     },
     "filings": {
      "type": "array",
      "items": {
       "type": "object",
       "properties": {
        "form": {
         "type": "string"
        },
        "what": {
         "type": "string"
        },
        "date": {
         "type": "string"
        },
        "t": {
         "type": "integer"
        },
        "tags": {
         "type": "array",
         "items": {
          "type": "array",
          "items": {
           "type": "string"
          }
         }
        },
        "acc": {
         "type": "string"
        },
        "link": {
         "type": "string",
         "format": "uri"
        }
       }
      }
     }
    }
   },
   "Fact": {
    "type": "object",
    "properties": {
     "label": {
      "type": "string",
      "enum": [
       "who",
       "what",
       "amount",
       "date",
       "other"
      ]
     },
     "value": {
      "type": "string"
     },
     "quote": {
      "type": "string",
      "description": "Exact words from the filing"
     },
     "found": {
      "type": "boolean"
     },
     "url": {
      "type": "string",
      "description": "Link that highlights the quote in the filing"
     }
    }
   },
   "Summary": {
    "type": "object",
    "properties": {
     "acc": {
      "type": "string"
     },
     "ticker": {
      "type": "string"
     },
     "company": {
      "type": "string"
     },
     "form": {
      "type": "string"
     },
     "headline": {
      "type": "string"
     },
     "summary": {
      "type": "string"
     },
     "facts": {
      "type": "array",
      "items": {
       "$ref": "#/components/schemas/Fact"
      }
     },
     "label": {
      "type": "string",
      "enum": [
       "Verified",
       "Partly verified"
      ]
     },
     "ai_checked": {
      "type": "boolean"
     },
     "filing": {
      "type": "string",
      "format": "uri"
     },
     "document": {
      "type": "string",
      "format": "uri"
     },
     "created": {
      "type": "integer"
     },
     "corrected": {
      "type": [
       "number",
       "null"
      ]
     }
    }
   }
  }
 },
 "webhooks": {
  "filings": {
   "post": {
    "summary": "Business plan: new feed rows, oldest first, up to 100 per request",
    "parameters": [
     {
      "name": "X-Filing-Radar-Signature",
      "in": "header",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "t=<unix>,v1=<hex HMAC-SHA256 of t + '.' + raw body with your signing secret>"
     }
    ],
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "type": {
          "const": "filings"
         },
         "data": {
          "type": "array",
          "items": {
           "$ref": "#/components/schemas/Filing"
          }
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Any 2xx acknowledges delivery"
     }
    }
   }
  }
 }
}