Polity Atlas
构建 · 开放 API v1

API 与开放数据

每个实体、论断、来源和实验都以结构化数据的形式提供。读取无需密钥;速率限制较为宽松。

基础 URLhttps://polityatlas.org/api/v1
许可协议内容 CC BY-SA 4.0 · 数据 ODbL

身份验证

读取为匿名方式。写入使用 Django 会话 Cookie:先请求一次 GET /auth/csrf,然后在 POST、PATCH 和 DELETE 请求中以 X-CSRFToken 发送该令牌,并附带凭据。

分页与错误

列表接受 page 和 page_size 参数,并返回 {"items", "count", "page", "page_size"}。错误始终为 {"detail": "…"},并附带有意义的状态码(400、401、403、404、409、422、429)。

本地化

添加 ?lang=ru(或发送 Accept-Language)即可获取俄文字段;缺失的翻译将回退为英文。

GET

/entities/{slug}

返回一个实体,包括按类型分组的关系、附有证据和来源的论断,以及评估。

curl "https://polityatlas.org/api/v1/entities/polycentric-law?lang=zh"
响应 · 200
{
  "id": 11,
  "slug": "polycentric-law",
  "kind": "concept",
  "title": "Polycentric law",
  "summary": "Several coexisting centres of rule-making and dispute resolution.",
  "review_state": "published",
  "last_verified_at": "2026-10-02T00:00:00Z",
  "relations": [
    {
      "type": "implements",
      "direction": "incoming",
      "label": "implemented by",
      "items": [{ "entity": { "slug": "arbitration", "kind": "mechanism" } }]
    }
  ],
  "claims": [{
    "id": 318,
    "text": "…",
    "epistemic_status": "disputed",
    "verification_status": "verified",
    "evidence": [{ "stance": "supports", "source": { "id": 41 } }]
  }]
}

知识

GET/entities筛选:kind、theme、tag、q
GET/entities/{slug}含关系、论断与评估的实体
GET/entities/{slug}/graph自我网络,深度 1–2
GET/graph完整的已发布图谱;kinds、theme
GET/claims/{id}论断、证据、来源与未决争议
GET/sources筛选:type、q、primary
GET/glossary术语;letter、q
GET/searchq、kind、mode=keyword|semantic
POST/ask仅基于已发布论断生成的回答

活的图谱

GET/experiments筛选,含 bbox、autonomy、uses_ai
GET/experiments/geojsonGeoJSON FeatureCollection
GET/experiments/network网络政治共同体与共享机制
GET/experiments/facets各分面取值的计数

比较器与观察站

GET/criteria评估标准
POST/explorer/compare基于已知标准的加权比较
GET/observatorykind:signal、news、research、briefing
GET/scenarios驱动因素、指标与文字表述的可能性

Polity Lab

GET/lab/options配置维度与压力情景
POST/lab/projects/{id}/analyze基于规则的一致性分析
GET/repository/components带版本管理的制度组件
GET/export/entities.jsonl批量导出,JSON Lines

本体

所有记录使用的词汇表。编辑可从 /cp/ontology 获取完整模式,包括属性定义。

实体类型概念concept机制mechanism理论theory思想家thinker实验experiment制度类型institution_type意识形态ideologyorganisationorganisation
关系类型实践implements检验于tested_in提出者proposed_by影响了influenced批评criticises替代方案alternative_to属于part_of使用机制uses_mechanism相关于related_to
认知状态已确立established理论theory有争议disputed假说hypothesis预测forecast
核实状态未核实unverifiedAI 起草ai_drafted审核中in_review已核实verified已驳回rejected
批量导出完整图谱以 JSON Lines 格式提供,每晚刷新。
GET /export/entities.jsonl