{
  "openapi": "3.1.0",
  "jsonSchemaDialect": "https://json-schema.org/draft/2020-12/schema",
  "info": {
    "title": "OnCo Open API",
    "version": "1.0.0",
    "summary": "The OnCo oncology knowledge graph as static files.",
    "description": "OnCo is a public, cited knowledge graph of oncology: 10,779 records in 18 kinds, one page per object, each with a plain-English TL;DR, a technical summary, dated facts and links to primary sources.\n\nEvery file here is written at build time and served from the CDN: no authentication, no rate limit beyond the CDN, permissive CORS. Files are regenerated on every deploy; meta.json carries the build time so clients can cache on it.\n\nField names and enums come from the Zod schema in src/lib/schema.ts in the repository. The Entity schema below points at /api/v1/schema.json, which is generated from that file, so the two cannot drift.\n\nKinds:\n- cancers (108): One page per disease: state of the art, history, and what is coming.\n- fronts (19): The fronts of the war on cancer: from imaging and early detection to ADCs, radiopharma, and cell therapy.\n- technologies (457): Every way we see, measure, or attack a tumour, explained.\n- targets (162): The molecules drugs and tracers aim at.\n- drugs (1014): Approved and pipeline products, with what they hit and who makes them.\n- companies (994): Who is building what.\n- institutions (668): The centres and universities that matter, mapped and ranked.\n- pathways (107): The classic signalling circuits, drawn and explained.\n- terms (602): Glossary with plain-English TL;DRs and Wikipedia links.\n- trials (3326): Landmark and current trials that define the standard of care.\n- pairings (85): Things that work better together, and things that do not.\n- roadmaps (29): Where a technology has been and where it is heading.\n- ideas (1139): Hypotheses and new directions, linked to the evidence.\n- collections (92): The open databases and registries the field runs on.\n- people (1434): The clinicians and scientists doing the work: specialisms, bios, papers, and where to find them.\n- bottlenecks (45): The systemic constraints slowing the whole war on cancer, with the ideas that could break each one.\n- key papers (239): The papers that changed practice or thinking, each explained: what it found, what it means, and what to be careful about.\n- journals (259): Where the evidence is published: the journals, their scope and access model, and the key papers each one carried.\n\nLicence: code MIT; data CC BY-NC 4.0, free for individual and educational use with attribution (\"Data from OnCo (onco.cc)\" with a link to https://onco.cc); commercial use must contact OnCo to pay for the data. Nothing here is medical advice: facts may be incomplete or out of date, verify at the primary source each record links.\n\nDescription generated on 2026-09-16 from scripts/api-layout.ts.",
    "termsOfService": "https://onco.cc/about/#licence",
    "contact": {
      "name": "OnCo on GitHub",
      "url": "https://github.com/judegomila/OnCo/issues"
    },
    "license": {
      "name": "CC BY-NC 4.0 (data); MIT (code)",
      "url": "https://creativecommons.org/licenses/by-nc/4.0/"
    }
  },
  "externalDocs": {
    "description": "Endpoint list with live links, recipes and the MCP server",
    "url": "https://onco.cc/build/"
  },
  "servers": [
    {
      "url": "https://onco.cc",
      "description": "Production"
    }
  ],
  "tags": [
    {
      "name": "corpus",
      "description": "The records, under /api/v1/"
    },
    {
      "name": "feeds",
      "description": "Atom and iCalendar feeds for what changes"
    },
    {
      "name": "site",
      "description": "Discovery files for crawlers and language models"
    }
  ],
  "paths": {
    "/api/v1/meta.json": {
      "get": {
        "operationId": "getMeta",
        "summary": "Build date, counts per kind, licence and the list of files",
        "tags": [
          "corpus"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Meta"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/openapi.json": {
      "get": {
        "operationId": "getOpenApi",
        "summary": "This description",
        "tags": [
          "corpus"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/schema.json": {
      "get": {
        "operationId": "getSchema",
        "summary": "JSON Schema (draft 2020-12) of one entity, generated from the Zod schema that validates the corpus",
        "tags": [
          "corpus"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/schema+json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/all.json": {
      "get": {
        "operationId": "getAll",
        "summary": "Every entity plus a backlink map",
        "tags": [
          "corpus"
        ],
        "description": "Several megabytes. Prefer the per-kind files unless you need the whole graph.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "entities",
                    "incoming"
                  ],
                  "properties": {
                    "entities": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Entity"
                      }
                    },
                    "incoming": {
                      "type": "object",
                      "description": "For each id, the entities that link to it.",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "$ref": "#/components/schemas/EntityRef"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/all.ndjson": {
      "get": {
        "operationId": "getAllNdjson",
        "summary": "Every entity, one JSON object per line, each with its site route",
        "tags": [
          "corpus"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/x-ndjson": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/search.json": {
      "get": {
        "operationId": "getSearchDocs",
        "summary": "Compact search documents (id, kind, name, TL;DR, route)",
        "tags": [
          "corpus"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/SearchDoc"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/similar.json": {
      "get": {
        "operationId": "getSimilar",
        "summary": "Up to eight similar records per id, with the links they share",
        "tags": [
          "corpus"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "required": [
                        "id"
                      ],
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "kind": {
                          "$ref": "#/components/schemas/Kind"
                        },
                        "score": {
                          "type": "number"
                        },
                        "shared": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "additionalProperties": true
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/embeddings.json": {
      "get": {
        "operationId": "getEmbeddings",
        "summary": "The concept-search index: ids, vocabulary and idf weights; the sparse unit vectors are in embeddings.bin",
        "tags": [
          "corpus"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/ask-index.json": {
      "get": {
        "operationId": "getAskIndex",
        "summary": "Names, aliases and curated question pairs used by Ask OnCo, the CLI and the MCP server",
        "tags": [
          "corpus"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/onco.nt": {
      "get": {
        "operationId": "getTriples",
        "summary": "The graph as RDF N-Triples using schema.org terms, with owl:sameAs links to Wikidata",
        "tags": [
          "corpus"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/n-triples": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/ranking.json": {
      "get": {
        "operationId": "getRanking",
        "summary": "Institution ranking rows with the score components",
        "tags": [
          "corpus"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/RankingRow"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/benchmark.json": {
      "get": {
        "operationId": "getBenchmark",
        "summary": "The open evaluation question set",
        "tags": [
          "corpus"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "additionalProperties": true
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/{plural}.json": {
      "get": {
        "operationId": "listKind",
        "summary": "All entities of one kind",
        "tags": [
          "corpus"
        ],
        "parameters": [
          {
            "name": "plural",
            "in": "path",
            "required": true,
            "description": "The plural name of the kind, as used in the file name.",
            "schema": {
              "type": "string",
              "enum": [
                "cancers",
                "fronts",
                "technologies",
                "targets",
                "drugs",
                "companies",
                "institutions",
                "pathways",
                "terms",
                "trials",
                "pairings",
                "roadmaps",
                "ideas",
                "collections",
                "people",
                "bottlenecks",
                "key papers",
                "journals"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Entity"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/{plural}.csv": {
      "get": {
        "operationId": "listKindCsv",
        "summary": "All entities of one kind as CSV: scalars as-is, arrays joined with '; ', nested records as JSON; the first line is a licence comment",
        "tags": [
          "corpus"
        ],
        "parameters": [
          {
            "name": "plural",
            "in": "path",
            "required": true,
            "description": "The plural name of the kind, as used in the file name.",
            "schema": {
              "type": "string",
              "enum": [
                "cancers",
                "fronts",
                "technologies",
                "targets",
                "drugs",
                "companies",
                "institutions",
                "pathways",
                "terms",
                "trials",
                "pairings",
                "roadmaps",
                "ideas",
                "collections",
                "people",
                "bottlenecks",
                "key papers",
                "journals"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/csv": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/entities/{id}.json": {
      "get": {
        "operationId": "getEntity",
        "summary": "One entity with its site route and its neighbours grouped by kind",
        "tags": [
          "corpus"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Kebab-case entity id, for example tnbc, trop2 or trastuzumab-deruxtecan.",
            "schema": {
              "type": "string",
              "pattern": "^[a-z0-9]+(-[a-z0-9]+)*$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EntityResponse"
                }
              }
            }
          },
          "404": {
            "description": "No such id; the CDN returns the site's 404 page."
          }
        }
      }
    },
    "/api/v1/context/{id}.md": {
      "get": {
        "operationId": "getContext",
        "summary": "One entity as clean Markdown for language models: TL;DR, summary, fields, sources and connected records",
        "tags": [
          "corpus"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[a-z0-9]+(-[a-z0-9]+)*$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/markdown": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "description": "No such id."
          }
        }
      }
    },
    "/api/v1/context/index.md": {
      "get": {
        "operationId": "getContextIndex",
        "summary": "Index of every Markdown context file with the record's TL;DR",
        "tags": [
          "corpus"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/markdown": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/llms.txt": {
      "get": {
        "operationId": "getLlmsTxt",
        "summary": "llms.txt: what the site is, the licence and the best entry points, for language models",
        "tags": [
          "site"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/llms-full.txt": {
      "get": {
        "operationId": "getLlmsFullTxt",
        "summary": "llms-full.txt: every record on one line with its TL;DR and the URL of its context file",
        "tags": [
          "site"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/sitemap.xml": {
      "get": {
        "operationId": "getSitemap",
        "summary": "Sitemap of every page",
        "tags": [
          "site"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/xml": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/feeds/{feed}.xml": {
      "get": {
        "operationId": "getFeed",
        "summary": "Atom feeds: changelog, regulatory events, readout calendar, research pulse",
        "tags": [
          "feeds"
        ],
        "parameters": [
          {
            "name": "feed",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "changelog",
                "regulatory",
                "calendar",
                "pulse"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/atom+xml": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/newsletter/feed.xml": {
      "get": {
        "operationId": "getNewsletterFeed",
        "summary": "Atom feed of the weekly issue: what changed, regulatory events, upcoming readouts, what the journals said",
        "tags": [
          "feeds"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/atom+xml": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/catalysts/feed.ics": {
      "get": {
        "operationId": "getCatalystFeed",
        "summary": "iCalendar feed of regulatory decisions, expected readouts and congresses",
        "tags": [
          "feeds"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/calendar": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Kind": {
        "type": "string",
        "enum": [
          "cancer",
          "section",
          "technology",
          "target",
          "drug",
          "company",
          "institution",
          "pathway",
          "term",
          "trial",
          "pairing",
          "roadmap",
          "idea",
          "collection",
          "person",
          "bottleneck",
          "paper",
          "journal"
        ],
        "description": "cancer: cancers; section: fronts; technology: technologies; target: targets; drug: drugs; company: companies; institution: institutions; pathway: pathways; term: terms; trial: trials; pairing: pairings; roadmap: roadmaps; idea: ideas; collection: collections; person: people; bottleneck: bottlenecks; paper: key papers; journal: journals"
      },
      "Status": {
        "type": "string",
        "enum": [
          "approved",
          "phase-3",
          "phase-2",
          "phase-1",
          "preclinical",
          "concept",
          "standard-of-care",
          "established",
          "emerging",
          "historic",
          "withdrawn",
          "active",
          "completed",
          "recruiting",
          "positive",
          "negative",
          "mixed",
          "planned"
        ]
      },
      "EntityRef": {
        "type": "object",
        "required": [
          "id",
          "kind"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "kind": {
            "$ref": "#/components/schemas/Kind"
          }
        }
      },
      "NeighbourRef": {
        "type": "object",
        "required": [
          "id",
          "kind",
          "name",
          "route"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "kind": {
            "$ref": "#/components/schemas/Kind"
          },
          "name": {
            "type": "string"
          },
          "route": {
            "type": "string",
            "description": "Site-relative URL of the entity page, for example /targets/trop2/."
          }
        }
      },
      "Entity": {
        "$ref": "https://onco.cc/api/v1/schema.json",
        "description": "One record. The full schema (shared and kind-specific fields) is the generated JSON Schema at /api/v1/schema.json."
      },
      "EntityResponse": {
        "type": "object",
        "required": [
          "entity",
          "route",
          "neighbours"
        ],
        "properties": {
          "entity": {
            "$ref": "#/components/schemas/Entity"
          },
          "route": {
            "type": "string"
          },
          "neighbours": {
            "type": "object",
            "description": "Outgoing plus incoming neighbours, keyed by kind.",
            "additionalProperties": {
              "type": "array",
              "items": {
                "$ref": "#/components/schemas/NeighbourRef"
              }
            }
          }
        }
      },
      "SearchDoc": {
        "type": "object",
        "required": [
          "id",
          "kind",
          "name",
          "tldr",
          "route"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "kind": {
            "$ref": "#/components/schemas/Kind"
          },
          "name": {
            "type": "string"
          },
          "tldr": {
            "type": "string"
          },
          "route": {
            "type": "string"
          },
          "status": {
            "$ref": "#/components/schemas/Status"
          }
        },
        "additionalProperties": true
      },
      "RankingRow": {
        "type": "object",
        "required": [
          "rank",
          "id",
          "name",
          "score"
        ],
        "properties": {
          "rank": {
            "type": "integer"
          },
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "city": {
            "type": "string"
          },
          "country": {
            "type": "string",
            "description": "ISO 3166-1 alpha-2"
          },
          "newsweekOncology2026": {
            "type": [
              "integer",
              "null"
            ]
          },
          "nci": {
            "type": [
              "string",
              "null"
            ]
          },
          "links": {
            "type": "integer"
          },
          "newsweekPoints": {
            "type": "integer"
          },
          "nciPoints": {
            "type": "integer"
          },
          "linkPoints": {
            "type": "integer"
          },
          "score": {
            "type": "integer"
          }
        }
      },
      "Meta": {
        "type": "object",
        "required": [
          "built",
          "schema",
          "counts",
          "total",
          "license",
          "attribution",
          "files"
        ],
        "properties": {
          "built": {
            "type": "string",
            "format": "date-time"
          },
          "schema": {
            "type": "integer"
          },
          "version": {
            "type": [
              "string",
              "null"
            ]
          },
          "attribution": {
            "type": "string",
            "examples": [
              "Data from OnCo (https://onco.cc), CC BY-NC 4.0. Free for individual and educational use with attribution: name OnCo and link to https://onco.cc wherever the data or derived text appears. Commercial use must contact OnCo to pay for the data (https://onco.cc/about/#licence)."
            ]
          },
          "licenseUrl": {
            "type": "string",
            "format": "uri"
          },
          "license": {
            "type": "string",
            "examples": [
              "CC BY-NC 4.0"
            ]
          },
          "source": {
            "type": "string",
            "format": "uri"
          },
          "total": {
            "type": "integer"
          },
          "counts": {
            "type": "object",
            "properties": {
              "cancer": {
                "type": "integer"
              },
              "section": {
                "type": "integer"
              },
              "technology": {
                "type": "integer"
              },
              "target": {
                "type": "integer"
              },
              "drug": {
                "type": "integer"
              },
              "company": {
                "type": "integer"
              },
              "institution": {
                "type": "integer"
              },
              "pathway": {
                "type": "integer"
              },
              "term": {
                "type": "integer"
              },
              "trial": {
                "type": "integer"
              },
              "pairing": {
                "type": "integer"
              },
              "roadmap": {
                "type": "integer"
              },
              "idea": {
                "type": "integer"
              },
              "collection": {
                "type": "integer"
              },
              "person": {
                "type": "integer"
              },
              "bottleneck": {
                "type": "integer"
              },
              "paper": {
                "type": "integer"
              },
              "journal": {
                "type": "integer"
              }
            },
            "additionalProperties": {
              "type": "integer"
            }
          },
          "files": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "path",
                "contents"
              ],
              "properties": {
                "path": {
                  "type": "string"
                },
                "contents": {
                  "type": "string"
                }
              }
            }
          },
          "feeds": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "releases": {
            "type": "string",
            "format": "uri"
          },
          "openapi": {
            "type": "string"
          }
        }
      }
    }
  }
}