Entrez Cross-Database Links
eutils_elinkFind records linked to UIDs across NCBI databases, enabling gene-to-protein and PubMed-to-PMC mapping. Use neighbor_history to store linked UIDs for direct fetch.
Instructions
Find records linked to a set of UIDs, either in another database or within the same one.
This is how you move between databases: gene to protein, pubmed to pmc, nucleotide to snp, and so on. With cmd="neighbor_history" the linked set is stored on the NCBI History server and returned as a handle you can feed straight into eutils_efetch.
Args:
dbfrom (string): source database, for example "pubmed".
db (string, optional): target database, for example "pmc". Omit for same-database links.
uids (string[] | string, optional): source UIDs.
history (object, optional): handle whose db matches dbfrom.
cmd (string, optional): "neighbor" (default), "neighbor_score", "neighbor_history", "acheck", "ncheck", "lcheck", "llinks", "prlinks".
linkname (string, optional): a specific link, for example "pubmed_pmc". Use eutils_einfo to list them.
response_format ('markdown' | 'json'): output format. Default 'markdown'.
Supply either uids or history, never both.
Returns: { dbfrom, dbto?, command, groups_found, total_linked, groups: [{ dbto, linkname, count, ids[], query_key? }], histories? }
Examples:
Use when: "which PMC articles correspond to these PMIDs?" -> dbfrom="pubmed", db="pmc"
Use when: "find proteins for these gene IDs" -> dbfrom="gene", db="protein"
Use when: chaining a download -> cmd="neighbor_history", then pass histories to eutils_efetch
Don't use when: you want records, not UID lists (use eutils_link_then_fetch)
Error Handling:
Rejects a history whose db does not match dbfrom
Returns an empty result with a hint to list valid link names via eutils_einfo
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| db | No | Target database to find links in, for example "pmc". Omit to find related records in the same database. | |
| cmd | No | Link command. "neighbor" returns linked UIDs immediately (default). "neighbor_history" stores them on the History server and returns a handle. | |
| uids | No | UIDs or accession.version identifiers, as an array or a comma-separated string. Example: ["31452104", "31452105"]. | |
| dbfrom | Yes | Source database holding the input UIDs, for example "pubmed". | |
| history | No | Pointer to a UID set stored on the NCBI History server. Pass back the object returned by a previous call, unchanged. | |
| linkname | No | Specific link to follow, for example "pubmed_pmc". Call eutils_einfo to list valid link 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 | No | ||
| dbfrom | Yes | ||
| groups | Yes | ||
| command | Yes | ||
| histories | No | Present when cmd is neighbor_history. | |
| groups_found | Yes | ||
| total_linked | Yes |