# @swinc/fetch-ppubs-patents

> A Nodejs TypeScript/JavaScript library for pulling patents from the USPTO Patent Public Search API

Latest version **6.0.1** (published 2022-12-29) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install @swinc/fetch-ppubs-patents
pnpm add @swinc/fetch-ppubs-patents
yarn add @swinc/fetch-ppubs-patents
bun add @swinc/fetch-ppubs-patents
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 6.0.1 |
| Published | 2022-12-29 |
| First published | 2022-11-27 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 117.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Iain R. Cunningham |
| Maintainers | swinc |
| Keywords | patent, patent-search, patent-data |

## Links

- npm: https://www.npmjs.com/package/@swinc/fetch-ppubs-patents
- Repository: https://github.com/swinc/fetch-ppubs-patents
- Homepage: https://github.com/swinc/fetch-ppubs-patents#readme
- Issues: https://github.com/swinc/fetch-ppubs-patents/issues
- npm.io page: https://npm.io/package/@swinc/fetch-ppubs-patents

## Dependencies (1)

- [axios](https://npm.io/package/axios.md) ^1.2.0

## Alternatives

- [jsforce](https://npm.io/package/jsforce.md) — 851.2K weekly downloads
- [react-native-qrcode-svg](https://npm.io/package/react-native-qrcode-svg.md) — 693.5K weekly downloads
- [@salesforce/plugin-data](https://npm.io/package/@salesforce/plugin-data.md) — 394.9K weekly downloads
- [@backstage/plugin-search-common](https://npm.io/package/@backstage/plugin-search-common.md) — 308.5K weekly downloads
- [@chain-registry/types](https://npm.io/package/@chain-registry/types.md) — 38.4K weekly downloads

## Recent versions

- 6.0.1 (latest) — 2022-12-29
- 6.0.0 — 2022-12-20
- 5.0.0 — 2022-12-20
- 4.0.0 — 2022-12-20
- 3.0.0 — 2022-12-20
- 2.0.0 — 2022-12-15
- 1.0.2 — 2022-12-11
- 1.0.1 — 2022-11-29
- 1.0.0 — 2022-11-27

## README

# fetch-ppubs-patents

`fetch-ppubs-patents` is a TypeScript/JavaScript library for pulling patents from the USPTO [Patent Public Search](https://ppubs.uspto.gov/pubwebapp/) API.

It has only one dependency: [axios](https://axios-http.com/).

## Usage

Consistent with the Patent Public Search API, there are only three top-level methods:

* `fp.searchPatents(query)`
    * returns an object with search details, including an array with basic patent details (guid, title, classifications, etc. but no main text)
    * see type for fields on returned object
* `fp.getPatentByGuid(guid)`
    * returns an object with full patent details
* `fp.getPatent(patentNumber)`
    * a convienence function that returns an object with full patent details for the first search hit on the passed `patentNumber` parameter

For example:

```
import * as fp from 'fetch-ppubs-patents'

const results = fp.searchPatents("nvidia.as.")

const firstResult = results.patents[0].publicationReferenceDocumentNumber // "11508113"

const patent = fp.getPatent(firstResult)

console.log(patent)

{
  guid: 'US-11508113-B2',
  publicationReferenceDocumentNumber: '11508113',
  compositeId: '1000006700342!US-US-11508113',
  publicationReferenceDocumentNumber1: '11508113',
  datePublishedKwicHits: null,
  datePublished: '2022-11-22T00:00:00Z',
  inventionTitle: 'Denoising techniques suitable for recurrent blurs',
  type: 'USPAT',
  mainClassificationCode: '1/1',
  applicantName: [ 'NVIDIA Corporation' ],
  assigneeName: [ 'NVIDIA Corporation' ],
  /* LOTS OF OTHER STUFF */
}
```
### Properties of API Responses

Properties of the API responses are defined in the `src/types` directory.

The search API response is defined in [PPubsSearchAPIResponse.ts](./src/types/PPubsSearchAPIResponse.ts).

The patent API response is defined in [PPubsHighlightAPIResponse.ts](./src/types/PPubsHighlightAPIResponse.ts).

## USPTO Terms of Use

This library uses an undocumented API present in the USPTO Public Patent Search system.

Per the [USPTO Terms of Use](https://www.uspto.gov/terms-use-uspto-websites), this API is "not designed or intended to be a source for bulk downloads of USPTO data when accessed through the website’s interfaces."

Please respect USPTO systems and do not use this API for bulk downloads. Alternative [Electronic Bulk Data Products](https://www.uspto.gov/learning-and-resources/electronic-bulk-data-products) are available.

## Development

### Building from TypeScript

`npm run build` will build the TypeScript files in `src` and `tests` directories to the `dist` directory.

### Testing

`npm test` will run the *TypeScript* tests in the `tests` directory. Use during development.

`npm run test:js` will run the *JavaScript* tests in the `dist/tests` directory. Use to verify correct build for deployment.

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