prepare_export
Export PubMed citations to reference manager formats like RIS, BibTeX, and CSL-JSON for use in EndNote, Zotero, or LaTeX documents.
Instructions
Export citations to reference manager formats.
╔═══════════════════════════════════════════════════════════════════╗ ║ RECOMMENDED: Use source="official" (default) for best quality ║ ╚═══════════════════════════════════════════════════════════════════╝
When to Use
Exporting references to EndNote, Zotero, Mendeley
Creating BibTeX for LaTeX documents
Generating citation lists for manuscripts
Source Options
Source | Formats | Quality | Speed |
official | ris, medline, csl | ★★★★★ | Fast |
local | ris, bibtex, csv, medline, json | ★★★★ | Fast |
Format Selection Guide
ris: EndNote, Zotero, Mendeley (official recommended)
medline: NBIB format for PubMed tools
csl: JSON for programmatic citation styling
bibtex: LaTeX documents (local only)
csv: Data analysis, Excel (local only)
Args: pmids: Articles to export. Accepts: - "last" → results from previous search - "12345678,87654321" → comma-separated PMIDs - ["12345678", "87654321"] → list of PMIDs - "PMID:12345678" → with prefix format: Export format (default: "ris") - official API: ris, medline, csl - local only: bibtex, csv, json include_abstract: Include abstracts in output (default: True) source: Citation source (default: "official") - "official": NCBI Citation API (recommended, best quality) - "local": Local formatting (more formats, offline capable)
Returns: JSON with status and export_text containing formatted citations.
Examples: # Export last search results (recommended) prepare_export(pmids="last", format="ris")
# Export specific PMIDs to BibTeX
prepare_export(pmids="12345678,87654321", format="bibtex", source="local")
# Get CSL-JSON for programmatic use
prepare_export(pmids="last", format="csl", source="official")
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| pmids | Yes | ||
| format | No | ris | |
| include_abstract | No | ||
| source | No | official |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |