pub struct UsptoPatentClient { /* private fields */ }Expand description
Client for USPTO PatentsView API (PatentSearch API v2)
PatentsView provides free access to USPTO patent data with no authentication required. Uses the new PatentSearch API (ElasticSearch-based) as of May 2025. API documentation: https://search.patentsview.org/docs/
Implementations§
Source§impl UsptoPatentClient
impl UsptoPatentClient
Sourcepub fn new() -> Result<Self>
pub fn new() -> Result<Self>
Create a new USPTO PatentsView client
No authentication required for the PatentsView API. Uses the new PatentSearch API at search.patentsview.org
Sourcepub async fn search_patents(
&self,
query: &str,
max_results: usize,
) -> Result<Vec<SemanticVector>>
pub async fn search_patents( &self, query: &str, max_results: usize, ) -> Result<Vec<SemanticVector>>
Search patents by keyword query
§Arguments
query- Search keywords (e.g., “artificial intelligence”, “solar cell”)max_results- Maximum number of results to return (max 1000 per page)
§Example
ⓘ
let client = UsptoPatentClient::new()?;
let patents = client.search_patents("quantum computing", 50).await?;Sourcepub async fn search_by_assignee(
&self,
company_name: &str,
max_results: usize,
) -> Result<Vec<SemanticVector>>
pub async fn search_by_assignee( &self, company_name: &str, max_results: usize, ) -> Result<Vec<SemanticVector>>
Sourcepub async fn search_by_cpc(
&self,
cpc_class: &str,
max_results: usize,
) -> Result<Vec<SemanticVector>>
pub async fn search_by_cpc( &self, cpc_class: &str, max_results: usize, ) -> Result<Vec<SemanticVector>>
Search patents by CPC classification code
§Arguments
cpc_class- CPC classification (e.g., “Y02E” for climate tech energy, “G06N” for AI)max_results- Maximum number of results to return
§Example - Climate Change Mitigation Technologies
ⓘ
let climate_patents = client.search_by_cpc("Y02", 200).await?;§Common CPC Classes
Y02- Climate change mitigation technologiesY02E- Climate tech - Energy generation/transmission/distributionG06N- Computing arrangements based on AI/ML/neural networksA61- Medical or veterinary scienceH01- Electric elements (batteries, solar cells, etc.)
Sourcepub async fn get_patent(
&self,
patent_number: &str,
) -> Result<Option<SemanticVector>>
pub async fn get_patent( &self, patent_number: &str, ) -> Result<Option<SemanticVector>>
Sourcepub async fn get_citations(
&self,
patent_number: &str,
) -> Result<(Vec<SemanticVector>, Vec<SemanticVector>)>
pub async fn get_citations( &self, patent_number: &str, ) -> Result<(Vec<SemanticVector>, Vec<SemanticVector>)>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for UsptoPatentClient
impl !RefUnwindSafe for UsptoPatentClient
impl Send for UsptoPatentClient
impl Sync for UsptoPatentClient
impl Unpin for UsptoPatentClient
impl !UnwindSafe for UsptoPatentClient
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more