科研项目
概览
NIH、NSF 与 CORDIS 立项:谁拿了什么钱做什么,带摘要与金额。
- 状态
- live
- 文档 id
grant_id如nih:R25HG007515- 引用格式
[NIH R25HG007515]- 更新于
- 2026-10
常用调用
找资助
POST /v1/grants/search {"query": "单细胞转录组", "filters": {"agency": "nih", "fy": {"gte": 2020}}}读一项
GET /v1/grants/read/nih:R25HG007515 → 摘要、主题、方法、逐年金额、机构与 PI看某机构/学部的量
GET /v1/grants/facets?field=ic_or_directorate细则
- NIH 一篇 = 一个核心项目号的全部年度拨款(amount_total 是合计,funding_by_year 是逐年);NSF 一篇 = 一个 award;CORDIS 一篇 = 一个项目(grant_id = cordis:<项目号>),org_* 是牵头单位,amount_total 是欧盟出资、单位欧元(level=head 的 currency=EUR,NIH / NSF 没有这个字段,都是美元)。
- org_country 大小写不统一(UNITED STATES 与 United States 并存,共 108.8 万项),按国家筛要把两种都列上。
- topics 是开放标签、基数上万,适合看不适合筛;按领域筛用 research_domain。
- 没有摘要的项目一句话只凭标题生成,_enrich.basis=title_only。
- 检索库里没有正文:level=full 暂不可用(摘要已在 level=detail;项目报告与出版物不在本库)。
检索
POST
/v1/grants/search混合检索,每条命中一张卡片。2 credits。免费样例:
single cell transcriptomics。过滤字段
| 字段 | 类型 · op | 含义 |
|---|---|---|
| agency | keyword · eq anynih · nsf · cordis | 资助机构 |
| research_domain | keyword · eq anybiomedical · life_sciences · clinical · public_health · engineering · physical_sciences …共 13 个,/facets 可列全 | 研究领域(模型归类,闭集 13 类) |
| ic_or_directorate | keyword · eq any | NIH 研究所 / NSF 学部 / CORDIS 框架计划(FP7 / H2020 / HORIZON …,见 facets) |
| activity_code | keyword · eq any | 资助机制:NIH 活动代码(R01 / R21 / F32 …)、NSF 奖励类型或 CORDIS fundingScheme |
| fy | integer · eq range | 财年区间 |
| start_year | integer · eq range | 项目开始年份区间 |
| end_year | integer · eq range | 项目结束年份区间 |
| amount_total | number · eq range | 总金额区间(NIH / NSF 为美元,CORDIS 为欧盟出资、欧元;跨机构按金额筛请同时带 agency) |
| org_country | keyword · eq any | 承担机构所在国(源数据大小写不统一,见 notes) |
还有 7 个,照样能用
| 字段 | 类型 · op | 含义 |
|---|---|---|
| org_state | keyword · eq any | 美国州 |
| org_name | keyword · eq any | 承担机构名(精确) |
| pi_names | keyword · eq any | PI 姓名(源数据写法,NIH 是 姓, 名) |
| topics | keyword · eq any | 研究主题(模型生成的开放标签,基数很大) |
| programs | keyword · eq any | 项目/计划名 |
| core_project_num | keyword · eq any | NIH 核心项目号 |
| is_renewal | bool · eq | 是否续期 |
参数
| 参数 | 类型 | 说明 |
|---|---|---|
| query 必填 | string | 1–1000 字符。也可以是最多 5 条的数组(批量,hits 变 results[])。 |
| top_k | integer= 10 | 1–100。 |
| fields | brief · head= brief | head 多扣 1 credit,每条附 head 视图。 |
| filters | json | 过滤 DSL 对象(见快速开始);可用字段见上表。 |
| mode | hybrid · dense · bm25= hybrid | 检索模式。不传就用第一个。 |
| offset | integer= 0 | 翻页。 |
示例
{ "domain": "grants", "query": "…", "hits": [ { "id": "nih:R25HG007515", "score": 0.83, "brief": { … } } ], "total": null, "coverage": …, "warnings": [],
"meta": { "request_id": "req_…", "credits": { "charged": 2, "balance": 1998, "pool": "allowance" }, "latency_ms": 41, "cached": false } } 两层。1,328,138 篇有向量,背后的全量库有 1,313,241 篇。命中带
layer: index | pg——pg 表示按词面匹配而非语义——coverage 说明这次由哪层作答(answered_by)以及为什么没有回落(no_fallback_because)。只属于某一层的过滤字段不能混用,400 会告诉你哪个字段属于哪层。用了未声明的过滤字段返回 400,不会静默忽略。过滤条件是 AND;可用
_or / _not。读
GET
/v1/grants/read/{grant_id}三档深浅,不传就是
detail。免费样例:nih:R25HG007515。三档
| 深浅 | credits | 返回 |
|---|---|---|
| brief | 1 | 卡片:做取舍够用的字段(检索结果里那张) |
| detail (默认) | 2 | 全部结构化字段(规则字段 + 模型字段,模型字段在 _enrich.fields 里列名) |
| full | 5 | 全文(建设中:摘要已在 level=detail;项目报告与出版物不在本库) |
参数
| 参数 | 类型 | 说明 |
|---|---|---|
| grant_id (path) 必填 | string | 文档 id(grant_id)。 |
| level | brief · detail · full= detail | 读多深。 |
| format | json · md · html= json | 响应形态。 |
示例
{ "domain": "grants", "id": "nih:R25HG007515", "level": "detail", "view": "head", "data": { … } | "text": "…", "token_count": 1834, "meta": { … } } 旧写法
GET /v1/grants/doc/{id}?view=… 仍然可用。批量读
POST
/v1/grants/read最多 50 个 id,同一档。查不到的 id 返回
error: "not_found",不扣费。参数
| 参数 | 类型 | 说明 |
|---|---|---|
| ids 必填 | string[] | 文档 id 列表。 |
| level | brief · detail · full= detail | 所有 id 共用的档。 |
示例
{ "domain": "grants", "level": "detail", "docs": [ { "id": "…", "data": { … } }, { "id": "…", "error": "not_found" } ], "meta": { … } } Facets
GET
/v1/grants/facets?field={field}某个过滤字段的合法值,agent 不用猜;预聚合字段带计数,声明的枚举没有。免费、不需要 key。
参数
| 参数 | 类型 | 说明 |
|---|---|---|
| field 必填 | agency · research_domain · ic_or_directorate · activity_code · org_country · org_state | 有 facets 的过滤字段。 |
| limit | integer= 50 | 最多返回多少个值。 |
示例
{ "domain": "grants", "field": "…", "values": [ { "value": "…", "count": 3120 } ], "meta": { … } } 问registered key+ /stream
POST
/v1/grants/ask本域的 agentic 问答:模型按自描述把问题翻成检索(筛选 + 关键词),读详情后作答,引用写成 [grants: <标题>];/stream 为 NDJSON,answer_delta 是边生成边发的真实片段。
effort low / medium / high 对应 50 / 100 / 200 credits。加 /stream 走 NDJSON,第一个事件一定是 billing。首个 answer_delta 之前失败会退款。参数
| 参数 | 类型 | 说明 |
|---|---|---|
| query 必填 | string | 1–2000 字符。问得具体;要数字就直接问数字。 |
| effort | low · medium · high= low | 检索轮数,也决定价格:50 / 100 / 200 credits。套餐限制最高档。 |
| verbose | bool= false | 返回工具调用轨迹(流式时多 tool_call / tool_result / thinking 事件)。 |
| top_k | integer= 10 | 预取候选数。 |
| stream_answer | bool= true | 仅流式:false 时只发一个 answer 事件。 |
| max_rounds | integer | 0–8,覆盖 effort 预设。 |
| force_answer_after | number | 秒;强制切入作答阶段。 |
| max_answer_tokens | integer= 4096 | 触顶时置 answer_truncated。 |
| language | string | 回答语言,默认跟随 query。 |
示例
{ "answer": "… [NIH R25HG007515] …", "sources": [ … ], "stats": { "rounds": 1, "elapsed_s": 6.2, "answer_truncated": false }, "coverage"?: { … }, "meta": { "credits": { "charged": 50, … } } } 引用是真的——
answer 里的每个 id 都存在于本垂域(格式 [NIH R25HG007515])。sources 是召回集,不是引用列表。answer_truncated 表示不完整。