Skip to main content

Search and retrieve USPTO patent data

Project description


Search for and retrieve US Patent and Trademark Office Patent Data

PyPI page


Python 3, BeautifulSoup, requests, re


pip install pypatent

Searching for Patents

The search function works similarly to the Advanced Search at the USPTO

def search(string=None, results_limit=50, pn=None, isd=None, ttl=None, abst=None, aclm=None, spec=None, ccl=None, cpc=None, cpcl=None, icl=None, apn=None, apd=None, apt=None, govt=None, fmid=None, parn=None, rlap=None, rlfd=None, prir=None, prad=None, pct=None, ptad=None, pt3d=None, pppd=None, reis=None, rpaf=None, afff=None, afft=None, in_=None, ic=None, is_=None, icn=None, aanm=None, aaci=None, aast=None, aaco=None, aaat=None, lrep=None, an=None, ac=None, as_=None, acn=None, exp=None, exa=None, ref=None, fref=None, oref=None, cofc=None, reex=None, ptab=None, sec=None, ilrn=None, ilrd=None, ilpd=None, ilfd=None)

You may specify just the string argument to search for a certain string in all fields. For example:

search('microsoft') # Will return results matching 'microsoft' in any field

You may also use the string argument to specify complex search criteria as demonstrated on the USPTO site. For example:

search('TTL/(tennis AND (racquet OR racket))')

Alternatively (or in conjunction with the string criteria as described below), you can specify one or more Field Code arguments to search within the specified fields. Multiple Field Code arguments will create a search with AND logic. OR logic can be used within a single argument. For more complex logic, use a custom string.

search(pn='adobe', ttl='software') # Equivalent to search('PN/adobe AND TTL/software')
search(pn=('adobe or macromedia'), ttl='software') # Equivalent to search('PN/(adobe or macromedia) AND TTL/software')

String criteria can be used in conjunction with Field Code arguments:

search('acrobat', pn='adobe', ttl='software') # Equivalent to search('acrobat AND PN/adobe AND TTL/software')

The Field Code arguments have the same meaning as on the USPTO site.

The results_limit argument lets you change how many patent results are retrieved. The default is 50, equivalent to one page of results.

Search results are returned as a list of patent numbers, patent titles, and links:

[[patent_number_1, patent_title_1, patent_link_1], ..., [patent_number_n, patent_title_n, patent_link_n]]

Retrieving Patent Details: The patent Class

Use the patent class to retrieve patent details for a given patent URL.

this_patent = patent('')

The following attributes are retrieved:

  • patent_num: Patent Number
  • patent_date: Issue Date
  • abstract: Abstract
  • inventors: List of Names of Inventors and Their Locations
  • applicant_name: Applicant Name
  • applicant_city: Applicant City
  • applicant_state: Applicant State
  • applicant_country: Applicant Country
  • assignee_name: Assignee Name
  • assignee_loc: Assignee Location
  • family_id: Family ID
  • applicant_num: Applicant Number
  • file_date: Filing date
  • claims: Claims Description (as a list)
  • description: Patent Description (as a list)

Field Code Arguments for Search Function

  • PN: Patent Number
  • ISD: Issue Date
  • TTL: Title
  • ABST: Abstract
  • ACLM: Claim(s)
  • SPEC: Description/Specification
  • CCL: Current US Classification
  • CPC: Current CPC Classification
  • CPCL: Current CPC Classification Class
  • ICL: International Classification
  • APN: Application Serial Number
  • APD: Application Date
  • APT: Application Type
  • GOVT: Government Interest
  • FMID: Patent Family ID
  • PARN: Parent Case Information
  • RLAP: Related US App. Data
  • RLFD: Related Application Filing Date
  • PRIR: Foreign Priority
  • PRAD: Priority Filing Date
  • PCT: PCT Information
  • PTAD: PCT Filing Date
  • PT3D: PCT 371 Date
  • PPPD: Prior Published Document Date
  • REIS: Reissue Data
  • RPAF Reissued Patent Application Filing Date
  • AFFF: 130(b) Affirmation Flag
  • AFFT: 130(b) Affirmation Statement
  • IN: Inventor Name
  • IC: Inventor City
  • IS: Inventor State
  • ICN: Inventor Country
  • AANM: Applicant Name
  • AACI: Applicant City
  • AAST: Applicant State
  • AACO: Applicant Country
  • AAAT: Applicant Type
  • LREP: Attorney or agent
  • AN: Assignee Name
  • AC: Assignee City
  • AS: Assignee State
  • ACN: Assignee Country
  • EXP: Primary Examiner
  • EXA: Assistant Examiner
  • REF: Referenced By
  • FREF: Foreign References
  • OREF: Other References
  • COFC: Certificate of Correction
  • REEX: Re-Examination Certificate
  • PTAB: PTAB Trial Certificate
  • SEC: Supplemental Exam Certificate
  • ILRN: International Registration Number
  • ILRD: International Registration Date
  • ILPD: International Registration Publication Date
  • ILFD: Hague International Filing Date

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
pypatent-1.0.2-py3-none-any.whl (5.1 kB) Copy SHA256 hash SHA256 Wheel py3 Apr 16, 2018
pypatent-1.0.2.tar.gz (5.4 kB) Copy SHA256 hash SHA256 Source None Apr 16, 2018

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page