Skip to content

Commit

Permalink
Merge pull request #6 from mikeym88/switch-to-new-api-version
Browse files Browse the repository at this point in the history
Switch to new api version
  • Loading branch information
mikeym88 authored Jan 15, 2023
2 parents b05d513 + a1b936b commit 9c79a55
Show file tree
Hide file tree
Showing 2 changed files with 243 additions and 158 deletions.
18 changes: 8 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,19 @@

This project is a wrapper for the PatentsView API.

* [PatentsView Glossary](http://www.patentsview.org/api/glossary.html) provides a description of the variables.
* [PatentsView Glossary](https://patentsview.org/glossary) provides a description of the variables.

## Similar Projects

* The Patents Client project is a Python client for patents: [PyPI](https://pypi.org/project/patent-client/) | [GitHub](https://github.com/parkerhancock/patent_client) | [Docs](https://patent-client.readthedocs.io/en/latest/).

## Important Notes:

* Use <https://dev.patentsview.org> and not <https://www.patentsview.org/>; the former is laxer in terms of accepting input
* Naming is finicky (more so on the second one), even spacing and other character affect the search results (see below).
* An API key is required, one can be requested [here](https://patentsview.org/apis/keyrequest).
* There needs to be an environmental variable PATENTSVIEW_API_KEY set to the value of your API key.
* The endpoints of the new version of the API are at <https://search.patentsview.org>, they had last been at <https://api.patentsview.org/>.
* The API team produced a [Swagger UI page](https://search.patentsview.org/swagger-ui/) for the new version of the API. Your API key can be entered by pressing the Authorize button.
* The new version of the API now returns USPC classifications, but we'll use CPC classifications. After May 2015 the patent office stopped assigning USPCs to utility patents.

## Remarks about the data

Expand All @@ -21,15 +24,10 @@ This project is a wrapper for the PatentsView API.
* As an example: `NETFLIX, INC.` has an `assignee_key_id` of `17594` and an `assignee_id` of `org_2lAuxOpAtNMvtTxhuLmX`; `NETFLIX.COM, INC.` on the other hand an `assignee_key_id` of `org_UNHkzir8tY7NlQrOJKT4` and an `assignee_id` of `363028`. (This of course assumes `NETFLIX, INC.` and `NETFLIX.COM, INC.` are the same company, which is highly probable).
* The same applies for acquisitions. Example: Company A has patent *X*; once company B acquires company A, patent *X* would still show that it is assigned to company *A*.
* Probably the same thing holds if a company acquires certain patents of another company.
* The patents can be assigned to organizations (as opposed to individuals). This is indicated by the 'assignee organization' field returned by the API.
* The patents can be assigned to organizations (as opposed to individuals). This is indicated by the 'assignees.assignee_organization' field returned by the API.
* The assignee organizations (i.e. companies) are distinguished by name. Each organization name is a 'separate' company.
* This means that a patent can be assigned to "IBM", "IBM Inc.", "International Business Machines".
* Different organization names have different `assignee_id`s and `assignee_key_id`s (see `NETFLIX` example above).
* **Different endpoints behave differently**: particularly <https://www.patentsview.org/> and <https://dev.patentsview.org>
* **Naming is finicky on the first one**: If you search for `Abbott Laboratories` or for `ABBOTT LABORATORIES`,
you will get the same results. If you search for `ABBOTT Laboratories`, `Abbott LABORATORIES`,
or `abbott laboratories`, you will get nothing.
* The second one seems to work better, but you still have to replace the carriage return and line break characters.

## Adding companies

Expand Down Expand Up @@ -100,7 +98,7 @@ SELECT
an.name as "Company Name Listed on Patent",
p.year,
p.grant_date as "Grant Date",
p.uspc_class as "USPC Classes"
p.cpc_group_id as "CPC Subsections"
FROM
patents as p
JOIN
Expand Down
Loading

0 comments on commit 9c79a55

Please sign in to comment.