mcpField
O
openalex-paper-search

openalex-paper-search

github.com/kortix-ai生产力8440 次安装35 周前更新
代码仓库

关于 openalex-paper-search

openalex-paper-search 是通过 OpenAlex REST API 查询学术作品及相关实体的研究技能。它使用 URL 构造请求,涵盖筛选、引用关系图、作者查询和结果处理,无需 API 密钥或 SDK。

主要功能

  1. 01关键词与布尔论文搜索
  2. 02筛选、排序和分页结果
  3. 03遍历引用关系
  4. 04搜索作者及外部 ID
  5. 05选择字段并还原摘要

适用场景

  1. 01调研某个主题的论文
  2. 02查找近期或高引用作品
  3. 03追踪参考文献和引用论文
  4. 04整理作者的发表记录

安装

复制下面的命令,在终端中运行。

$npx skills add https://github.com/kortix-ai/kortix-registry --skill openalex-paper-search

安装后在 Claude Code 中输入/openalex-paper-search确认已加载。

详细介绍

学术论文搜索(OpenAlex)

通过 OpenAlex API 搜索 2.4 亿多篇学术作品——完全免费,无需 API 密钥,也无需 SDK。只需使用 curl 或 bash 构造 URL。

完整文档: https://docs.openalex.org

快速开始

OpenAlex 是一个 REST API。通过构造 URL 并使用 curl 获取数据来发起查询。所有响应均为 JSON。

# Search for papers about "transformer architecture"
curl -s "https://api.openalex.org/works?search=transformer+architecture&per_page=5&[email protected]" | python3 -m json.tool

重要提示: 每次请求都必须包含 [email protected](或任何有效的电子邮件地址)。否则,每秒只能发送 1 个请求。包含该参数后,每秒可发送 10 个请求(“礼貌池”)。

核心概念

实体

OpenAlex 包含以下实体类型(均可查询):

实体端点数量描述
作品/works2.4 亿+论文、文章、书籍、数据集、学位论文
作者/authors9000 万+创作作品的人
来源/sources25 万+期刊、知识库、会议
机构/institutions11 万+大学、研究机构
主题/topics4000+研究主题(分层级)
作品对象——关键字段

获取作品时,以下字段最实用:

id                        OpenAlex ID (e.g., "https://openalex.org/W2741809807")
doi                       DOI URL
title / display_name      Paper title
publication_year          Year published
publication_date          Full date (YYYY-MM-DD)
cited_by_count            Number of incoming citations
fwci                      Field-Weighted Citation Impact (normalized)
type                      article, preprint, review, book, dataset, etc.
language                  ISO 639-1 code (e.g., "en")
is_retracted              Boolean
open_access.is_oa         Boolean -- is it freely accessible?
open_access.oa_url        Direct URL to free version
authorships               List of authors with names, institutions, ORCIDs
abstract_inverted_index   Abstract as inverted index (needs reconstruction)
referenced_works          List of OpenAlex IDs this work cites (outgoing)
related_works             Algorithmically related works
cited_by_api_url          API URL to get works that cite this one (incoming)
topics                    Assigned research topics with scores
keywords                  Extracted keywords with scores
primary_location          Where the work is published (journal, repo)
best_oa_location          Best open access location with PDF link
重构摘要

出于法律原因,OpenAlex 将摘要存储为倒排索引。要获取纯文本,请按以下方式重构:

import json, sys
# Read the abstract_inverted_index from a work object
inv_idx = work["abstract_inverted_index"]
if inv_idx:
    words = [""] * (max(max(positions) for positions in inv_idx.values()) + 1)
    for word, positions in inv_idx.items():
        for pos in positions:
            words[pos] = word
    abstract = " ".join(words)

也可以在 bash 中使用 python3 -c:

# Pipe a work JSON into this to extract the abstract
echo "$WORK_JSON" | python3 -c "
import json,sys
w=json.load(sys.stdin)
idx=w.get('abstract_inverted_index',{})
if idx:
    words=['']*( max(max(p) for p in idx.values())+1 )
    for word,positions in idx.items():
        for pos in positions: words[pos]=word
    print(' '.join(words))
"

搜索论文

基本关键词搜索

搜索标题、摘要和全文。支持词干提取和停用词移除。

# Simple search
curl -s "https://api.openalex.org/works?search=large+language+models&[email protected]"

# With per_page limit
curl -s "https://api.openalex.org/works?search=CRISPR+gene+editing&per_page=10&[email protected]"
布尔搜索

使用大写的 AND、OR、NOT,并配合括号和带引号的短语:

# Complex boolean query
curl -s "https://api.openalex.org/works?search=(reinforcement+learning+AND+%22robot+control%22)+NOT+simulation&[email protected]"

# Exact phrase match (use double quotes, URL-encoded as %22)
curl -s "https://api.openalex.org/works?search=%22attention+is+all+you+need%22&[email protected]"
搜索特定字段
# Title only
curl -s "https://api.openalex.org/works?filter=title.search:transformer&[email protected]"

# Abstract only
curl -s "https://api.openalex.org/works?filter=abstract.search:protein+folding&[email protected]"

# Title and abstract combined
curl -s "https://api.openalex.org/works?filter=title_and_abstract.search:neural+scaling+laws&[email protected]"

# Fulltext search (subset of works)
curl -s "https://api.openalex.org/works?filter=fulltext.search:climate+tipping+points&[email protected]"

筛选

筛选器是最强大的功能。使用逗号(AND)或竖线(OR)组合筛选条件。

最实用的筛选器
# By publication year
?filter=publication_year:2024
?filter=publication_year:2020-2024
?filter=publication_year:>2022

# By citation count
?filter=cited_by_count:>100        # highly cited
?filter=cited_by_count:>1000       # landmark papers

# By open access
?filter=is_oa:true                 # only open access
?filter=oa_status:gold             # gold OA only

# By type
?filter=type:article               # journal articles
?filter=type:preprint              # preprints
?filter=type:review                # review articles

# By language
?filter=language:en                # English only

# Not retracted
?filter=is_retracted:false

# Has abstract
?filter=has_abstract:true

# Has downloadable PDF
?filter=has_content.pdf:true

# By author (OpenAlex ID)
?filter=author.id:A5023888391

# By institution (OpenAlex ID)
?filter=institutions.id:I27837315  # e.g., University of Michigan

# By DOI
?filter=doi:https://doi.org/10.1038/s41586-021-03819-2

# By indexed source
?filter=indexed_in:arxiv           # arXiv papers
?filter=indexed_in:pubmed          # PubMed papers
?filter=indexed_in:crossref        # Crossref papers
组合筛选器
# AND: comma-separated
?filter=publication_year:>2022,cited_by_count:>50,is_oa:true,type:article

# OR: pipe-separated within a filter
?filter=publication_year:2023|2024

# NOT: prefix with !
?filter=type:!preprint

# Combined example: highly-cited OA articles from 2023-2024, not preprints
curl -s "https://api.openalex.org/works?filter=publication_year:2023-2024,cited_by_count:>50,is_oa:true,type:!preprint&search=machine+learning&per_page=10&[email protected]"

排序

# Most cited first
?sort=cited_by_count:desc

# Most recent first
?sort=publication_date:desc

# Most relevant first (only when using search)
?sort=relevance_score:desc

# Multiple sort keys
?sort=publication_year:desc,cited_by_count:desc

分页

有两种模式:基本分页(用于浏览)和游标分页(用于收集所有结果)。

# Basic paging (limited to 10,000 results)
?page=1&per_page=25
?page=2&per_page=25

# Cursor paging (unlimited, for collecting everything)
?per_page=100&cursor=*                    # first page
?per_page=100&cursor=IlsxNjk0ODc...      # next page (cursor from previous response meta)

下一页的游标位于 response.meta.next_cursor 中。当它为 null 时,表示已到末尾。

选择字段

只选择所需字段,以减小响应体积:

# Only get IDs, titles, citation counts, and DOIs
?select=id,display_name,cited_by_count,doi,publication_year

# Minimal metadata for scanning
?select=id,display_name,publication_year,cited_by_count,open_access

引用图遍历

查找某篇论文引用的内容(出向引用)
# Get works cited BY a specific paper
curl -s "https://api.openalex.org/works?filter=cited_by:W2741809807&per_page=25&[email protected]"
查找引用某篇论文的内容(入向引用)
# Get works that CITE a specific paper
curl -s "https://api.openalex.org/works?filter=cites:W2741809807&sort=cited_by_count:desc&per_page=25&[email protected]"
查找相关作品
# Get related works (algorithmic, based on shared concepts)
curl -s "https://api.openalex.org/works?filter=related_to:W2741809807&per_page=25&[email protected]"
引用链:沿引用关系追踪
  1. 通过 DOI 获取一篇开创性论文
  2. 查找其 referenced_works(即它引用的作品)
  3. 查找引用它的作品(filter=cites:WORK_ID)
  4. 对引用量最高的作品,重复上述步骤

这就是围绕某个主题构建文献图谱的方法。

作者查询

# Search for an author
curl -s "https://api.openalex.org/authors?search=Yann+LeCun&[email protected]"

# Get an author's works (by OpenAlex author ID)
curl -s "https://api.openalex.org/works?filter=author.id:A5064850633&sort=cited_by_count:desc&per_page=10&[email protected]"

# Get an author by ORCID
curl -s "https://api.openalex.org/authors/orcid:[email protected]"

按外部 ID 查询

# By DOI
curl -s "https://api.openalex.org/works/doi:10.1038/[email protected]"

# By PubMed ID
curl -s "https://api.openalex.org/works/pmid:[email protected]"

# By arXiv ID (via DOI)
curl -s "https://api.openalex.org/works/doi:10.48550/[email protected]"

# Batch lookup: up to 50 IDs at once
curl -s "https://api.openalex.org/works?filter=doi:https://doi.org/10.1234/a|https://doi.org/10.1234/b|https://doi.org/10.1234/c&[email protected]"

开放获取与 PDF 访问

# Find OA papers with direct PDF links
curl -s "https://api.openalex.org/works?search=quantum+computing&filter=is_oa:true,has_content.pdf:true&select=id,display_name,open_access,best_oa_location&per_page=5&[email protected]"

best_oa_location.pdf_url 字段会在有可用链接时提供 PDF 直链。open_access.oa_url 则提供最佳的开放获取落地页或 PDF。

实用工作流

某个主题的文献综述
# 1. Find the most-cited papers on a topic
curl -s "https://api.openalex.org/works?search=retrieval+augmented+generation&sort=cited_by_count:desc&filter=publication_year:>2020,type:article,has_abstract:true&per_page=20&select=id,display_name,publication_year,cited_by_count,doi,authorships,abstract_inverted_index&[email protected]"

# 2. For the top papers, explore their citation graphs
curl -s "https://api.openalex.org/works?filter=cites:W4285719527&sort=cited_by_count:desc&per_page=10&select=id,display_name,publication_year,cited_by_count,doi&[email protected]"

# 3. Find recent papers building on this work
curl -s "https://api.openalex.org/works?filter=cites:W4285719527,publication_year:>2023&sort=publication_date:desc&per_page=10&[email protected]"
查找里程碑式/开创性论文
# Highly cited + search term
curl -s "https://api.openalex.org/works?search=attention+mechanism+neural+networks&filter=cited_by_count:>500,type:article&sort=cited_by_count:desc&per_page=10&select=id,display_name,publication_year,cited_by_count,doi&[email protected]"
查找近期预印本
# Latest preprints on a topic
curl -s "https://api.openalex.org/works?search=multimodal+large+language+models&filter=type:preprint,publication_year:2025&sort=publication_date:desc&per_page=15&[email protected]"
查找综述文章
# Review/survey papers on a topic
curl -s "https://api.openalex.org/works?search=federated+learning&filter=type:review,cited_by_count:>20&sort=cited_by_count:desc&per_page=10&[email protected]"
作者分析
# 1. Find the author
curl -s "https://api.openalex.org/authors?search=Geoffrey+Hinton&select=id,display_name,works_count,cited_by_count,last_known_institutions&[email protected]"

# 2. Get their most influential papers
curl -s "https://api.openalex.org/works?filter=author.id:A5068082743&sort=cited_by_count:desc&per_page=10&select=id,display_name,publication_year,cited_by_count,doi&[email protected]"

# 3. Get their recent work
curl -s "https://api.openalex.org/works?filter=author.id:A5068082743,publication_year:>2023&sort=publication_date:desc&per_page=10&[email protected]"

将结果保存到磁盘

开展深入研究时,将论文数据保存到磁盘,以便后续处理:

# Save search results as JSON
curl -s "https://api.openalex.org/works?search=topic&per_page=50&[email protected]" > research/papers/topic-search.json

# Extract and save a clean summary
curl -s "https://api.openalex.org/works?search=topic&per_page=50&select=id,display_name,publication_year,cited_by_count,doi,authorships&[email protected]" | python3 -c "
import json, sys
data = json.load(sys.stdin)
for w in data.get('results', []):
    authors = ', '.join(a['author']['display_name'] for a in w.get('authorships', [])[:3])
    if len(w.get('authorships', [])) > 3: authors += ' et al.'
    print(f\"[{w.get('cited_by_count',0)} cites] {w['display_name']} ({w.get('publication_year','?')}) - {authors}\")
    if w.get('doi'): print(f\"  DOI: {w['doi']}\")
    print()
" > research/papers/topic-summary.txt

开展深入研究时,将单篇论文的元数据保存到 sources-index.md,并将原始数据保存到 sources/:

# Save a paper's full metadata
curl -s "https://api.openalex.org/works/[email protected]" > research/sources/001-paper-title.json

速率限制

池速率获取方式
普通1 个请求/秒未提供电子邮件地址
礼貌10 个请求/秒在请求中添加 [email protected]
高级更高通过 api_key 参数使用付费 API 密钥

始终使用礼貌池。 在每个请求中添加 &[email protected]。

提示

  • 积极使用 select,以减少响应大小并加快请求速度
  • 收集大量结果时使用 per_page=100(最大值),以尽量减少请求次数
  • 需要超过 10,000 条结果时使用游标分页(cursor=*)
  • 使用 OR 语法批量查询 DOI:filter=doi:DOI1|DOI2|DOI3(最多 50 个)
  • 使用倒排索引重建摘要——不要跳过这一步,摘要非常有价值
  • 沿引用链查找具有开创性的研究和最新进展
  • 需要摘要时按 has_abstract:true 筛选(并非所有作品都有摘要)
  • 按 indexed_in:arxiv 或 indexed_in:pubmed 筛选,以定位特定存储库
  • 按 cited_by_count:desc 排序,优先查找影响力最大的论文
  • 结合搜索和筛选以获得精准结果:搜索提供相关性,筛选提升精确度

评论

支持 Markdown