
Scraping Patent Citations for Prior Art Research with Python
Patent citation analysis reveals technological lineage. Automated prior art search saves thousands in legal fees. USPTO PatentsView API import requests , time from collections import defaultdict class PatentScraper : def __init__ ( self ): self . s = requests . Session () self . s . headers [ " User-Agent " ] = " PatentResearch/1.0 " def search ( self , query , n = 50 ): r = self . s . post ( " https://api.patentsview.org/patents/query " , json = { " q " :{ " _text_any " :{ " patent_abstract " : query }}, " f " :[ " patent_number " , " patent_title " , " patent_date " , " patent_abstract " , " assignee_organization " , " cited_patent_number " , " citedby_patent_number " ], " o " :{ " page " : 1 , " per_page " : n }, " s " :[{ " patent_date " : " desc " }]}) return r . json (). get ( " patents " ,[]) if r . status_code == 200 else [] def details ( self , pn ): r = self . s . post ( " https://api.patentsview.org/patents/query " , json = { " q " :{ " patent_number " : pn }, " f " :[ " pat
Continue reading on Dev.to Tutorial
Opens in a new tab




