Skip to main content
 
 
 
IN THIS SECTION
2 posts
TrevorWysong
Last seen: 09/12/2024 - 22:24
Joined: 09/10/2024 - 11:25
Bug with POST /api/v1/patent/

I am using the PatentsSearch API here:


https://search.patentsview.org/swagger-ui/  



The “o” field in the request body does not impact the request (it seems to be ignored). I am using the POST endpoint instead of the GET endpoint to fetch patents because it allows me to make a request with a more complex query (a long query does not fit within a URL via query params, so needs payload via POST).

You can replicate this with the following example request body:

{   "f"["patent_id","patent_date","patent_earliest_application_date","patent_title","patent_date","patent_type","patent_abstract","assignees.assignee_organization","inventors.inventor_name_first","inventors.inventor_name_last","inventors.inventor_city","inventors.inventor_state","inventors.inventor_country"],
"o": {"size":5,"after":"11191202"},
"q": {"_or": [{"assignees.assignee_organization": "Sierra Nevada Company, LLC"}, {"assignees.assignee_organization": "TEXAS A&M TRANSPORTATION INSTITUTE"}] }
}

You’ll notice in the response, instead of the count being 5, the count will default to 100. It will also not use the “after” param. I believe the same logic for applying the optional param to the get endpoint just needs to be applied to the POST endpoint since it works well for me there. Without this, I am unable to paginate or set my own limit for a response.

TrevorWysong
Last seen: 09/12/2024 - 22:24
Joined: 09/10/2024 - 11:25
Jack from PatentsView noted…

Jack from PatentsView noted the bug and helped resolve this using a workaround by including the sorting ("s") field to my request like so:
"s": [{"patent_id": "asc"}]