Link and Fetch Across Databases
eutils_link_then_fetchFollow links across Entrez databases and download target records in one call, such as gene IDs to protein sequences or PMIDs to PMC full text.
Instructions
Follow links from one database to another and download the target records in one call.
Typical uses: gene IDs to protein sequences, PMIDs to PMC full text, nucleotide records to SNPs. Give it either a query or a UID list in the source database, and it returns records from the target database.
Args:
dbfrom (string): source database, for example "gene".
db (string): target database to download from, for example "protein".
term (string, optional): query in dbfrom. Pass exactly one of term or uids.
uids (string[] | string, optional): source UIDs in dbfrom.
linkname (string, optional): specific link to follow.
retmax (number, optional): target records to download. Default 20, max 500.
rettype (string, optional): record format for the target database.
response_format ('markdown' | 'json'): output format. Default 'markdown'.
Returns: { dbfrom, dbto, source_total, retrieved, rettype, source_history, history, text }
Examples:
Use when: "get the protein sequences for these gene IDs" -> dbfrom="gene", db="protein", uids=[...]
Use when: "find PMC full text for papers about X" -> dbfrom="pubmed", db="pmc", term="..."
Don't use when: you only need the linked UIDs (use eutils_elink, which is cheaper)
Error Handling:
Rejects passing both term and uids, or neither
Returns an empty result with a hint to list link names when no links exist
Refuses retmax above 500
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| db | Yes | Target database to download from, for example "protein". | |
| term | No | Query in dbfrom. Use instead of uids to select the source records. | |
| uids | No | Source UIDs in dbfrom. Use instead of term. | |
| dbfrom | Yes | Source database, for example "gene". | |
| retmax | No | Records to download from the target database (default 20, max 500). | |
| rettype | No | Record format for the target database. | |
| linkname | No | Specific link to follow. Use eutils_einfo to list valid names. | |
| response_format | No | Output format: 'markdown' for human-readable text, or 'json' for machine-readable data. Default: 'markdown'. | markdown |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| dbto | Yes | ||
| text | Yes | ||
| dbfrom | Yes | ||
| history | No | ||
| rettype | No | ||
| retrieved | No | ||
| source_total | Yes | ||
| source_history | No |