---
name: "xfetch"
section: "1"
platform: "linux"
package: "ncbi-entrez-direct"
version: "24.0.20250523+dfsg-1+b1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/xfetch"
---

# xfetch(1)

fetch records from a local NCBI Entrez Direct archive by UID

## NAME

xfetch - fetch records from a local NCBI Entrez Direct archive by UID

## SYNOPSIS

**xfetch** \[**-db** *database*\] \[**-id** *str*...\|**-input** *file*\] \[**-stream**\]

## DESCRIPTION

**xfetch** prints to standard output requested portions of a local NCBI Entrez Direct archive produced by [**archive-pubmed**(1)](/archive-pubmed/1.md) or the like, typically for further processing by [**xtract**(1)](/xtract/1.md) or the like.

By default, it looks to standard input for either a raw list of UIDs or an **ENTREZ\_DIRECT** XML object that additionally holds a database name.

## OPTIONS

- **-db** *database*

  Fetch from the specified database, **pubmed** by default for now. (Explicitly specifying a database either on the command line or via **ENTREZ\_DIRECT** XML will eventually become mandatory.)

- **-id** *str* ...

  UID(s) to fetch; may be internally delimited by whitespace and any punctuation other than **.** or **\_**.

- **-input** *file*

  Read UIDs from the specified file.

- **-stream**

  Leave records compressed.

## ENVIRONMENT

- **EDIRECT\_LOCAL\_ARCHIVE**

  Local archive directory. Expected to hold an absolute path; mandatory when not supplying a path on the command line.

## SEE ALSO

[**archive-nihocc**(1)](/archive-nihocc/1.md), [**archive-nlmnlp**(1)](/archive-nlmnlp/1.md), [**archive-nmcds**(1)](/archive-nmcds/1.md), [**archive-pids**(1)](/archive-pids/1.md), [**archive-pmc**(1)](/archive-pmc/1.md), [**archive-pubmed**(1)](/archive-pubmed/1.md), [**archive-taxonomy**(1)](/archive-taxonomy/1.md), [**cit2pmid**(1)](/cit2pmid/1.md), [**combine-uid-lists**(1)](/combine-uid-lists/1.md), [**difference-uid-lists**(1)](/difference-uid-lists/1.md), [**download-ncbi-data**(1)](/download-ncbi-data/1.md), [**download-pmc**(1)](/download-pmc/1.md), [**download-pubmed**(1)](/download-pubmed/1.md), [**ds2pme**(1)](/ds2pme/1.md), [**ds2pme**(1)](/ds2pme/1.md), [**ecollect**(1)](/ecollect/1.md), [**edict**(1)](/edict/1.md), [**efetch**(1)](/efetch/1.md), [**elink**(1)](/elink/1.md), [**esample**(1)](/esample/1.md), [**esearch**(1)](/esearch/1.md), [**exclude-uid-lists**(1)](/exclude-uid-lists/1.md), [**intersect-uid-lists**(1)](/intersect-uid-lists/1.md), [**pm-refresh**(1)](/pm-refresh/1.md), [**pma2apa**(1)](/pma2apa/1.md), [**pma2apa**(1)](/pma2apa/1.md), [**pma2pme**(1)](/pma2pme/1.md), [**pma2pme**(1)](/pma2pme/1.md), [**pmc2bioc**(1)](/pmc2bioc/1.md), [**pmc2info**(1)](/pmc2info/1.md), [**rchive**(1)](/rchive/1.md), [**transmute**(1)](/transmute/1.md), [**xfilter**(1)](/xfilter/1.md), [**xinfo**(1)](/xinfo/1.md), [**xlink**(1)](/xlink/1.md), [**xsearch**(1)](/xsearch/1.md), [**xtract**(1)](/xtract/1.md).
