Data source: OpenAlex
Overview
OpenAlex wraps OpenAlex, handling authentication, pagination, and rate limits for you. This tutorial covers all 6 tools with working code examples you can copy and run.
Prerequisites
- Sign up at https://context.gnist.ai/signup for a free API key (100 calls/day).
- Choose your integration method: MCP protocol or REST API.
Connect via MCP
Add to your MCP client config (Claude Desktop, Cursor, etc.):
{
"mcpServers": {
"gnist-openalex": {
"url": "https://context.gnist.ai/mcp/openalex/",
"headers": {
"Gnist-API-Key": "YOUR_API_KEY"
}
}
}
}
Tools (6)
search_papers
Search scholarly papers by keyword across 250M+ works from OpenAlex. Args: query: Search terms (e.g. "transformer attention mechanisms", "CRISPR gene editing"). year_from: Filter to papers published from this year onward (e.g. 2020). Optional. year_to: Filter to papers published up to this year (e.g. 2024). Optional. field_of_study: Filter by research field (e.g. "machine learning", "biology"). Optional. max_results: Number of results to return (1–25, default 10). Returns: Dictionary with count and papers list (id, doi, title, year, venue, cited_by_count, open_access flag, authors up to 5, top 5 concepts).
| Parameter | Type | Required | Description |
|---|---|---|---|
query | string | required | Search terms (e.g. "transformer attention mechanisms", "CRISPR gene editing"). |
year_from | any | optional | Filter to papers published from this year onward (e.g. 2020). Optional. |
year_to | any | optional | Filter to papers published up to this year (e.g. 2024). Optional. |
field_of_study | any | optional | Filter by research field (e.g. "machine learning", "biology"). Optional. |
max_results | integer | optional | Number of results to return (1–25, default 10). (default: 10) |
curl -X POST "https://context.gnist.ai/mcp/openalex/" \
-H "Content-Type: application/json" \
-H "Gnist-API-Key: YOUR_API_KEY" \
-d '{"jsonrpc": "2.0", "method": "tools/call", "id": 1, "params": {"name": "search_papers", "arguments": {"query": "transformer attention mechanisms"}}}'
import httpx
resp = httpx.post(
"https://context.gnist.ai/mcp/openalex/",
headers={"Gnist-API-Key": "YOUR_API_KEY"},
json={'id': 1,
'jsonrpc': '2.0',
'method': 'tools/call',
'params': {'arguments': {'query': 'transformer attention mechanisms'},
'name': 'search_papers'}},
)
print(resp.json())
get_paper
Get full details for a specific paper including abstract and citation count. Args: paper_id: OpenAlex ID (e.g. "W2741809807"), DOI (e.g. "10.1038/s41586-021-03819-2"), or full URL (e.g. "https://openalex.org/W2741809807"). Returns: Full paper record: id, doi, title, publication_year, venue, abstract, authors, concepts, cited_by_count, references_count, open_access.
| Parameter | Type | Required | Description |
|---|---|---|---|
paper_id | string | required | OpenAlex ID (e.g. "W2741809807"), DOI (e.g. "10.1038/s41586-021-03819-2"), or full URL (e.g. "https://openalex.org/W2741809807"). |
curl -X POST "https://context.gnist.ai/mcp/openalex/" \
-H "Content-Type: application/json" \
-H "Gnist-API-Key: YOUR_API_KEY" \
-d '{"jsonrpc": "2.0", "method": "tools/call", "id": 1, "params": {"name": "get_paper", "arguments": {"paper_id": "W2741809807"}}}'
import httpx
resp = httpx.post(
"https://context.gnist.ai/mcp/openalex/",
headers={"Gnist-API-Key": "YOUR_API_KEY"},
json={'id': 1,
'jsonrpc': '2.0',
'method': 'tools/call',
'params': {'arguments': {'paper_id': 'W2741809807'}, 'name': 'get_paper'}},
)
print(resp.json())
get_author_profile
Get a researcher's profile — works, citations, h-index, and affiliations. Args: author_id: OpenAlex author ID (e.g. "A5023888391"), ORCID (e.g. "0000-0001-6187-6610"), or full ORCID URL. Returns: Author profile: id, display_name, orcid, works_count, cited_by_count, h_index, and affiliations (up to 3 recent institutions).
| Parameter | Type | Required | Description |
|---|---|---|---|
author_id | string | required | OpenAlex author ID (e.g. "A5023888391"), ORCID (e.g. "0000-0001-6187-6610"), or full ORCID URL. |
curl -X POST "https://context.gnist.ai/mcp/openalex/" \
-H "Content-Type: application/json" \
-H "Gnist-API-Key: YOUR_API_KEY" \
-d '{"jsonrpc": "2.0", "method": "tools/call", "id": 1, "params": {"name": "get_author_profile", "arguments": {"author_id": "A5023888391"}}}'
import httpx
resp = httpx.post(
"https://context.gnist.ai/mcp/openalex/",
headers={"Gnist-API-Key": "YOUR_API_KEY"},
json={'id': 1,
'jsonrpc': '2.0',
'method': 'tools/call',
'params': {'arguments': {'author_id': 'A5023888391'},
'name': 'get_author_profile'}},
)
print(resp.json())
list_citations
List papers that cite or are referenced by a given paper. Args: paper_id: OpenAlex ID, DOI, or full URL of the paper. direction: "cited_by" for papers that cite this one (default), or "references" for papers this paper cites. max_results: Number of results to return (1–25, default 20). Returns: Dictionary with count and papers list (id, doi, title, year, cited_by_count, authors).
| Parameter | Type | Required | Description |
|---|---|---|---|
paper_id | string | required | OpenAlex ID, DOI, or full URL of the paper. |
direction | string | optional | "cited_by" for papers that cite this one (default), or "references" for papers this paper cites. (default: cited_by) |
max_results | integer | optional | Number of results to return (1–25, default 20). (default: 20) |
curl -X POST "https://context.gnist.ai/mcp/openalex/" \
-H "Content-Type: application/json" \
-H "Gnist-API-Key: YOUR_API_KEY" \
-d '{"jsonrpc": "2.0", "method": "tools/call", "id": 1, "params": {"name": "list_citations", "arguments": {"paper_id": "12345"}}}'
import httpx
resp = httpx.post(
"https://context.gnist.ai/mcp/openalex/",
headers={"Gnist-API-Key": "YOUR_API_KEY"},
json={'id': 1,
'jsonrpc': '2.0',
'method': 'tools/call',
'params': {'arguments': {'paper_id': '12345'}, 'name': 'list_citations'}},
)
print(resp.json())
get_trending_papers
Get recently published high-impact papers in a research field. Args: field: Research field to search (e.g. "machine learning", "immunology", "climate change"). days: Look back this many days for recent papers (default 30). max_results: Number of results to return (1–25, default 10). Returns: Dictionary with count and recent papers ranked by citation count.
| Parameter | Type | Required | Description |
|---|---|---|---|
field | string | required | Research field to search (e.g. "machine learning", "immunology", "climate change"). |
days | integer | optional | Look back this many days for recent papers (default 30). (default: 30) |
max_results | integer | optional | Number of results to return (1–25, default 10). (default: 10) |
curl -X POST "https://context.gnist.ai/mcp/openalex/" \
-H "Content-Type: application/json" \
-H "Gnist-API-Key: YOUR_API_KEY" \
-d '{"jsonrpc": "2.0", "method": "tools/call", "id": 1, "params": {"name": "get_trending_papers", "arguments": {"field": "machine learning"}}}'
import httpx
resp = httpx.post(
"https://context.gnist.ai/mcp/openalex/",
headers={"Gnist-API-Key": "YOUR_API_KEY"},
json={'id': 1,
'jsonrpc': '2.0',
'method': 'tools/call',
'params': {'arguments': {'field': 'machine learning'},
'name': 'get_trending_papers'}},
)
print(resp.json())
report_feedback
Report a bug, feature request, or general feedback for this data source. Use this when something doesn't work as expected, when you'd like a new feature, or when you have suggestions for improvement. Args: feedback: Describe the issue or suggestion. feedback_type: One of 'bug', 'feature_request', or 'general'.
| Parameter | Type | Required | Description |
|---|---|---|---|
feedback | string | required | |
feedback_type | string | optional | (default: general) |
curl -X POST "https://context.gnist.ai/mcp/openalex/" \
-H "Content-Type: application/json" \
-H "Gnist-API-Key: YOUR_API_KEY" \
-d '{"jsonrpc": "2.0", "method": "tools/call", "id": 1, "params": {"name": "report_feedback", "arguments": {"feedback": "example"}}}'
import httpx
resp = httpx.post(
"https://context.gnist.ai/mcp/openalex/",
headers={"Gnist-API-Key": "YOUR_API_KEY"},
json={'id': 1,
'jsonrpc': '2.0',
'method': 'tools/call',
'params': {'arguments': {'feedback': 'example'}, 'name': 'report_feedback'}},
)
print(resp.json())
Common Patterns
Use
search_papers to find items, then get_paper to get full details. This two-step pattern is common for exploring data before drilling down.Several tools support
limit, offset, or page parameters. Start with small limits during development, then increase for production queries.FAQ
What data does OpenAlex provide?
Open scholarly metadata — works, authors, institutions, and citation networks. It exposes 6 tools: search_papers, get_paper, get_author_profile, list_citations, get_trending_papers, report_feedback.
What do I need to get started?
A Gnist API key (free tier: 100 calls/day). Sign up at https://context.gnist.ai/signup.
What format does the OpenAlex API return?
JSON, via either MCP protocol (JSON-RPC 2.0) or REST API.