Skip to main content
 
 
 
IN THIS SECTION
7 posts
usman.chaudhry
Last seen: 06/13/2019 - 15:35
Joined: 06/11/2019 - 07:31
API Download Limit

Hi all, 

I'm trying to get names of all inventors for a given country using the following Python script:

url = 'http://www.patentsview.org/api/inventors/query'

query = '{"q":{"_and":[{"inventor_lastknown_country": "CA"}, {"_gte":{"patent_date": "2000-01-01"}}]},' \ '"f":["inventor_id", "inventor_last_name", "inventor_first_name", "inventor_lastknown_country"]}'

results = requests.post(url, data=query)

json_results = results.json()

There are 70891 inventors that match this query; however, the JSON object only has 25 inventors. Any idea how can I get them all? My understanding is that using POST rather than GET should help with it.

Thank you in advance.

 

Russ
Last seen: 12/04/2024 - 23:18
Joined: 11/14/2017 - 22:15
paging

25 is the api's default page size but you can request up to 10,000 results at a time.  You'll need to page to get all the results.  Add o:{"page":1,"per_page":10000}  and keep requesting the next page until you've requested 8 pages.  A POST or GET would return the same results.   See http://www.patentsview.org/api/query-language.html#options_parameter.  

Russ

usman.chaudhry
Last seen: 06/13/2019 - 15:35
Joined: 06/11/2019 - 07:31
Paging

Thank you, Russ. 

PVTeam
Role: moderator
Last seen: 11/29/2024 - 15:02
Joined: 10/17/2017 - 10:47
Re: API DOWNLOAD LIMIT

Hi Usman and Russ,

Russ - Thank you for your response!

Usman - Russ was correct: you will need to use paging to get the results you want.

Let us know if you have any questions.

Thanks,

PVTeam

dahutonale
Last seen: 08/23/2019 - 05:00
Joined: 10/16/2017 - 10:30
Paging limit

Dears,

A quick follow up question.

I am downloading a large amount of data and I have set the page limit at the max (10000).

I receive 10000 observations up to the 10th page and then nothing on the 11th page.

I was then wondering if it is a coincidence that my quiery finishes precisely at the 100000th patent or if there is a page limit of 10 pages.

I could not find any info on paging limit.

Thanks in advance.

Russ
Last seen: 12/04/2024 - 23:18
Joined: 11/14/2017 - 22:15
100K Hard limit

The 100,000 results is a hard limit. You would need to add a date range or something to your query to stay under that limit. Ex ask for all utility patents and you'll run into the hard limit long before you could retrieve them all.  http://www.patentsview.org/api/patents/query?q=%7B%22patent_type%22%3A%22Utility%22%7D

There is a chance you are getting lucky with exactly 100K results but odds are you've hit the hard limit.

In my previous reply I should have mentioned the python wrapper though it has the same underlying hard limit. My fork implements pagings. The upstream repo doesn't page,  pending acceptance of my pull request. https://github.com/mustberuss/PatentsView-APIWrapper

Russ

dahutonale
Last seen: 08/23/2019 - 05:00
Joined: 10/16/2017 - 10:30
Thanks!!

Thanks!!