---
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://carta.tech/man/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)](/man/archive-pubmed/1.md) or the like, typically for further processing by [**xtract**(1)](/man/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)](/man/archive-nihocc/1.md), [**archive-nlmnlp**(1)](/man/archive-nlmnlp/1.md), [**archive-nmcds**(1)](/man/archive-nmcds/1.md), [**archive-pids**(1)](/man/archive-pids/1.md), [**archive-pmc**(1)](/man/archive-pmc/1.md), [**archive-pubmed**(1)](/man/archive-pubmed/1.md), [**archive-taxonomy**(1)](/man/archive-taxonomy/1.md), [**cit2pmid**(1)](/man/cit2pmid/1.md), [**combine-uid-lists**(1)](/man/combine-uid-lists/1.md), [**difference-uid-lists**(1)](/man/difference-uid-lists/1.md), [**download-ncbi-data**(1)](/man/download-ncbi-data/1.md), [**download-pmc**(1)](/man/download-pmc/1.md), [**download-pubmed**(1)](/man/download-pubmed/1.md), [**ds2pme**(1)](/man/ds2pme/1.md), [**ds2pme**(1)](/man/ds2pme/1.md), [**ecollect**(1)](/man/ecollect/1.md), [**edict**(1)](/man/edict/1.md), [**efetch**(1)](/man/efetch/1.md), [**elink**(1)](/man/elink/1.md), [**esample**(1)](/man/esample/1.md), [**esearch**(1)](/man/esearch/1.md), [**exclude-uid-lists**(1)](/man/exclude-uid-lists/1.md), [**intersect-uid-lists**(1)](/man/intersect-uid-lists/1.md), [**pm-refresh**(1)](/man/pm-refresh/1.md), [**pma2apa**(1)](/man/pma2apa/1.md), [**pma2apa**(1)](/man/pma2apa/1.md), [**pma2pme**(1)](/man/pma2pme/1.md), [**pma2pme**(1)](/man/pma2pme/1.md), [**pmc2bioc**(1)](/man/pmc2bioc/1.md), [**pmc2info**(1)](/man/pmc2info/1.md), [**rchive**(1)](/man/rchive/1.md), [**transmute**(1)](/man/transmute/1.md), [**xfilter**(1)](/man/xfilter/1.md), [**xinfo**(1)](/man/xinfo/1.md), [**xlink**(1)](/man/xlink/1.md), [**xsearch**(1)](/man/xsearch/1.md), [**xtract**(1)](/man/xtract/1.md).
