A Modern Python client for accessing the United States Patent and Trademark Office (USPTO) Open Data Portal (ODP) APIs.
Project description
USPTO Open Data Portal Client Library
A Python client library for interacting with the United Stated Patent and Trademark Office (USPTO) Open Data Portal APIs.
This package provides clients for interacting with the USPTO Bulk Data API, Patent Data API, Final Petition Decisions API, PTAB (Patent Trial and Appeal Board) APIs, Enriched Citations API, Office Action Text Retrieval API, Office Action Rejections API, and Office Action Citations API.
[!IMPORTANT] The USPTO is in the process of moving their Developer API. This package is only concerned with the new API. The old API was officially retired at the end of 2025; however, some products have not yet been fully transitioned to the Open Data Portal API. The USPTO expects the remaining products to be transitioned to the Open Data Portal in early 2026.
Quick Start
Requirements: Python ≥3.10
pip install pyUSPTO
[!IMPORTANT] You must have an API key for the USPTO Open Data Portal API.
from pyUSPTO import PatentDataClient, USPTOConfig
# Initialize with config
config = USPTOConfig(api_key="your_api_key_here")
client = PatentDataClient(config=config)
# Search for patent applications
results = client.search_applications(inventor_name_q="Smith", limit=10)
print(f"Found {results.count} applications")
Configuration
All clients require a USPTOConfig object. You can create one from environment variables (recommended) or by passing the API key directly.
[!TIP]
USPTOConfigmanages an underlying HTTP session. For long-running applications, use it as a context manager (with USPTOConfig(...) as config:) or callconfig.close()when done. See ADVANCED.md for details.
Environment Variables (Recommended)
Set the environment variable in your shell:
export USPTO_API_KEY="your_api_key_here"
Then use it in your Python code:
from pyUSPTO import (
BulkDataClient,
EnrichedCitationsClient,
OAActionsClient,
OACitationsClient,
OARejectionsClient,
PatentDataClient,
FinalPetitionDecisionsClient,
PTABTrialsClient,
PTABAppealsClient,
PTABInterferencesClient,
USPTOConfig,
)
# Load configuration from environment
config = USPTOConfig.from_env()
patent_client = PatentDataClient(config=config)
bulk_client = BulkDataClient(config=config)
petition_client = FinalPetitionDecisionsClient(config=config)
trials_client = PTABTrialsClient(config=config)
appeals_client = PTABAppealsClient(config=config)
interferences_client = PTABInterferencesClient(config=config)
citations_client = EnrichedCitationsClient(config=config)
oa_client = OAActionsClient(config=config)
oa_citations_client = OACitationsClient(config=config)
rejections_client = OARejectionsClient(config=config)
Direct API Key
Alternatively, you can pass your API key directly when creating the config:
from pyUSPTO import USPTOConfig
config = USPTOConfig(api_key="your_api_key_here")
Client Usage Examples
[!TIP] For comprehensive examples with detailed explanations, see the
examples/directory.
- Patent Data API
- Bulk Data API
- Final Petition Decisions API
- PTAB Trials API
- PTAB Appeals API
- PTAB Interferences API
- Enriched Citations API
- Office Action Text Retrieval API
- Office Action Rejections API
- Office Action Citations API
Patent Data API
from pyUSPTO import PatentDataClient, USPTOConfig
config = USPTOConfig(api_key="your_api_key_here")
client = PatentDataClient(config=config)
# Search for applications by inventor name
response = client.search_applications(inventor_name_q="Smith", limit=2)
print(f"Found {response.count} applications with 'Smith' as inventor (showing up to 2).")
# Get a specific application
app = client.get_application_by_number("18045436")
if app.application_meta_data:
print(f"Title: {app.application_meta_data.invention_title}")
PatentDataClient also provides convenience methods for common lookups:
# Look up a patent wrapper by any identifier type (you must use keyword names).
wrapper = client.get_IFW_metadata(application_number="18/045,436")
wrapper = client.get_IFW_metadata(patent_number="11,234,567")
wrapper = client.get_IFW_metadata(publication_number="2023/0012345")
wrapper = client.get_IFW_metadata(PCT_app_number="PCT/US24/12345")
# Look up USPTO status codes
status_codes = client.get_status_codes()
See examples/patent_data_example.py for detailed examples including downloading documents and publications.
Bulk Data API
from pyUSPTO import BulkDataClient, USPTOConfig
config = USPTOConfig(api_key="your_api_key_here")
client = BulkDataClient(config=config)
# Search for bulk data products
response = client.search_products(query="patent", limit=5)
print(f"Found {response.count} products matching 'patent'")
for product in response.bulk_data_product_bag:
print(f" {product.product_title_text} ({product.product_identifier})")
# Get a specific product with its files
product = client.get_product_by_id("PTGRXML", include_files=True, latest=True)
print(f"Product: {product.product_title_text}")
See examples/bulk_data_example.py for detailed examples including file downloads and archive extraction.
Final Petition Decisions API
from pyUSPTO import FinalPetitionDecisionsClient, USPTOConfig
config = USPTOConfig(api_key="your_api_key_here")
client = FinalPetitionDecisionsClient(config=config)
# Search for petition decisions
response = client.search_decisions(
decision_date_from_q="2023-01-01", decision_date_to_q="2023-12-31", limit=5
)
print(f"Found {response.count} decisions from 2023.")
# Get a specific decision by ID from search results
response = client.search_decisions(limit=1)
if response.count > 0:
decision_id = response.petition_decision_data_bag[0].petition_decision_record_identifier
decision = client.get_decision_by_id(decision_id)
print(f"Decision Type: {decision.decision_type_code}")
See examples/petition_decisions_example.py for detailed examples including downloading decision documents.
PTAB Trials API
from pyUSPTO import PTABTrialsClient, USPTOConfig
config = USPTOConfig(api_key="your_api_key_here")
client = PTABTrialsClient(config=config)
# Search for IPR proceedings
response = client.search_proceedings(
trial_type_code_q="IPR",
petition_filing_date_from_q="2023-01-01",
petition_filing_date_to_q="2023-12-31",
limit=5,
)
print(f"Found {response.count} IPR proceedings filed in 2023")
# Paginate through results
for proceeding in client.paginate_proceedings(
trial_type_code_q="IPR",
petition_filing_date_from_q="2024-01-01",
limit=5,
):
print(f"{proceeding.trial_number}")
See examples/ptab_trials_example.py for detailed examples including searching documents and decisions.
PTAB Appeals API
from pyUSPTO import PTABAppealsClient, USPTOConfig
config = USPTOConfig(api_key="your_api_key_here")
client = PTABAppealsClient(config=config)
# Search for appeal decisions
response = client.search_decisions(
technology_center_number_q="3600",
decision_date_from_q="2023-01-01",
decision_date_to_q="2023-12-31",
limit=5,
)
print(f"Found {response.count} appeal decisions from TC 3600 in 2023")
See examples/ptab_appeals_example.py for detailed examples including searching by decision type and application number.
PTAB Interferences API
from pyUSPTO import PTABInterferencesClient, USPTOConfig
config = USPTOConfig(api_key="your_api_key_here")
client = PTABInterferencesClient(config=config)
# Search for interference decisions
response = client.search_decisions(
decision_date_from_q="2023-01-01",
limit=5,
)
print(f"Found {response.count} interference decisions since 2023")
See examples/ptab_interferences_example.py for detailed examples including searching by party name and outcome.
Enriched Citations API
from pyUSPTO import EnrichedCitationsClient, USPTOConfig
config = USPTOConfig(api_key="your_api_key_here")
client = EnrichedCitationsClient(config=config)
# Search for enriched citations by technology center
response = client.search_citations(
tech_center_q="1700",
rows=5,
)
print(f"Found {response.count} citations from TC 1700")
See examples/enriched_citations_example.py for detailed examples including searching by application number and citation category.
Office Action Text Retrieval API
from pyUSPTO import OAActionsClient, USPTOConfig
config = USPTOConfig(api_key="your_api_key_here")
client = OAActionsClient(config=config)
# Search for office actions by technology center
response = client.search(
tech_center_q="1700",
rows=5,
)
print(f"Found {response.count} office actions from TC 1700")
See examples/oa_actions_example.py for detailed examples including searching by document code and paginating results.
Office Action Rejections API
from pyUSPTO import OARejectionsClient, USPTOConfig
config = USPTOConfig(api_key="your_api_key_here")
client = OARejectionsClient(config=config)
# Search for rejections by application number
response = client.search(
patent_application_number_q="12190351",
rows=5,
)
print(f"Found {response.count} rejection records for application 12190351")
See examples/oa_rejections_example.py for detailed examples including searching by document code and inspecting rejection flags.
Office Action Citations API
from pyUSPTO import OACitationsClient, USPTOConfig
config = USPTOConfig(api_key="your_api_key_here")
client = OACitationsClient(config=config)
# Search for citations by legal section code
response = client.search(
legal_section_code_q="103",
tech_center_q="2800",
rows=5,
)
print(f"Found {response.count} section 103 citations in tech center 2800")
See examples/oa_citations_example.py for detailed examples including searching by examiner-cited indicator and paginating results.
Documentation
Full documentation may be found on Read the Docs.
Data Models
The library uses Python dataclasses to represent API responses. All data models include type annotations and are fully compatible with static type checkers. For a complete list of all data models, see the API Reference documentation.
Advanced Topics
For advanced configuration including HTTP settings, environment variables reference, debugging with raw data preservation, and warning control, see ADVANCED.md.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Contributing
We welcome contributions! Please see CONTRIBUTING.md for guidelines on how to contribute to this project.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pyuspto-0.5.2.tar.gz.
File metadata
- Download URL: pyuspto-0.5.2.tar.gz
- Upload date:
- Size: 251.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
40cd552be9fdd6c8f73e74546fa86d18cb1c122af83890d98cb4bfcef4f78807
|
|
| MD5 |
c9f93c701deef96e1bc89e5d1d2895dd
|
|
| BLAKE2b-256 |
36a2266d14d1b2ca441e30b496a669abed41bf64b081b5c6eda8fda2ad7c3e1a
|
Provenance
The following attestation bundles were made for pyuspto-0.5.2.tar.gz:
Publisher:
publish-to-test-pypi.yml on DunlapCoddingPC/pyUSPTO
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pyuspto-0.5.2.tar.gz -
Subject digest:
40cd552be9fdd6c8f73e74546fa86d18cb1c122af83890d98cb4bfcef4f78807 - Sigstore transparency entry: 1320861334
- Sigstore integration time:
-
Permalink:
DunlapCoddingPC/pyUSPTO@6d8e43f2848a3ea8f9231f7cf00b608b5c4addb9 -
Branch / Tag:
refs/tags/v0.5.2 - Owner: https://github.com/DunlapCoddingPC
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-to-test-pypi.yml@6d8e43f2848a3ea8f9231f7cf00b608b5c4addb9 -
Trigger Event:
push
-
Statement type:
File details
Details for the file pyuspto-0.5.2-py3-none-any.whl.
File metadata
- Download URL: pyuspto-0.5.2-py3-none-any.whl
- Upload date:
- Size: 118.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
343dc41576d4a952cb35f7230962f1014f011895f9155dd9060b57fc10ff43d3
|
|
| MD5 |
1b9920e0cc04e63db9a0ca36c36ce476
|
|
| BLAKE2b-256 |
0548918d2396a3d3bcc939fd3a990abbcf769878a9c294125b03241e512ee176
|
Provenance
The following attestation bundles were made for pyuspto-0.5.2-py3-none-any.whl:
Publisher:
publish-to-test-pypi.yml on DunlapCoddingPC/pyUSPTO
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pyuspto-0.5.2-py3-none-any.whl -
Subject digest:
343dc41576d4a952cb35f7230962f1014f011895f9155dd9060b57fc10ff43d3 - Sigstore transparency entry: 1320861443
- Sigstore integration time:
-
Permalink:
DunlapCoddingPC/pyUSPTO@6d8e43f2848a3ea8f9231f7cf00b608b5c4addb9 -
Branch / Tag:
refs/tags/v0.5.2 - Owner: https://github.com/DunlapCoddingPC
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-to-test-pypi.yml@6d8e43f2848a3ea8f9231f7cf00b608b5c4addb9 -
Trigger Event:
push
-
Statement type: