Skip to main content
 
 
 
IN THIS SECTION
7 posts
WW
Last seen: 03/17/2021 - 13:55
Joined: 03/10/2021 - 11:14
Internal server error

Hi,

I'm querying the API using using the POST method. Often it works, but I also get a lot of internal server errors. Sometimes when I get a server error I retry the same query and it works, so it appears the queries are not the problem. Any idea why this happens?

Here's an example of a query:

url = https://api.patentsview.org/patents/query

body = {"q": {"_and": [{"_gte": {"patent_date": "1990-02-01"}}, {"_lt": {"patent_date": "1990-03-01"}}]}, "f": ["patent_number", "patent_year", "patent_date", "app_date", "app_number", "patent_processing_time", "patent_average_processing_time", "patent_kind", "patent_type", "patent_title", "assignee_sequence", "assignee_id", "assignee_type", "assignee_organization", "assignee_first_name", "assignee_last_name", "assignee_country", "assignee_state", "assignee_city", "assignee_latitude", "assignee_longitude", "assignee_first_seen_date", "assignee_last_seen_date", "inventor_sequence", "inventor_id", "inventor_first_name", "inventor_last_name", "inventor_country", "inventor_state", "inventor_city", "inventor_latitude", "inventor_longitude", "inventor_first_seen_date", "inventor_last_seen_date", "nber_category_id", "nber_subcategory_id", "cpc_sequence", "cpc_category", "cpc_section_id", "cpc_subsection_id", "cpc_group_id", "cpc_subgroup_id"], "o": {"page": 1, "per_page": 10000}}

Russ
Last seen: 03/15/2024 - 23:34
Joined: 11/14/2017 - 22:15
RECENT MOVE TO BEANSTALK

It might have something to do with the recent move to beanstalk.  I referenced your post in an open git issue.  A possible work around would be to lower per_page and make multiple calls but what tried looks like it should work.

WW
Last seen: 03/17/2021 - 13:55
Joined: 03/10/2021 - 11:14
THANK YOU RUSS. I TRIED…

Thank you Russ. I tried lowering the per_page parameter. 5000 still gives a lot of errors, but 3000 works perfectly.

Russ
Last seen: 03/15/2024 - 23:34
Joined: 11/14/2017 - 22:15
ANY CHANGE

WW,

Do you still getting internal server errors with the higher per_page?  The git issue where I mentioned your problem has been closed (your problem wasn't related to what the issue was opened for).  Wondering if a new issue should be opened for  your problem.

Thanks,
Russ

WW
Last seen: 03/17/2021 - 13:55
Joined: 03/10/2021 - 11:14
ONLY GETTING WORSE...

Hi Russ,

Sorry for the late response, I was on holidays. 

The issue is still the same and in fact appears to be getting worse, per_page=3000 fails most of the time now so I have to lower it to 1000, which also fails quite a lot. This is the case with the query mentioned in #1 but also when I lower the number of fields to about 10. 

WW
Last seen: 03/17/2021 - 13:55
Joined: 03/10/2021 - 11:14
AND WORSE

Getting internal server errors now with per_page=100, making it very time-costly to use the API effectively.

I opened an issue on GitHub here.

bradchattergoon
Last seen: 05/18/2021 - 14:17
Joined: 03/17/2021 - 14:08
ALSO HAVING ISSUE

Hello. Have there been any updates on this problem? I am also having the problem.