{
  "openapi": "3.1.0",
  "info": {
    "title": "EDGAR Terminal Factor Lab API",
    "version": "1.0.0",
    "description": "A bounded, source-aware market diagnostic for analysts and connected AI tools. The EDGAR Factor Lab endpoint returns derived econometric diagnostics and filing-derived descriptive measures; it does not redistribute bulk vendor price histories, predict returns, or provide investment advice.",
    "contact": {
      "name": "EDGAR Terminal",
      "url": "https://secedgarterminal.com/about"
    }
  },
  "servers": [
    {
      "url": "https://secedgarterminal.com",
      "description": "Production"
    }
  ],
  "tags": [
    {
      "name": "Market signals",
      "description": "Regression diagnostics joined to current, source-linked SEC filing evidence. Methodology: https://secedgarterminal.com/market/factors"
    }
  ],
  "paths": {
    "/api/v1/market-signals": {
      "get": {
        "tags": ["Market signals"],
        "operationId": "getMarketSignal",
        "summary": "Calculate an EDGAR Factor Lab diagnostic for one covered company",
        "description": "Returns daily adjusted-close regression diagnostics against SPY and a sector proxy, a current peer-normalized filing-change snapshot, a filing-event response when estimable, and the descriptive Evidence Gap. Exact-date intersection, coverage gates, Newey-West HAC inference, source provenance, warnings, and interpretation limits are included. A result may be ready, partial, withheld, or stale. Missing statistics are null, never zero. This is not CAPM because no risk-free return is subtracted; the regression intercept is not Jensen alpha. The filing snapshot is not a historical factor return, and the Evidence Gap is not a forecast or trade signal.",
        "parameters": [
          {
            "name": "ticker",
            "in": "query",
            "required": true,
            "description": "Uppercase ticker in the current curated Market universe. Class-share dots and hyphens are supported where present.",
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9][A-Za-z0-9.-]{0,9}$"
            },
            "example": "NVDA"
          },
          {
            "name": "window",
            "in": "query",
            "required": false,
            "description": "Requested lookback window. The effective sample can start later because prices are aligned exactly by return interval.",
            "schema": {
              "type": "string",
              "enum": ["1y", "3y", "5y"],
              "default": "3y"
            }
          },
          {
            "name": "basis",
            "in": "query",
            "required": false,
            "description": "SEC comparison basis used by the filing-derived snapshot. It does not change the daily price-return frequency.",
            "schema": {
              "type": "string",
              "enum": ["ttm", "annual"],
              "default": "ttm"
            }
          },
          {
            "name": "cohort",
            "in": "query",
            "required": false,
            "description": "Peer-normalization cohort. auto selects the issuer's first supported Market cohort. A supplied cohort must contain the issuer.",
            "schema": {
              "type": "string",
              "enum": [
                "auto",
                "credit-banks",
                "private-capital",
                "real-estate",
                "housing",
                "energy-commodities",
                "consumer-demand",
                "ai-infrastructure",
                "software-security",
                "transport-cyclicals",
                "insurance",
                "healthcare",
                "industrial-capex",
                "utilities-rates"
              ],
              "default": "auto"
            }
          },
          {
            "name": "sector_proxy",
            "in": "query",
            "required": false,
            "description": "ETF used for market-orthogonal sector sensitivity and filing-event adjustment. auto maps the selected cohort to a documented proxy.",
            "schema": {
              "type": "string",
              "enum": ["auto", "XLF", "XLRE", "XHB", "XLE", "XLY", "XLK", "XLI", "XLV", "XLU"],
              "default": "auto"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Completed or retained diagnostic. Inspect status, quality, warnings, sample, and provenance before using estimates.",
            "headers": {
              "RateLimit-Limit": { "$ref": "#/components/headers/RateLimitLimit" },
              "RateLimit-Remaining": { "$ref": "#/components/headers/RateLimitRemaining" },
              "RateLimit-Reset": { "$ref": "#/components/headers/RateLimitReset" },
              "X-Schema-Version": {
                "description": "Response schema version.",
                "schema": { "type": "string", "const": "edgar.market-signals.v1" }
              },
              "X-Methodology-Version": {
                "description": "Econometric and filing-score methodology version.",
                "schema": { "type": "string", "const": "market-signals-1.0.0" }
              },
              "X-Data-Through": {
                "description": "Latest common price-input date or unavailable.",
                "schema": { "type": "string" }
              },
              "X-Cache-Source": {
                "description": "Result delivery state; this is not the underlying data provider.",
                "schema": { "type": "string", "enum": ["computed", "warm", "stale"] }
              },
              "Warning": {
                "description": "HTTP Warning 110 when a retained stale result is served.",
                "schema": { "type": "string" }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "https://secedgarterminal.com/schemas/market-signals-v1.schema.json"
                },
                "examples": {
                  "requestShape": {
                    "summary": "Abbreviated shape; live values and coverage vary",
                    "value": {
                      "schema_version": "edgar.market-signals.v1",
                      "methodology_version": "market-signals-1.0.0",
                      "universe_version": "market-research-v3",
                      "snapshot_id": "market-research-v3:example",
                      "status": "ready",
                      "cache_status": "computed",
                      "generated_at": "2026-09-09T12:00:00.000Z",
                      "data_through": "2026-09-08",
                      "request": {
                        "ticker": "NVDA",
                        "window": "3y",
                        "basis": "ttm",
                        "cohort": "ai-infrastructure",
                        "sector_proxy": "XLK",
                        "market_benchmark": "SPY",
                        "frequency": "daily"
                      },
                      "issuer": {
                        "ticker": "NVDA",
                        "name": "NVIDIA Corporation",
                        "cik": "0001045810",
                        "sic": "3674",
                        "cohorts": ["ai-infrastructure"]
                      },
                      "sample": {
                        "requested_start": "2023-09-10",
                        "effective_start": "2023-09-11",
                        "effective_end": "2026-09-08",
                        "observations": 752,
                        "eligible_benchmark_intervals": 752,
                        "overlap_coverage": 1,
                        "excluded": {
                          "asset_prices": 0,
                          "market_prices": 0,
                          "sector_prices": 0,
                          "unmatched_benchmark_intervals": 0
                        }
                      },
                      "estimates": {
                        "market_model": {
                          "observations": 752,
                          "beta": 1.18,
                          "beta_standard_error": 0.05,
                          "beta_confidence_interval95": [1.08, 1.28],
                          "r_squared": 0.62,
                          "hac_lag": 6
                        },
                        "conditional_beta": null,
                        "independent_sector_sensitivity": null,
                        "rolling_beta": null
                      },
                      "edgar_snapshot": {
                        "schema_version": "edgar-market-signals-v1",
                        "available": true,
                        "diagnostic_only": true,
                        "ticker": "NVDA",
                        "cik": "0001045810",
                        "basis": "ttm",
                        "cohort_id": "ai-infrastructure",
                        "template": { "id": "nonfinancial", "label": "Non-financial filing change" },
                        "filing_change_z": 0.89,
                        "direction": { "id": "stronger_relative_change", "label": "Stronger peer-relative filing change" },
                        "coverage": {
                          "required_components": 5,
                          "available_components": 5,
                          "ratio": 1,
                          "eligible_peer_issuers": 24,
                          "minimum_peers_per_component": 8,
                          "peer_filing_clock": {
                            "focus": "2026-08-06T12:30:00.000Z",
                            "earliest_peer": "2026-07-21T20:15:00.000Z",
                            "latest_peer": "2026-08-05T21:02:00.000Z",
                            "observed_peers": 24,
                            "missing_peers": 0,
                            "peers_after_focus": 0
                          }
                        },
                        "components": [
                          {
                            "key": "revenueGrowth",
                            "label": "Revenue growth acceleration",
                            "unit": "percentage_points",
                            "weight": 0.25,
                            "required": true,
                            "available": true,
                            "current": 12.5,
                            "prior": 9.5,
                            "change": 3,
                            "supplied_change": 3,
                            "supplied_change_consistent": true,
                            "change_source": "current_minus_prior",
                            "z": 0.9,
                            "raw_z": 0.9,
                            "clipped": false,
                            "weighted_z": 0.225,
                            "peer_percentile": 70.8,
                            "peer_count": 24,
                            "peer_candidates": 24,
                            "peer_distribution": {
                              "count": 24,
                              "median": 1.2,
                              "mad": 1.35,
                              "q1": 0.1,
                              "q3": 2.4,
                              "standard_deviation": 2.2,
                              "scale": 2,
                              "scale_method": "median_absolute_deviation",
                              "min": -3.1,
                              "max": 5.8
                            },
                            "reason": null
                          },
                          {
                            "key": "operatingMargin",
                            "label": "Operating margin change",
                            "unit": "percentage_points",
                            "weight": 0.25,
                            "required": true,
                            "available": true,
                            "current": 25,
                            "prior": 24,
                            "change": 1,
                            "supplied_change": 1,
                            "supplied_change_consistent": true,
                            "change_source": "current_minus_prior",
                            "z": 0.8,
                            "raw_z": 0.8,
                            "clipped": false,
                            "weighted_z": 0.2,
                            "peer_percentile": 68.8,
                            "peer_count": 24,
                            "peer_candidates": 24,
                            "peer_distribution": { "count": 24, "median": 0.2, "mad": 0.67, "q1": -0.4, "q3": 0.9, "standard_deviation": 1.1, "scale": 1, "scale_method": "median_absolute_deviation", "min": -2.4, "max": 3.2 },
                            "reason": null
                          },
                          {
                            "key": "freeCashFlowMargin",
                            "label": "Free cash flow margin change",
                            "unit": "percentage_points",
                            "weight": 0.25,
                            "required": true,
                            "available": true,
                            "current": 18,
                            "prior": 16,
                            "change": 2,
                            "supplied_change": 2,
                            "supplied_change_consistent": true,
                            "change_source": "current_minus_prior",
                            "z": 1,
                            "raw_z": 1,
                            "clipped": false,
                            "weighted_z": 0.25,
                            "peer_percentile": 75,
                            "peer_count": 24,
                            "peer_candidates": 24,
                            "peer_distribution": { "count": 24, "median": 0.5, "mad": 1.01, "q1": -0.7, "q3": 1.8, "standard_deviation": 1.8, "scale": 1.5, "scale_method": "median_absolute_deviation", "min": -4.1, "max": 5.2 },
                            "reason": null
                          },
                          {
                            "key": "equityToAssets",
                            "label": "Book equity / assets change",
                            "unit": "percentage_points",
                            "weight": 0.125,
                            "required": true,
                            "available": true,
                            "current": 45,
                            "prior": 44,
                            "change": 1,
                            "supplied_change": 1,
                            "supplied_change_consistent": true,
                            "change_source": "current_minus_prior",
                            "z": 0.75,
                            "raw_z": 0.75,
                            "clipped": false,
                            "weighted_z": 0.09375,
                            "peer_percentile": 66.7,
                            "peer_count": 24,
                            "peer_candidates": 24,
                            "peer_distribution": { "count": 24, "median": 0.4, "mad": 0.54, "q1": -0.1, "q3": 0.9, "standard_deviation": 0.9, "scale": 0.8, "scale_method": "median_absolute_deviation", "min": -1.8, "max": 2.5 },
                            "reason": null
                          },
                          {
                            "key": "cashToAssets",
                            "label": "Cash / assets change",
                            "unit": "percentage_points",
                            "weight": 0.125,
                            "required": true,
                            "available": true,
                            "current": 16,
                            "prior": 15,
                            "change": 1,
                            "supplied_change": 1,
                            "supplied_change_consistent": true,
                            "change_source": "current_minus_prior",
                            "z": 1,
                            "raw_z": 1,
                            "clipped": false,
                            "weighted_z": 0.125,
                            "peer_percentile": 75,
                            "peer_count": 24,
                            "peer_candidates": 24,
                            "peer_distribution": { "count": 24, "median": 0.3, "mad": 0.47, "q1": -0.2, "q3": 0.8, "standard_deviation": 0.8, "scale": 0.7, "scale_method": "median_absolute_deviation", "min": -1.4, "max": 2.1 },
                            "reason": null
                          }
                        ],
                        "reason": null,
                        "methodology": { "peer_method": "leave-one-out cohort comparison" },
                        "claim_limits": ["Not a return forecast, trading signal, or recommendation."]
                      },
                      "filing_event": {
                        "event_date": "2026-08-06",
                        "acceptance_timestamp": "2026-08-06T12:30:00.000Z",
                        "event_start": "2026-08-05",
                        "event_interval_end": "2026-08-06",
                        "timing_quality": "acceptance_timestamp_before_market_open",
                        "estimation": {
                          "start": "2025-07-30",
                          "end": "2026-07-29",
                          "observations": 252,
                          "gap_sessions": 20
                        },
                        "windows": {
                          "1": { "sessions": 1, "through": "2026-08-06", "cumulative_abnormal_return": 0.008, "standardized_response": 0.21 },
                          "5": { "sessions": 5, "through": "2026-08-12", "cumulative_abnormal_return": 0.021, "standardized_response": 0.31 },
                          "20": { "sessions": 20, "through": "2026-09-02", "cumulative_abnormal_return": 0.04, "standardized_response": 0.35 }
                        }
                      },
                      "evidence_gap": {
                        "schema_version": "edgar-market-signals-v1",
                        "available": true,
                        "diagnostic_only": true,
                        "evidence_gap": 0.54,
                        "inputs": {
                          "filing_change_z": 0.89,
                          "price_response_z": 0.35,
                          "clipped_filing_change_z": 0.89,
                          "clipped_price_response_z": 0.35
                        },
                        "classification": {
                          "id": "filing_change_without_material_price_response",
                          "label": "Positive filing change; muted price response",
                          "interpretation": "Peer-relative filing change was positive while the model-adjusted price response remained inside the neutral band."
                        },
                        "gap_interpretation": "Reported filing change was stronger than the model-adjusted price response on the clipped standardized scales.",
                        "reason": null,
                        "formula": "clip(filingChangeZ, -3, 3) - clip(priceResponseZ, -3, 3)",
                        "input_clip": 3,
                        "neutral_band": 0.5,
                        "range": { "min": -6, "max": 6 },
                        "claim_limits": ["Not a return forecast, trading signal, or recommendation."]
                      },
                      "quality": {
                        "grade": "A",
                        "headline_eligible": true,
                        "evidence_gap_eligible": true,
                        "observations": 752,
                        "peer_count": 24,
                        "eligible_peer_issuers": 24,
                        "filing_components": 5,
                        "required_filing_components": 5,
                        "filing_score_complete": true,
                        "peer_filings_after_focus": 0,
                        "filing_event_complete": true,
                        "sec_snapshot_status": "current"
                      },
                      "interpretation": "Illustrative, non-live example showing how filing evidence and market response remain separate.",
                      "provenance": {
                        "sec": {
                          "source": "https://data.sec.gov/api/xbrl/companyfacts/CIK0001045810.json",
                          "snapshot_generated_at": "2026-09-09T11:00:00.000Z",
                          "reporting_basis": "ttm",
                          "point_in_time": true,
                          "cutoff": {
                            "filed": "2026-08-06",
                            "accepted_at": "2026-08-06T12:30:00.000Z",
                            "accession": "0001045810-26-000123"
                          },
                          "current_filing": {
                            "end": "2026-07-27",
                            "filed": "2026-08-06",
                            "accepted_at": "2026-08-06T12:30:00.000Z",
                            "form": "10-Q",
                            "accession": "0001045810-26-000123",
                            "source": "https://www.sec.gov/Archives/edgar/data/1045810/000104581026000123/",
                            "factor_source_accessions": ["0001045810-26-000123"],
                            "metric_source_accessions": { "revenue_growth": ["0001045810-26-000123"] }
                          },
                          "prior_filing": {
                            "end": "2025-07-27",
                            "filed": "2025-08-07",
                            "accepted_at": "2025-08-07T12:31:00.000Z",
                            "form": "10-Q",
                            "accession": "0001045810-25-000117",
                            "source": "https://www.sec.gov/Archives/edgar/data/1045810/000104581025000117/",
                            "factor_source_accessions": ["0001045810-25-000117"],
                            "metric_source_accessions": { "revenue_growth": ["0001045810-25-000117"] }
                          }
                        },
                        "prices": {
                          "asset": {
                            "ticker": "NVDA",
                            "provider": "yahoo_finance",
                            "cache_status": "warm",
                            "price_basis": "adjusted_close",
                            "adjustment_coverage": 1,
                            "retrieved_at": "2026-09-09T10:00:00.000Z",
                            "first_observation": "2023-09-09",
                            "last_observation": "2026-09-08",
                            "observations": 752,
                            "attempts": []
                          },
                          "market": {
                            "ticker": "SPY",
                            "provider": "yahoo_finance",
                            "cache_status": "warm",
                            "price_basis": "adjusted_close",
                            "adjustment_coverage": 1,
                            "retrieved_at": "2026-09-09T10:00:00.000Z",
                            "first_observation": "2023-09-09",
                            "last_observation": "2026-09-08",
                            "observations": 752,
                            "attempts": []
                          },
                          "sector_proxy": {
                            "ticker": "XLK",
                            "provider": "yahoo_finance",
                            "cache_status": "warm",
                            "price_basis": "adjusted_close",
                            "adjustment_coverage": 1,
                            "retrieved_at": "2026-09-09T10:00:00.000Z",
                            "first_observation": "2023-09-09",
                            "last_observation": "2026-09-08",
                            "observations": 752,
                            "attempts": []
                          }
                        }
                      },
                      "equations": [],
                      "warnings": [],
                      "limitations": ["Illustrative response shape only; retrieve live data before analysis."],
                      "links": {
                        "methodology": "https://secedgarterminal.com/market/factors",
                        "api": "https://secedgarterminal.com/api/v1/market-signals?ticker=NVDA",
                        "schema": "https://secedgarterminal.com/schemas/market-signals-v1.schema.json",
                        "company_analysis": "https://secedgarterminal.com/analysis/NVDA",
                        "sec_companyfacts": "https://data.sec.gov/api/xbrl/companyfacts/CIK0001045810.json"
                      },
                      "cite_as": "Illustrative format example, not a live result."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/ErrorResponse"
          },
          "422": {
            "$ref": "#/components/responses/ErrorResponse"
          },
          "429": {
            "description": "Rate limit exceeded. Respect Retry-After before retrying.",
            "headers": {
              "Retry-After": {
                "description": "Seconds until this client should retry.",
                "schema": { "type": "integer", "minimum": 1 }
              },
              "RateLimit-Limit": { "$ref": "#/components/headers/RateLimitLimit" },
              "RateLimit-Remaining": { "$ref": "#/components/headers/RateLimitRemaining" },
              "RateLimit-Reset": { "$ref": "#/components/headers/RateLimitReset" }
            },
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/RateLimitError" }
              }
            }
          },
          "502": {
            "$ref": "#/components/responses/ErrorResponse"
          },
          "503": {
            "$ref": "#/components/responses/ErrorResponse"
          }
        }
      }
    }
  },
  "components": {
    "headers": {
      "RateLimitLimit": {
        "description": "Weighted quota units in the current fixed window.",
        "schema": { "type": "integer", "minimum": 0 }
      },
      "RateLimitRemaining": {
        "description": "Weighted quota units remaining in the current fixed window.",
        "schema": { "type": "integer", "minimum": 0 }
      },
      "RateLimitReset": {
        "description": "Seconds until the current fixed window resets.",
        "schema": { "type": "integer", "minimum": 1 }
      }
    },
    "responses": {
      "ErrorResponse": {
        "description": "Versioned error response. Retry only when retryable is true, and always respect Retry-After on HTTP 429.",
        "headers": {
          "RateLimit-Limit": { "$ref": "#/components/headers/RateLimitLimit" },
          "RateLimit-Remaining": { "$ref": "#/components/headers/RateLimitRemaining" },
          "RateLimit-Reset": { "$ref": "#/components/headers/RateLimitReset" }
        },
        "content": {
          "application/json": {
            "schema": { "$ref": "#/components/schemas/Error" }
          }
        }
      }
    },
    "schemas": {
      "Error": {
        "type": "object",
        "required": ["schema_version", "error", "code", "retryable", "links"],
        "properties": {
          "schema_version": { "type": "string", "const": "edgar.market-signals.v1" },
          "error": { "type": "string" },
          "code": { "type": "string" },
          "details": { "type": ["object", "array", "string", "number", "boolean", "null"] },
          "retryable": { "type": "boolean" },
          "links": {
            "type": "object",
            "required": ["methodology", "schema"],
            "properties": {
              "methodology": { "type": "string", "format": "uri" },
              "schema": { "type": "string", "format": "uri" }
            },
            "additionalProperties": true
          }
        },
        "additionalProperties": true
      },
      "RateLimitError": {
        "type": "object",
        "required": ["error"],
        "properties": {
          "error": { "type": "string" }
        },
        "additionalProperties": true
      }
    }
  }
}
