USPTO XML
A Rust client for downloading XML from the USPTO's Open Data Portal API. It provides a convenient way to fetch patent and patent application XML documents.
Installation
The library can be installed using cargo add uspto_xml or by adding the
following to your Cargo.toml file:
[]
= "0.1.0"
Usage
To use this library, you will need a USPTO API Key. Instructions for obtaining a key are available at the USPTO's Open Data Portal getting started page.
Using the Asynchronous Client
The default client is asynchronous and designed to work with runtimes like
tokio.
If performing a one-off download, the easiest approach is to use the
download_patent_xml or download_application_xml functions.
Note that the patent number or application number should be provided without any punctuation (e.g., commas) or country code (e.g., the "US" that precedes a patent number). This library only supports downloading US patents and applications.
async
If you intend to make multiple requests, you can avoid re-creating the client
for each one by instead creating a UsptoClient and only dropping it once you
have finished downloading XML.
async
Using the Blocking Client
If you prefer to use a synchronous client that blocks when downloading, enable
the blocking feature:
[]
= { = "0.1.0", = ["blocking"] }
The blocking functionality is available in uspto_xml::blocking. The pattern is
exactly the same, except that there is no need to await blocking calls.
License
This library is licensed under the Apache License v2.0. See LICENSE.txt for more information.