{
  "openapi": "3.1.0",
  "info": {
    "title": "NERexchange API",
    "version": "1.0.0",
    "description": "Live named-entity attention index built from public news headlines.\n\nPublic, keyless, read-only GET endpoints with `Access-Control-Allow-Origin: *`. Saga Dog Corp \u00b7 Research-driven AI from Miami.",
    "contact": {
      "name": "Saga Dog Corp",
      "url": "https://ecoquipr.com"
    }
  },
  "servers": [
    {
      "url": "https://nerexchange.vercel.app"
    }
  ],
  "paths": {
    "/api/tape": {
      "get": {
        "summary": "Entity attention tape",
        "description": "Named entities most mentioned in live public RSS headlines (BBC, NPR, Google News, Al Jazeera). Falls back to labeled sample data if feeds fail. Not financial data.",
        "parameters": [
          {
            "name": "mode",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "sample"
              ]
            },
            "description": "`sample` forces the labeled sample tape."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Tape"
                }
              }
            }
          }
        }
      }
    },
    "/api/leaderboard": {
      "get": {
        "summary": "NER benchmark leaderboard",
        "description": "Published CoNLL-2003 English test F1 scores as reported by each paper's authors.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Leaderboard"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Tape": {
        "type": "object",
        "properties": {
          "mode": {
            "type": "string",
            "enum": [
              "live",
              "sample"
            ]
          },
          "ts": {
            "type": "number",
            "description": "Unix seconds"
          },
          "headlines": {
            "type": "integer"
          },
          "feeds_ok": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "feeds_failed": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "rows": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TapeRow"
            }
          },
          "prev_ts": {
            "type": [
              "number",
              "null"
            ]
          },
          "cached": {
            "type": "boolean"
          }
        },
        "required": [
          "mode",
          "ts",
          "headlines",
          "feeds_ok",
          "feeds_failed",
          "rows",
          "cached"
        ]
      },
      "TapeRow": {
        "type": "object",
        "properties": {
          "symbol": {
            "type": "string",
            "examples": [
              "ORG.TESL"
            ]
          },
          "name": {
            "type": "string"
          },
          "type": {
            "type": "string",
            "enum": [
              "PER",
              "ORG",
              "LOC",
              "MISC"
            ]
          },
          "price": {
            "type": "number",
            "description": "Attention index 0-100 from mention counts. Not a financial price."
          },
          "chg": {
            "type": "number",
            "description": "Change vs previous refresh (0 when no previous refresh)."
          },
          "mentions": {
            "type": "integer"
          },
          "sources": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "headline": {
            "type": "string"
          },
          "link": {
            "type": "string"
          }
        },
        "required": [
          "symbol",
          "name",
          "type",
          "price",
          "chg",
          "mentions",
          "sources",
          "headline",
          "link"
        ]
      },
      "Leaderboard": {
        "type": "object",
        "properties": {
          "benchmark": {
            "type": "string"
          },
          "rows": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LeaderboardRow"
            }
          }
        },
        "required": [
          "benchmark",
          "rows"
        ]
      },
      "LeaderboardRow": {
        "type": "object",
        "properties": {
          "ticker": {
            "type": "string"
          },
          "model": {
            "type": "string"
          },
          "f1": {
            "type": "number"
          },
          "year": {
            "type": "integer"
          },
          "cite": {
            "type": "string"
          },
          "url": {
            "type": "string"
          },
          "rank": {
            "type": "integer"
          }
        },
        "required": [
          "ticker",
          "model",
          "f1",
          "year",
          "cite",
          "url",
          "rank"
        ]
      }
    }
  }
}