Authentication overview

PatentsView offers open access to its patent data API, distinguishing it from many commercial and public APIs that typically require API keys or OAuth tokens for authentication and authorization. This design choice supports its mission to provide free, public access to U.S. patent data for research, analysis, and innovation trend identification. Developers and researchers can query the PatentsView API directly via HTTP requests without needing to register for credentials or manage authentication tokens.

While the absence of explicit authentication simplifies access, users are expected to adhere to fair use policies. These policies generally involve making reasonable request volumes and avoiding practices that could disrupt service for others. The PatentsView platform is primarily designed to facilitate academic research and public policy analysis, enabling broad utilization of patent information without the administrative overhead of credential management.

Supported authentication methods

Unlike most APIs, PatentsView does not implement traditional authentication methods such as API keys, OAuth 2.0, or token-based authentication. Access to the PatentsView API is entirely public and open, meaning that any HTTP client can make requests to its endpoints without providing specific credentials. This approach eliminates the need for developers to manage secrets, implement authentication flows, or refresh tokens, thereby simplifying the integration process significantly.

Authentication methods table

Method When to Use Security Level Notes
No Authentication Required All standard API requests to PatentsView Public Access Simplifies integration; no credential management needed. Access is open to all users.

The decision to offer unauthenticated access aligns with the platform's public service mandate. For APIs that do require authentication, methods like OAuth 2.0 provide secure delegated access, while API keys offer a simpler form of client identification and access control, as detailed in the OAuth 2.0 specification. PatentsView bypasses these for maximum accessibility.

Getting your credentials

As the PatentsView API operates on an open-access model, developers do not need to obtain or manage any API keys, tokens, or other credentials. There is no registration process required to begin making API requests. Users can start querying the API directly by constructing HTTP requests to the documented endpoints.

This absence of a credentialing process means:

  • No account signup is necessary on the PatentsView website.
  • There are no API keys to generate, store, or rotate.
  • OAuth 2.0 flows (e.g., authorization code grant, client credentials grant) are not applicable.
  • No secret keys or client IDs need to be managed securely.

For detailed information on available endpoints and query parameters, refer to the official PatentsView API documentation.

Authenticated request example

Since PatentsView does not require authentication, an "authenticated" request is simply a standard HTTP GET request to one of its endpoints. The following examples demonstrate how to retrieve data using common command-line tools and programming languages.

Example: Fetching patents by inventor name

This example retrieves patents associated with a specific inventor. No authentication headers or parameters are included.

cURL example

curl "https://www.patentsview.org/api/patents/query?q={\"inventor_first_name\":\"john\",\"inventor_last_name\":\"smith\"}&f=[\"patent_number\",\"patent_title\"]"

Python example (using requests library)


import requests
import json

base_url = "https://www.patentsview.org/api/patents/query"

query_params = {
    "q": {
        "_and": [
            {"inventor_first_name": "john"},
            {"inventor_last_name": "smith"}
        ]
    },
    "f": [
        "patent_number",
        "patent_title",
        "patent_abstract"
    ]
}

# Encode the query and fields as JSON strings for the 'q' and 'f' parameters
params = {
    "q": json.dumps(query_params["q"]),
    "f": json.dumps(query_params["f"])
}

response = requests.get(base_url, params=params)

if response.status_code == 200:
    data = response.json()
    print(json.dumps(data, indent=2))
else:
    print(f"Error: {response.status_code}")
    print(response.text)

JavaScript example (Node.js using node-fetch)


const fetch = require('node-fetch');

async function getPatentsByInventor() {
  const base_url = "https://www.patentsview.org/api/patents/query";

  const query_obj = {
    _and: [
      { inventor_first_name: "john" },
      { inventor_last_name: "smith" }
    ]
  };

  const fields_obj = [
    "patent_number",
    "patent_title",
    "patent_abstract"
  ];

  const params = new URLSearchParams({
    q: JSON.stringify(query_obj),
    f: JSON.stringify(fields_obj)
  });

  try {
    const response = await fetch(`${base_url}?${params.toString()}`);
    if (!response.ok) {
      throw new Error(`HTTP error! Status: ${response.status}`);
    }
    const data = await response.json();
    console.log(JSON.stringify(data, null, 2));
  } catch (error) {
    console.error("Error fetching patents:", error);
  }
}

getPatentsByInventor();

These examples illustrate that no special headers like Authorization or query parameters for API keys are required. The entire request focuses on constructing the correct query and field parameters as specified in the PatentsView data documentation.

Security best practices

While PatentsView does not require authentication, security best practices still apply to how you integrate and manage data retrieved from the API. These practices primarily focus on data handling, application security, and responsible API consumption.

  1. Validate and Sanitize Inputs: Even without authentication, constructing API queries often involves dynamic input. Always validate and sanitize user-provided input before incorporating it into API requests to prevent injection vulnerabilities or malformed queries. This practice is a fundamental aspect of secure application development, as highlighted in the Mozilla Web Security documentation on injection attacks.
  2. Handle API Responses Securely: The data retrieved from PatentsView may contain sensitive patent information. Ensure that your application processes, stores, and displays this data in a secure manner. Implement proper access controls if you are making the data available to end-users, and encrypt data at rest and in transit within your own systems.
  3. Implement Rate Limiting (Client-Side): Although PatentsView does not enforce explicit rate limits via API keys, it is good practice to implement client-side rate limiting or request throttling in your applications. This prevents accidental overload of the PatentsView servers and ensures fair usage, especially during development or when processing large datasets. Check the PatentsView documentation for any stated usage policies.
  4. Error Handling and Logging: Robust error handling is crucial. Implement mechanisms to catch and log API errors (e.g., HTTP 4xx or 5xx responses). This helps in debugging and identifying issues, such as malformed requests or temporary service disruptions, without exposing sensitive internal application details to end-users.
  5. Secure Data Storage: If you cache or store PatentsView data locally, ensure that your storage mechanisms are secure. This includes using encrypted databases, restricting file system access, and implementing strong authentication for access to your data stores. This is particularly important if the retrieved data is combined with other potentially sensitive information within your application.
  6. Monitor Usage: Even for unauthenticated APIs, monitoring your application's API usage patterns can help identify unexpected behavior, potential misuse, or performance bottlenecks in your own system. Tools for logging request volumes and response times can be beneficial.
  7. Keep Dependencies Updated: Ensure that all libraries, frameworks, and operating systems used in your application are kept up to date. This helps protect against known vulnerabilities that could be exploited even when interacting with unauthenticated external services.
  8. Understand Data Licensing: Review the terms of use and data licensing for PatentsView data to ensure your application's use case is compliant. While access is open, there may be specific attribution requirements or restrictions on how the data can be redistributed or commercialized. The PatentsView data documentation is the authoritative source for these details.

By following these best practices, developers can ensure that their applications interact responsibly with the PatentsView API and maintain a secure environment for processing and utilizing the retrieved patent data.