npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

patentlyclear

v1.8.0

Published

Node library for the patentlyclear api

Downloads

2

Readme

patentlyclear

Patently Clear is an API for the US patent office. Patently Clear provides easy access to the data through full text search and citation graphs. Check out our examples on tonic to see the library in action.

Register for an early access token here.

npm install patentlyclear

Usage

var PatentlyClear = require('patentlyclear');
// You can either pass in your API token into the constructor or have it set as an environment variable
// The library will look for process.env.PC_API_TOKEN if no api token is provided.
var pc = new PatentlyClear(/* your api token */);

Looking up by ID

getById(id, callback) Looks up a document by its id Supplying an id that points to multiple resources (such as an application number) will return all forms of that document.

Application ID

  • api.getById('US20140000001') => {application: {...}}

Grant ID

  • api.getById('US8877876') => {grant: {...}}

Application Number (both string and number formats are accepted)

  • api.getById('13/538,394') => {application: {...}, grant: {...}}
  • api.getById(13538394) => {application: {...}, grant: {...}}
pc.getById('US8046721', function(err, data) {
  // data => {grant: {id:..., title:..., abstract:...}}
});

Full text search

search(payload, callback) Search for a set of documents with a query payload.

There are several fields that can be searched on. They are:

  • terms [string]: Perform a full text search with a set of keywords.
  • inventor [string]: Search on inventor name.
  • assignee [string]: Who owns the document.
  • filing_date {before: Date, after: Date}: When the document was filed.
  • publication_date {before: Date, after: Date}: When the document was published.
  • type: [application || grant]: What sort of document it is.
  • size int: Total number of documents to return. (Max = 100)

Fields are 'AND'-ed together for search queries, but the term field can support 'OR'-ing.

pc.search({terms: 'dna'}, function(err, data) {
  // data => {hits: [{grant: {}}, {application: {}}]}
});

// 'dna' AND 'Genentech'

{terms: 'dna', assignee: 'genentech'}

// 'dna' AND (filed during 2013)
{
  terms: 'dna',
  filing_date: {
    after: '2013-01-01',
    before: '2014-01-01'
  }
}

// 'dna' AND ('cat' OR 'dog' OR 'mouse')
{
  terms: [
    'dna',
    ['cat', 'dog', 'mouse']
  ]
}

Scrolling

Some result sets can be very large, so pagination is provided by simply re-running the previous search query with the scroll id provided by the returned data.

var query = {terms: 'dna'};
pc.search(query, function(err, data) {
  query.scroll_id = data.scroll_id;
  pc.search(query, function(err, nextData) {
    // another set of data
  });
});

Analysis

analyze(field, payload, callback) Fetches the top trends in a field for a search payload. The possible fields are:

  • trends
  • assingee
  • filing_date
pc.analyze('trends', {terms: 'dna'}, function(err, data) {
  // data => {hits: [{grant: {}}, {application: {}}]}
});

Citation search

backwardCitation(id, payload, callback) Fetches the backward citations of id (eg. the documents that id cites.) that match a given search query. Optionally provide a search payload to filter documents that are retrieved.

pc.backwardCitation('US8046721', function(err, data) {
  // data => {hits: [{grant: {}}, {application: {}}]}
});

pc.backwardCitation('US8046721', {terms: 'password'}, function(err, data) {
  // data => {hits: [{grant: {}}, {application: {}}]}
});

forwardCitation(id, payload, callback) Fetches the forward citations of id (eg. the documents that cite id.) that match a given search query.

pc.forwardCitation('US8046721', function(err, data) {
  // data => {hits: [{grant: {}}, {application: {}}]}
});

pc.forwardCitation('US8046721', {terms: 'password'}, function(err, data) {
  // data => {hits: [{grant: {}}, {application: {}}]}
});

License

MIT