PatentSearch API Reference
Introduction
The PatentsView PatentSearch API is intended to inspire the exploration and enhanced understanding of US intellectual property (IP) and innovation systems. The database driving the API is regularly updated and integrates the best available tools for inventor disambiguation and data quality control. We hope researchers and developers alike will explore the API to discover people and companies and to visualize trends and patterns across the US innovation landscape.
Throughout this document, whenever the {} syntax is used, users are expected to replace it with valid values.
Authentication
API Keys
The PatentSearch API uses API Keys to authenticate requests but there are no specific authorization enforced. i.e. if you have an API Key you can access all publicly available endpoints.
-
All API requests must include the header
X-Api-Key: {your_key}infoCurrently, the API Keys do not expire but this may change in the future. If this changes, we will update the documentation here as well as communicate changes with the users via the patentsview website and the mailing list.
tipIf users previously used a browser to run API queries, due to the API key enforcement users will not be able use the same workflow. Alternatively either a standalone applications (such as Postman) or browser extension (such as RESTED in Firefox/Chrome) can be used to send one-off queries.
Usage Limits
Each API Key is allowed 45 requests/minute. If you exceed this limit, your API requests will fail. See HTTP Response Code for more details
Request an API Key
You can obtain an API key by submitting a request via the PatentsView Help Center. Each user is allowed only one API Key. If you lose your API key, please request a new one with same email address and name.
Please do not request/use multiple keys at the same time. If you do, your access may be revoked.
API Request
Structure of Request
An API request is made of 4 components:
- API Key - your authentication token (see Authentication)
- Endpoint – the specific API URL you are calling (See Endpoints Dictionary)
- Request Method – either GET or POST
- Request Parameters – the data you use to filter, sort, and paginate your results
Request Method
All PatentSearch API endpoints support two methods: GET and POST. Both GET and POST use/require the same set of parameters.
The PatentsView PatentSearch API endpoints don't allow users to submit data to our databases. The POST method is another mechanism for posting query parameters - it is used only to send query parameters; it does not add or update records in our database.
Request Parameters
There are 4 parameters that can be provided in a request. Each of the components is fully specified in the API Query Language section. Briefly:
- Query String(
q) - used to filter data - Field list (
f) - used to specify fields to return - Sorting (
s) - used to specify ordering - Options (
o) - used to specify additional options and pagination
Defaults
Each API endpoint is configured with appropriate defaults for the f, s and o parameters. When a user does not include
one or more these parameters, the defaults will be used.
Default behaviors:
- The q parameter is required; you must include it in every request.
- By default, the API will return 100 records. You can increase this up to 1,000 records—see Options (
o) section. - Results are sorted by the endpoint’s ID field in ascending order.
E.g.
patent_idis the default sort field for/patentendpoint. The full list of default sort fields can be found in the Endpoints Dictionary below.
API Response
HTTP Response Codes
The API returns standard HTTP status codes to indicate the result of your request. Here’s what each code means and how you can resolve common issues:
| Response Code | Description | Potential Resolution |
|---|---|---|
| 200 | Request Successfully Completed | |
| 400 | Request Invalid | Review X-Status-Reason and X-Status-Reason-Code response headers for more details |
| 403 | Forbidden | Verify that your API key is correctly entered and provided in your request headers with the key X-Api-Key |
| 404 | Resource not found | Verify the endpoint URL is correct. If using "GET" resource locator, verify the supplied ID is valid |
| 429 | Too many requests | Your application has exceeded the usage limits. Use Retry-After response header to identify wait duration before making the next request |
| 500 | Server Error | This is typically an error on our servers. Check the Service Status page and/or submit a support request |
Response Structure
Every API response will have the following structure:
error: a boolean flag indicating if the request succeeded or failedcount: total number of records returned in this responsetotal_hits: total number of records that matched the current query...: The final and the main data component on the response will be based on the endpoint used. (See individual Endpoints for their respective response keys)
Sample Response
Below is a simplified example of a typical API response:
{
"error": "boolean",
"count": "integer",
"total_hits": "integer",
...
}
API Query Language
Query String (q)
Query String Format
The query string is always a single JSON object: {}, with properties and contained objects that determine the
criteria for the query.
Note: To aid in understanding the structure of the queries below and while creating your own, it is helpful to use JSON validators and visual parsers, like http://www.jsoneditoronline.org/ and http://jsonlint.com/.
Syntax
q={criterion}
criterion
pair
"_eq" : {simple_pair}
"_neq" : {simple_pair}
"_gt" : {simple_pair}
"_gte" : {simple_pair}
"_lt" : {simple_pair}
"_lte" : {simple_pair}
"_begins" : {simple_pair}
"_contains" : {simple_pair}
"_text_all" : {simple_pair}
"_text_any" : {simple_pair}
"_text_phrase" : {simple_pair}
"_not" : {criterion}
"_and" : [{criterion}, ...]
"_or" : [{criterion}, ...]
pair
simple_pair
"field" : [value, ...]
simple_pair
"field" : value
When working with text data fields, wherever possible, we recommend using _text* operators over the _contains and _begins operator. The text operators treat these fields as full text data and hence are more performant. The "full text" fields are identified in the API Endpoint specification with the value "text" for the data type.
Single Criterion (Equals operator)
The basic criterion, which checks for equality, has the format: {<field>:<value>}, where <field> is the name of a
database field and <value> is the value the field will be compared to for equality (Each API Endpoint section contains
a list of the data fields that can be selected for inclusion in output datasets)
For example, this query string will return the patent with the patent number of 7861317:
https://search.patentsview.org/api/v1/patent/?q={"patent_id":"7861317"}
Comparison Operators
Comparison operators can be used to compare a field to a value using comparators other than equality. The available comparison operators are:
| Operator | Description | Applies to |
|---|---|---|
_eq | Equal to | Numbers, dates, strings |
_neq | Not equal to | Numbers, dates, strings |
_gt | Greater than | Numbers, dates |
_gte | Greater than or equal to | Numbers, dates |
_lt | Less than | Numbers, dates |
_lte | Less than or equal to | Numbers, dates |
_begins | String begins with value | Strings |
_contains | String contains value | Strings |
_text_all | Text contains all specified words | Full text fields |
_text_any | Text contains any of the specified words | Full text fields |
_text_phrase | Text contains the exact phrase | Full text fields |
To specify a comparison operator for a criterion, nest the element containing the criterion inside an element that uses the comparison operator.
For example, this query string will return all patents that have a grant date on or after January 9, 2007:
https://search.patentsview.org/api/v1/patent/?q={"_gte":{"patent_date":"2007-01-09"}}
The query string q={"_eq":{"patent_date":"2007-01-09"}} is functionally equivalent to q={"patent_date":"2007-01-09"}
Negation
Negation does the opposite of the specified comparison. To specify the negation operator for a criterion, nest the element containing the criterion inside an element that uses the negation operator: _not.
For example, this query string will return all patents that are not design patents:
https://search.patentsview.org/api/v1/patent/?q={"_not":{"patent_type":"design"}}
Value Arrays
If the value of a criterion is an array, then the query will accept a match of any one of the array values.
For example, this query will return all patents that have "Whitney" or "Hopper" as an inventor:
https://search.patentsview.org/api/v1/patent/?q={"inventors.inventor_name_last":["Whitney","Hopper"]}
Join (Conjunction) Operators
Multiple criteria can be added to a query using a join operator (_and, _or) and putting the criteria in an array
using square brackets ("[" and "]").
The following has multiple criteria, and will return patents that have "Whitney" as an inventor and a grant date of October 6, 1981:
https://search.patentsview.org/api/v1/patent/?q={"_and":[{"inventors.inventor_name_last":"Whitney"},{"patent_date":"1981-10-06"}]}
Complex Combinations
These elements, criteria, arrays, and operators can be combined to define robust queries. A few examples:
Patents with a grant date in 2007:
https://search.patentsview.org/api/v1/patent/?q={"_and":[{"_gte":{"patent_date":"2007-01-01"}},
{"_lte":{"patent_date":"2007-12-31"}}]}
Patents with an inventor with the last name of "Whitney" or "Hopper" and not a design patent and with a grant date in 2007:
https://search.patentsview.org/api/v1/patent/?q={"_and":[{"inventors.inventor_name_last":["Whitney","Hopper"]},
{"_not":{"patent_type":"design"}},
{"_gte":{"patent_date":"2007-01-01"}},
{"_lte":{"patent_date":"2007-12-31"}}]}
Patents with an inventor with the last name of "Whitney" or "Hopper" or with a title that contains "cotton" or "gin" or "COBOL":
https://search.patentsview.org/api/v1/patent/?q={"_or":[{"inventors.inventor_name_last":["Whitney","Hopper"]},
{"_text_any":{"patent_title":"COBOL cotton gin"}}]}
Patents with an inventor with the last name of "Whitener" and with "cotton gin" in the title, or with an inventor with the last name of "Heath" and with "COBOL" in the title:
https://search.patentsview.org/api/v1/patent/?q={"_or":[{"_and":[{"inventors.inventor_name_last":"Whitener"},{"_text_phrase":{"patent_title":"cotton gin"}}]},
{"_and":[{"inventors.inventor_name_last":"Heath"},{"_text_all":{"patent_title":"COBOL"}}]}]}
Formats
Dates are expected to be in ISO 8601 date format: YYYY-MM-DD.
Nested fields follow the format <field>.<nested_field>