Getting Started with the PatentsView Developer API

PatentsView is an ongoing project of the United States Patent and Trademark Office (USPTO) that makes patent data accessible through a constellation of public interfaces, including an in-browser search tool and a developer API. These tools aim to facilitate access to government information, promote exploration and analysis of the USPTO’s patent database, and enable users to discover patterns in innovation.

At Periscopic, we are working with the USPTO to enhance PatentsView’s search tool with interactive visualizations that emphasize the relationships between inventions, inventors, companies, and places. The best part is, the data source we’re using is publicly accessible: the PatentsView developer API.

In this series of blog posts, we’ll be sharing our experience with the PatentsView API, and providing some tips and tricks to help you structure queries and format data for visualization. This first post is a walkthrough that focuses on quickly visualizing patent data in D3. Later posts will dive deeper into the API’s features, and discuss techniques for data transformations.

Hello PatentsView!

PatentsView organizes patent data using a handful of criteria, which also relate to endpoints for the developer API:

  • Patents: At its core, the PatentsView database is a repository of patents. Each piece of information stored in the database relates to a patent granted by the USPTO.
  • Assignees: Assignees are entities that are issued patents. Broadly, assignees are legal entities, like companies, institutions, or individuals. An assignee may have many patents. And, occasionally, a patent may have more than one assignee.
  • Inventors: Inventors are the people responsible for the innovation that is captured in the patent. A patent may credit many inventors.
  • Locations: When the USPTO issues a patent, it records the current location for the patent’s assignee and inventors. Location data comes in many degrees of specificity, from the name of the assignee or inventor’s country to their city.
  • Classification Schemes: Each patent is also categorized into standardized classification systems. The USPTO categorizes patents using multiple, overlapping classification systems. These systems aim to group patents based on their industry, uses, or technologies. In general, we encourage using the Cooperative Patent Classification (CPC), a contemporary system that the USPTO and European Patent Office recently agreed upon and will support for the foreseeable future.

Now that we have a good understanding about how PatentsView structures patent data, we can explore that data by querying the developer API.

Our Question is Our Query

Building queries to the PatentsView API is a five part process: Picking an endpoint, narrowing our results with a query string, specifying field data, optionally limiting or expanding the number of results to return, and sorting those results. We’ll describe each step by creating a sample query, but you can read the full documentation on the API.

For our first query, let’s pick some low-hanging fruit. We would like to generate a bar chart that shows how many patents have been issued to the 10 most recently prolific assignees in Oregon.

First, because the information we are looking for relates to assignees, we can use the API’s assignees endpoint. The choice of endpoint affects what kind of results will be returned and which fields are available for the query. We’ll talk about the intricacies of endpoints in our next post.


Next, we want to narrow our request to only assignees from Oregon and to only include active assignees. We can have our cake and eat it, using the _and operator, which lets us join multiple criteria. We can also specify that we only want to include assignees that have been issued a patent since 2015 using _gte, a comparison operator meaning “greater than or equal to.” Remember that the database is about patent data! Even though we’re not searching through the patents endpoint, assignees are listed on patents, so only assignees that appear on patents issued after 2015 will show up in our search.

q={"_and":[{"assignee_lastknown_state": "OR"},
{"_gte": {"patent_date": "2015-01-01"}}]}

Now that we have limited the scope of our query, we must tell the API what fields we want returned. Each endpoint has a variety of fields to choose from. For our bar chart, we want the assignee’s name and their number of patents.

&f=["assignee_organization", "assignee_total_num_patents"]

We can also limit the number of results returned by the API, which defaults to 25. We only want to see 10 assignees, so we will limit it using the per_page parameter.

&o={"per_page": 10}

And, finally, we want to ensure that the results we receive back are not just any 10 assignees, but the 10 assignees that have the most number of patents in our time frame. That means we’ll have to sort by number of patents in descending order. We do that using the s parameter as follows.

&s=[{"assignee_total_num_patents": "desc"}]

Let’s put it all together! Here’s our final query:
q={"_and":[{"assignee_lastknown_state": "OR"},
{"_gte": {"patent_date": "2015-01-01"}}]}
&f=["assignee_organization", "assignee_total_num_patents"]
&o={"per_page": 10}
&s=[{"assignee_total_num_patents": "desc"}]

You can click the query, or paste it into a web browser’s search bar (sans whitespace), to see the response. If you’re spending a lot of time tweaking queries, definitely checkout Postman, a Chrome extension that takes a lot of the work out of working with REST APIs.

And here’s the JSON data we get in response:

"assignees": [
"assignee_organization": "STMicroelectronics S.r.l.",
"assignee_total_num_patents": "7522"
"assignee_organization": "EMC Corporation",
"assignee_total_num_patents": "4670"
"assignee_organization": "Hitachi Global Storage Technologies Netherlands B.V.",
"assignee_total_num_patents": "2924"
// ... etc.
"count": 10,
"total_assignee_count": 261

Working on the Front-End: Taking a Look with D3

Now that our query is returning the data we want, we can use D3 to send our query to PatentsView and then visualize the result. D3 provides a request utility method — d3.json — that accepts a URL and a callback function. We’ll pass this utility our query, and a function that accepts the JSON response from the API. Because we’re only interested in the assignees array in the response, we’ll use destructuring to extract it.

With our JSON response in scope, we can access the properties we’re interested in directly. In our D3 visualization, we want the assignee organization’s name as the value on the X-axis, and the number of patents will determine the height of each rectangle against the Y-axis.

.attr('x', d => xScale(d.assignee_organization))
.attr('y', d => yScale(d.assignee_total_num_patents))
.attr('width', d => xScale.bandwidth())
.attr('height', d => height - yScale(d.assignee_total_num_patents))
.style('fill', 'steelblue');

And here’s what our bar chart looks like:


Here’s the full codepen.

In the next blog post we’ll tackle more advanced queries.

One clap, two clap, three clap, forty?

By clapping more or less, you can signal to us which stories really stand out.