Skip to main content

librarian-uspto

A patent search backend for librarian's research loop: granted US patents and published applications through the USPTO Open Data Portal (ODP) API. It answers librarian's science category, so patents reach the research selector beside papers.

Why: in librarian's search comparison, 5 of the 7 trusted sources WebSearch found for a camera-tracking topic were USPTO patents, and SearXNG ships no patent engine.

Install

Install into the same environment as librarian, then route science to it with your other science sources:

uv pip install librarian-uspto
# librarian's .env
USPTO_API_KEY=...          # an ODP key (data.uspto.gov); sent as X-API-KEY
RESEARCH_SEARCH_ROUTES=web: searxng; video: searxng; science: scholarly, uspto, searxng

Without USPTO_API_KEY a search returns nothing, says why, and sends nothing.

What it searches, and why that way

What ODP's search said on October 1, 2026:

  • It covers application metadata (title, numbers, dates, applicant, classification), not abstracts or claims.
  • Free text matches any word in any field: "camera tracking solver" matched 106,891 records, the first five titled "Camera".
  • Results come newest first, not by relevance, and a search with no hits answers 404.

So this backend searches titles. It first asks for titles naming every content word of the topic, each as a prefix ("solver" matches "solving"), among applications with public text (a patent or publication number). When none match, it asks for titles naming any n-1 of the n words, then any n-2, each step one request (USPTO_MAX_ATTEMPTS, 4). librarian's science ranking then puts the titles that name the most of the topic first.

Each result links to the whole document as a PDF on image-ppubs.uspto.gov (a granted patent by number, a published application by publication number), which librarian ingests as one document, with OCR when its pages are scans. The snippet carries the number, dates, applicant, and first CPC classifications; ODP returns no abstract to show.

Settings

Setting Default What it does
USPTO_API_KEY empty Your ODP API key
USPTO_MAX_ATTEMPTS 4 Requests one search may make while broadening
USPTO_MIN_INTERVAL_SECONDS 1.1 Seconds between requests
USPTO_COOLDOWN_SECONDS 600 How long a refusal (429, 503) stops requests, doubling while it repeats, unless the reply sends Retry-After
USPTO_TIMEOUT_SECONDS 30 Per request

Replies, and searches that found nothing, are cached with librarian's search cache; the key is sent in a header and never cached.

License

Apache-2.0. See LICENSE and NOTICE.

Metadata

Release files for librarian-uspto 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for librarian-uspto 0.1.0
File Size Uploaded Provenance Actions
librarian_uspto-0.1.0.tar.gz 12.4 kB With provenance Details for librarian_uspto-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for librarian-uspto 0.1.0
File Interpreter ABI Platform Actions
librarian_uspto-0.1.0-py3-none-any.whl Python 3 none any Details for librarian_uspto-0.1.0-py3-none-any.whl

Total release size: 24.3 kB

Release files / librarian_uspto-0.1.0.tar.gz

Download URL librarian_uspto-0.1.0.tar.gz
Size 12.4 kB
Tags Source
SHA-256 checksum
How to use checksums
1943a9486b0ffa9b12b900ecffc78e03126c9575dbe3c9fb3b444e2d9e28f3ed
BLAKE2b-256 checksum
How to use checksums
a2e35fa8d202b387f1b79f28321be8883d15d770068bf22d655907f1e9ba732a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 2, 2026.

Transparency log

Release files / librarian_uspto-0.1.0-py3-none-any.whl

Download URL librarian_uspto-0.1.0-py3-none-any.whl
Size 11.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4040e300145e6a31fce2cb85e751cb977a025b76a40d5cf1e2b8e7062bdf6b68
BLAKE2b-256 checksum
How to use checksums
6656325a8a6863c09f4b3cc25e3ebc6ded3c0124011987f0bd7d8fdca6edf3c3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 2, 2026.

Transparency log

Security for librarian-uspto 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for librarian_uspto-0.1.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 2, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page