USPTO Open Data Portal client library released
I've released a comprehensive Go client library for the USPTO Open Data Portal API. The library provides complete coverage of all 19 functional endpoints across patent applications, bulk data downloads, and petition decisions.
Technical Approach
USPTO provides an official Swagger v2 specification for their ODP API. However, the spec contained numerous type mismatches with actual API responses - numeric fields defined as strings, array types that should be objects, date format constraints on non-ISO timestamps.
I created a corrected OpenAPI specification by testing each endpoint against the live API and documenting the real response structures. The most significant fixes included correcting applicationConfirmationNumber and prosecutionStatusCode from strings to numbers, restructuring BulkDataProductBag from a type alias to a proper object, and adding the missing file download endpoint entirely absent from the original swagger.
This fixed specification drives code generation via oapi-codegen, wrapped in an idiomatic Go interface with automatic retry logic, proper timeout handling, and comprehensive error types.
Complete Endpoint Coverage
The library currently implements all three API categories:
Patent Application API provides 13 endpoints covering patent search, metadata retrieval, adjustment and continuity data, document downloads, assignments, attorney information, foreign priority, and transaction history. The GetStatusCodes endpoint serves as the most reliable health check for the API.
Bulk Data API offers 3 endpoints for discovering and downloading large datasets. The implementation includes progress callback support for multi-gigabyte file downloads, essential for USPTO's weekly patent grant XML files and similar bulk products.
Petition Decision API implements 3 endpoints for searching and retrieving PTAB petition decisions with optional document attachments.
Production Ready
Comprehensive testing includes both unit tests with mock servers based on real API responses and integration tests against the live USPTO API. The integration test suite validates all swagger fixes and ensures compatibility with actual endpoint behavior. Error handling covers authentication failures, rate limiting, and network issues with exponential backoff.
Configuration options support custom base URLs, user agents, and retry behavior. The library requires API keys from USPTO's registration process, which includes video verification for account security.
This follows the same engineering approach I used for the EPO OPS and EPO BDDS clients, ensuring consistent quality across patent data integrations.
Repository: github.com/patent-dev/uspto-odp
License: MIT
Additional patent data clients remain in development, including DPMA Connect Plus integration. For consulting on patent data infrastructure or expertise in building robust API clients, reach out through info@patent.dev.