Skip to main content
 
 
 
IN THIS SECTION
8 posts
aschulman
Last seen: 12/08/2024 - 10:14
Joined: 12/07/2024 - 13:53
Examples of successful g_claim GET or POST queries?

I have been unsuccessful trying to use the PatentsView APIs. I have an API key. I have tried from Python scripts, command line, and the Swagger UI. In Swagger, I received error messages about misformed JSON, fix the errors, and when it seems I've finally fixed all JSON errors, I then consistently receive a 429 error indicating excess requests, but this is after only 3 or 4 requests. I've waiting up to 24 hours between such sessions, with the same outcome. The only successful API request I've been able to make is the simplest one with /api/vs/patent/{patent} endpoint. The data I want however is: claim 1, USPC class, CPC class, assignee name. Any attempts to use endpoints such as g_claim have failed in the way described. Is there a source of known-working example GET or POST queries for data such as claim 1, USPC class, CPC class, and/or assignee name? Thank you.

Russ
Last seen: 12/08/2024 - 23:46
Joined: 11/14/2017 - 22:15
try these

Hi,

Below are the test queries we use in the R package that uses the new API.  You should be able to do a GET in Swagger UI by putting a query (what's inside the single quotes) into the q: parameter of its endpoint.  I've also included a curl command generated by Swagger UI that does a POST.

There's also this thread from a while back that might help with python coding https://patentsview.org/forum/8/topic/589   and the API team's jupyter notebook at https://github.com/PatentsView/PatentsView-Code-Snippets/blob/master/07_PatentSearch_API_demo/PV%20PatentSearch%20API%20tutorial.ipynb 

I hope this helps you!
Russ Allen
 

# Vector of queries (one for each endpoint) that are used during testing. We
# need this b/c in the new version of the api, only eleven of the endpoints are
# searchable by patent number (i.e., we can't use a generic patent number
# search query).  further, now patent_number is patent_id

TEST_QUERIES <- c(
  "assignee" = '{"_text_phrase":{"assignee_individual_name_last": "Clinton"}}',
  "cpc_class" = '{"cpc_class_id": "A01"}',
  "cpc_group" = '{"cpc_group_id": "A01B1/00"}',
  "cpc_subclass" = '{"cpc_subclass_id": "A01B"}',
  "g_brf_sum_text" = '{"patent_id": "11540434"}',
  "g_claim" = '{"patent_id": "11540434"}',
  "g_detail_desc_text" = '{"patent_id": "11540434"}',
  "g_draw_desc_text" = '{"patent_id": "11540434"}',
  "inventor" = '{"_text_phrase":{"inventor_name_last":"Clinton"}}',
  "ipc" = '{"ipc_id": "1"}',
  "location" = '{"location_name":"Chicago"}',
  "patent" = '{"patent_id":"5116621"}',
  "patent/attorney" = '{"attorney_id":"005dd718f3b829bab9e7e7714b3804a5"}',
  "patent/foreign_citation" = '{"patent_id": "10000001"}',
  "patent/other_reference" = '{"patent_id": "3930306"}',
  "patent/rel_app_text" = '{"patent_id": "10000007"}',
  "patent/us_application_citation" = '{"patent_id": "10966293"}',
  "patent/us_patent_citation" = '{"patent_id":"5116621"}',
  "pg_brf_sum_text" = '{"document_number": 20240324479}',
  "pg_claim" = '{"document_number": 20230000001}',
  "pg_detail_desc_text" = '{"document_number": 20230000001}',
  "pg_draw_desc_text" = '{"document_number": 20230000001}',
  "publication" = '{"document_number": 20010000002}',
  "publication/rel_app_text" = '{"document_number": 20010000001}',
  "uspc_mainclass" = '{"uspc_mainclass_id":"30"}',
  "uspc_subclass" = '{"uspc_subclass_id": "100/1"}',
  "wipo" = '{"wipo_id": "1"}'
)
curl -X 'POST' \
  'https://search.patentsview.org/api/v1/location/' \
  -H 'accept: application/json' \
  -H 'X-Api-Key: your_api_key_here' \
  -H 'Content-Type: application/json' \
  -d '{
  "f": ["location_id", "location_name", "location_state", "location_country" ],
  "o": {"size": 100 },
  "q": {"location_name":"Chicago"},
  "s": [ {"location_id": "asc"}  ]
}'
aschulman
Last seen: 12/08/2024 - 10:14
Joined: 12/07/2024 - 13:53
Thank you, Russ! Your …

Thank you, Russ! Your /location/ curl example worked for me. Now I'll try adopting for g_claim. Actually, I did and I got back a reply with no error, though I was expecting the text of a claim (presumably claim 1), but instead just received back the specified patent number (11540434) 20 times, corresponding to the number of claims in that patent, and no text for any claim. I see from the Swagger UI that one can supply "claim_sequence": "asc" , but I don't see a place to specify the claim number desired in the schema shown there:

{
 "f": [
   "patent_id",
   "claim_sequence",
   "claim_text"
 ],
 "o": {
   "size": 100
 },
 "q": {},
 "s": [
   {
     "patent_id": "asc"
   },
   {
     "claim_sequence": "asc"
   }
 ]
}

The link https://github.com/PatentsView/PatentsView-Code-Examples/blob/main/patentsearch/0-patentsearch-api-demo.ipynb unfortunately has 404 page not found.

Andrew

aschulman
Last seen: 12/08/2024 - 10:14
Joined: 12/07/2024 - 13:53
I think I&#039;ve got how to…

I think I've got how to specify the claim # I want, but same thing happened as with some attempts last week, trying to specify claim_sequence. I'm on Windows, and following from a Windows cmd/batch file:

curl -v -X POST ^
 "https://search.patentsview.org/api/v1/g_claim/" ^
 -H "accept: application/json" ^
 -H "X-Api-Key: my_api_key" ^
 -H "Content-Type: application/json" ^
 -d "{\"f\":[\"patent_id\",\"claim_sequence\",\"claim_text\"],\"o\":{\"size\":10000},\"q\":{\"patent_id\":\"11540434\",\"claim_sequence\":1},\"s\":[{\"patent_id\":\"asc\"}]}"

< X-Status-Reason: Query string should have only one 'key-value' pair

aschulman
Last seen: 12/08/2024 - 10:14
Joined: 12/07/2024 - 13:53
Need to use _and operator

Never mind, ChatGPT o1 helped me. It knows about the API, and told me I had to use the and operator. I then saw that claim 1 is claim_sequence 0. 

C:\work\ml>curl -v -X POST   "https://search.patentsview.org/api/v1/g_claim/"   -H "accept: application/json"   -H "X-Api-Key: ...my_api_key..."   -H "Content-Type: application/json"   -d "{\"f\":[\"patent_id\",\"claim_sequence\",\"claim_text\"],\"o\":{\"size\":10000},\"q\":{\"_and\":[{\"patent_id\":\"11540434\"},{\"claim_sequence\":0}]},\"s\":[{\"patent_id\":\"asc\"}]}"

{"error":false,"count":1,"total_hits":1,"g_claims":[{"patent_id":"11540434","claim_text":"1. A cultivating disc for a tillage implement, the cultivating disc comprising:\nan attachment portion positioned at a radial center of the cultivating disc, the attachment portion including at least one attachment feature configured to couple the cultivating disc to the tillage implement about an axis of rotation of the cultivating disc, wherein the attachment portion extends along a first plane perpendicular to the axis of rotation of the cultivating disc;\na cutting edge portion positioned at a distal end of the cultivating disc relative to the axis of rotation; and\na curved connecting portion positioned between and connecting the attachment portion to the cutting edge portion, the curved connecting portion having a concave side and a convex side, the curved connecting portion defining at least one radius of curvature,\nwherein the cultivating disc extends along the axis of rotation between a first side and a second side, the first side including the concave side of the curved connecting portion, the second side including the convex side of the curved connecting portion, and\nwherein the cutting edge portion extends along a second plane parallel to the first plane, with a surface of the cutting edge portion positioned on the second side of the cultivating disc being parallel to the second plane, the surface of the cutting edge portion positioned on the second side of the cultivating disc extending radially inwardly from the distal end of the cultivating disc towards the curved connecting portion.","claim_sequence":0}]}

Success. Thank you again, Russ!

aschulman
Last seen: 12/08/2024 - 10:14
Joined: 12/07/2024 - 13:53
That&#039;s great, thank you Russ…

That's great, thank you Russ!

Andrew