Research paper downloader

From aipoch/medical-research-skills · View interactive version

Research paper downloader is an AI agent skill from the GitHub repository aipoch/medical-research-skills. Download academic papers from open-access sources when the user provides a DOI/arXiv ID or requests a keyword-based paper search, and return the saved PDF path.

How to use this skill

Skill file

Source: https://github.com/aipoch/medical-research-skills

When to Use

Key Features

Dependencies

Example Usage

CLI (scripts/download.py)

Download by DOI:

python scripts/download.py --doi "10.1038/s41586-020-2649-2" --output "~/Downloads/ResearchPapers"

Download by arXiv ID:

python scripts/download.py --arxiv "1706.03762" --output "~/Downloads/ResearchPapers"

Search by keywords and download up to 3 results:

python scripts/download.py --search "attention mechanism" --max-results 3 --output "~/Downloads/ResearchPapers"

Python (import and call)

from pathlib import Path

# These functions are expected to be provided by the skill implementation (e.g., scripts/download.py or a module it exposes).
from download import download_by_doi, download_by_arxiv, search_download

output_dir = Path.home() / "Downloads" / "ResearchPapers"
output_dir.mkdir(parents=True, exist_ok=True)

# 1) Download by DOI
pdf_path = download_by_doi(doi="10.1016/j.clinimag.2022.03.004", output_dir=str(output_dir))
print("Saved to:", pdf_path)

# 2) Download by arXiv ID
pdf_path = download_by_arxiv(arxiv_id="2310.12345", output_dir=str(output_dir))
print("Saved to:", pdf_path)

# 3) Keyword search and download
pdf_paths = search_download(query="transformer attention", max_results=5, output_dir=str(output_dir))
for p in pdf_paths:
    print("Saved to:", p)

Implementation Details

Source Priority and Fallback

The downloader attempts open-access sources in priority order and stops at the first successful PDF retrieval:

  1. Semantic Scholar (Open Access API) — api.semanticscholar.org
  2. OpenAlex (Open Academic Graph) — api.openalex.org
  3. Unpaywall (OA location finder) — api.unpaywall.org
  4. arXiv (preprint server) — arxiv.org
  5. PubMed (biomedical database) — pubmed.ncbi.nlm.nih.gov
  6. Crossref (DOI registry/metadata) — api.crossref.org

If a source is unavailable, returns no OA link, or times out, the implementation should automatically proceed to the next source.

Configuration (config.json)

Recommended configuration keys:

File Output Rules

Error Handling Expectations

Safety Constraints

When Not to Use

Required Inputs

Recommended Workflow

  1. Validate the request against the skill boundary and confirm all required inputs are present.
  2. Select the documented execution path and prefer the simplest supported command or procedure.
  3. Produce the expected output using the documented file format, schema, or narrative structure.
  4. Run a final validation pass for completeness, consistency, and safety before returning the result.

Output Contract

Validation and Safety Rules

Failure Handling

Quick Validation

Run this minimal verification path before full execution when possible:

python scripts/download.py --help

Expected output format:

Result file: research_paper_downloader_result.md
Validation summary: PASS/FAIL with brief notes
Assumptions: explicit list if any
Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.