Skip to content

API Reference parrot_tools.research.academic

github-actions[bot] edited this page Dec 2, 2026 · 4 revisions

parrot_tools.research.academic

View source

AcademicResearchToolkit — direct access to free academic-literature APIs (FEAT-426 Module 3: Crossref, PubMed, Semantic Scholar, arXiv; get_paper_details is added by the tail task in this same module).

Crossref also covers Oxford Academic (OUP) content via DOI prefix "10.1093" — OUP has no API of its own, so there is no separate Oxford source anywhere in this feature. PubMed requires a mandatory two-step esearch -> efetch workflow and NCBI's documented rate limits (3 req/s unkeyed, 10 req/s with a free API key). Semantic Scholar requires an explicit fields= parameter (the default response is title-only) and rejects hyphenated query terms. arXiv search logic is a deliberate, accepted-debt port of parrot_tools.arxiv_tool.ArxivTool — that module is never imported or modified here so its plain-dict return shape stays unchanged for backward compatibility. See spec §3 Module 3 and §7 "Known Risks".

Class AcademicResearchToolkit

Direct, structured access to authoritative academic-literature sources.

Covers Crossref (full-text bibliographic search, also reaching Oxford Academic content via DOI prefix "10.1093"), PubMed (two-step esearch/efetch biomedical literature search), Semantic Scholar (aiohttp full-text search), arXiv (preprint search), and get_paper_details (single-paper lookup dispatching across all four by identifier format). Spec §3 Module 3.

Method AcademicResearchToolkit.search_crossref

Search Crossref for scholarly works (articles, books, ...).

Also reaches Oxford Academic (OUP) content — OUP has no API of its own, and its works are indexed in Crossref under DOI prefix "10.1093". Best results come from a natural-language bibliographic query (title + author + journal combined) rather than bare keywords.

search_crossref(query: str, author: str | None = None, year_range: str | None = None, journal: str | None = None, max_results: int = 10) -> ResearchResult

Parameter Type Default Description
query str Bibliographic query (title, authors, journal, etc.).
author str | None None Optional author name filter.
year_range str | None None Optional publication year range, e.g. "2020-2023".
journal str | None None Optional container/journal title filter.
max_results int 10 Maximum number of works to return.

Returns: ResearchResult — A ResearchResult with result_type="papers".

Method AcademicResearchToolkit.search_pubmed

Search PubMed for biomedical literature.

PubMed requires a mandatory two-step workflow: esearch resolves the query to a list of PMIDs, then efetch retrieves the full records for those PMIDs (XML only — no JSON for full records). NCBI requires an identifying email and rate-limits to 3 req/s unkeyed, 10 req/s with a free NCBI_API_KEY.

search_pubmed(query: str, mesh_terms: str | None = None, date_range: str | None = None, max_results: int = 10) -> ResearchResult

Parameter Type Default Description
query str Free-text PubMed query.
mesh_terms str | None None Optional MeSH term filter, combined with query as "<query> AND <mesh_terms>[MeSH Terms]".
date_range str | None None Optional publication date range, e.g. "2020-2026".
max_results int 10 Maximum number of PMIDs/records to fetch.

Returns: ResearchResult — A ResearchResult with result_type="papers".

Method AcademicResearchToolkit.search_semantic_scholar

Search Semantic Scholar for scholarly papers.

Sends an explicit fields= parameter — the default response is only paperId+title. Hyphenated query terms return zero matches and are rewritten to spaces. The unauthenticated pool is shared globally, so 429s are common; _make_api_request already retries with backoff. An optional free SEMANTIC_SCHOLAR_API_KEY raises rate limits but is never required.

search_semantic_scholar(query: str, fields_of_study: str | None = None, year: str | None = None, open_access_only: bool = False, max_results: int = 10) -> ResearchResult

Parameter Type Default Description
query str Free-text search query.
fields_of_study str | None None Optional comma-separated field-of-study filter (e.g. "Computer Science,Medicine").
year str | None None Optional publication year or range, e.g. "2020-2023".
open_access_only bool False When True, keep only papers with an open access PDF.
max_results int 10 Maximum number of papers to return (server caps limit at 100 per page).

Returns: ResearchResult — A ResearchResult with result_type="papers".

Method AcademicResearchToolkit.search_arxiv

Search arXiv for preprints.

Ported from parrot_tools.arxiv_tool.ArxivTool's mapping logic — that module is never imported or modified here, so its plain-dict return shape stays unchanged for backward compatibility (accepted duplication, see spec §7).

search_arxiv(query: str, max_results: int = 10, sort_by: str = 'relevance', category: str | None = None) -> ResearchResult

Parameter Type Default Description
query str arXiv query string (keywords, au:, cat:, ...).
max_results int 10 Maximum number of results.
sort_by str 'relevance' 'relevance' | 'lastUpdatedDate' | 'submittedDate'.
category str | None None Optional arXiv category to prefix the query with (cat:<category> AND <query>).

Returns: ResearchResult — A ResearchResult with result_type="papers".

Method AcademicResearchToolkit.get_paper_details

Resolve a single paper by identifier, across all four sources.

Accepts a DOI (e.g. "10.1093/nar/gkaa1100" — also reaching Oxford Academic content via Crossref), a PubMed PMID, an arXiv id (e.g. "2103.14030"), or a Semantic Scholar paperId (40-char hex). Prefixed forms ("DOI:...", "PMID:...", "ARXIV:...", "CorpusID:...") are also accepted. The source is auto-detected from the identifier's shape unless source is given explicitly, which always overrides detection.

get_paper_details(doi_or_id: str, source: str | None = None) -> ResearchResult

Parameter Type Default Description
doi_or_id str A DOI, PMID, arXiv id, or Semantic Scholar paperId.
source str | None None Optional explicit source — one of "crossref", "pubmed", "arxiv", "semantic_scholar".

Returns: ResearchResult — A ResearchResult with result_type="papers" containing exactly one entry in .papers on success.

Alias BaseResearchToolkit

Re-exported from parrot_tools.research.base.BaseResearchToolkit.

Alias PaperResult

Re-exported from parrot_tools.research.models.PaperResult.

Alias ResearchResult

Re-exported from parrot_tools.research.models.ResearchResult.

Architecture

Clients

Bots & Agents

Memory

Knowledge

Tools & Toolkits

Flows

Experts

Skills

Stores & Loaders

MCP & A2A

Server & APIs

Integrations

Outputs & A2UI

Prompts

Security

Operations

Migration

SDD Tooling

LLM Wiki

Deployment

Decisions

API Reference

Clone this wiki locally