pi-pubmed
v1.0.1
Published
Search PubMed and fetch article abstracts directly from Pi using NCBI E-utilities
Downloads
27
Maintainers
Readme
pi-pubmed
A Pi package for searching PubMed and fetching biomedical literature articles directly from your coding agent.
Features
- Search PubMed — Find articles using full PubMed query syntax (boolean operators, field tags, MeSH terms, date ranges)
- Fetch article details — Retrieve titles, authors, journals, publication dates, DOIs, and full abstracts
- Zero dependencies — Uses the NCBI E-utilities REST API directly
- Configurable — Optional API key support for higher rate limits
Installation
pi install npm:pi-pubmedOr install from a local path:
pi install /path/to/pi-pubmedTools
pubmed_search
Search PubMed for articles matching a query.
| Parameter | Type | Required | Description |
|----------------|----------|----------|------------------------------------------------------------------------------------|
| query | string | ✅ | PubMed search query (supports boolean operators, field tags, MeSH terms) |
| max_results | number | ❌ | Max results to return (1–100, default 10) |
| sort_by | string | ❌ | Sort: relevance, pub_date, Author, JournalName |
| date_range | string | ❌ | Date range as YYYY:YYYY or YYYY/MM:YYYY/MM |
pubmed_fetch
Fetch detailed article information for specific PubMed IDs.
| Parameter | Type | Required | Description |
|-------------------|------------|----------|-------------------------------------------------|
| pmids | string[] | ✅ | List of PubMed IDs to fetch |
| include_abstract| boolean | ❌ | Include full abstract (default true) |
Usage Examples
Once installed, just ask Pi naturally:
Search PubMed for recent articles about CRISPR gene therapyFind review articles about machine learning in drug discovery from the last 5 yearsFetch the abstract for PMID 38312345Configuration (Optional)
Set environment variables for enhanced access:
| Variable | Description |
|---------------|----------------------------------------------------|
| NCBI_API_KEY| NCBI API key — increases rate limit to 10 req/s |
| NCBI_EMAIL | Your email — helps NCBI contact you if needed |
Get a free API key at: https://www.ncbi.nlm.nih.gov/account/settings/
Package Structure
pi-pubmed/
├── package.json # Package manifest with Pi configuration
├── extensions/
│ └── pubmed.ts # Extension with pubmed_search & pubmed_fetch tools
├── skills/
│ └── pubmed/
│ └── SKILL.md # Skill instructions for the agent
└── README.mdLicense
MIT
