# paper-fetch

> Search papers and fetch metadata from open access APIs and services

Latest version **1.0.8** (published 2023-02-20) · MIT license · 0 weekly downloads

## Install

```sh
npm install paper-fetch
pnpm add paper-fetch
yarn add paper-fetch
bun add paper-fetch
```

Provides the command `paper`.

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.8 |
| Published | 2023-02-20 |
| First published | 2022-12-28 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 732 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Trung Dang |
| Maintainers | trungvd |

## Links

- npm: https://www.npmjs.com/package/paper-fetch
- npm.io page: https://npm.io/package/paper-fetch

## Dependencies (3)

- [inquirer](https://npm.io/package/inquirer.md) ^8.0.0
- [commander](https://npm.io/package/commander.md) ^9.4.1
- [node-html-parser](https://npm.io/package/node-html-parser.md) ^6.1.4

## Recent versions

- 1.0.8 (latest) — 2023-02-20
- 1.0.7 — 2023-02-20
- 1.0.6 — 2023-01-15
- 1.0.5 — 2023-01-15
- 1.0.4 — 2022-12-28
- 1.0.3 — 2022-12-28

## README

# paper-fetch

`paper-fetch` is a library to search for papers and fetch information about a paper from open-access APIs.

## Installation

```
yarn add paper-fetch
// or
npm install paper-fetch
```

## Usage

### Fetching a paper

```js
import {fetchPaper, PaperQuery} from 'paper-fetch';
const paperQuery: PaperQuery = {
  semanticScholarId: '2c03df8b48bf3fa39054345bafabfeff15bfd11d'
};
const paper = fetchPaper(
    paperQuery, 
    ['arxiv', 'semanticScholar', 'crossRef', 'openReview']).then(
      (p) => console.log(p));

// Logs: {
//   title: 'Deep Residual Learning for Image Recognition',
//   ...
// }
```

### Searching for papers

```js
import {searchPapers, PaperQuery} from 'paper-fetch';
const papers = searchPapers(
    'Deep Residual Learning for Image Recognition',
    ['arxiv', 'semanticScholar']).then(
      (ps) => console.log(ps));
// Logs: [
//   {
//     title: 'Deep Residual Learning for Image Recognition',
//     ...
//   },
//   ...
// ]
```

## Returned Fields

`paper-fetch` returns a `Paper` object with the following fields:

| Field | Type | Description |
| --- | --- | --- |
| `title` | `string` | The title of the paper. |
| `authors` | `Author[]` | The authors of the paper. |
| `abstract` | `string` | The abstract of the paper. |
| `pdfUrl` | `string` | The URL of the PDF of the paper. |
| `ids` | `Record<string, string>` | The IDs of the paper. |
| `venue` | `string` | The venue of the paper. |
| `year` | `number` | The year of the paper. |
| `numCitations` | `number` | The number of citations of the paper. |
| `numReferences` | `number` | The number of references of the paper. |
| `tldr` | `string` | The TL;DR of the paper. |
| `affliations` | `string[]` | The affliations of the authors. |
| `autoTags` | `string[]` | The auto tags of the paper. |
| `sources` | `Record<SourceKey, SourcePaper>` | Data returned by each source. |
| `urls` | `Url[]` | List of URLs related to the paper. |

---
_Source: https://npm.io/package/paper-fetch · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
