Fun with the Patentsview Api
So inspiration can come from anywhere,
right? Maybe I was playing Pokemon Go, or maybe not, when it occurred to me
that it would be cool if I could use patentsview to find nearby cities with patents. Wouldn't
that be an awesome addition to my android app? Fortunately for me, the fine
patentsview folks provide a location.tsv on their data download page
A few minutes later, I had it imported into a mysql table on this
very site, acknowledging its use here
, to play by the Creative Commons License rules. And kudos to whoever figured out
how to query a database for the closest locations to a given latitute/longitude
and posted it
where google could find it for me. I wrapped that somewhat
mind boggling sql involving arccosines and the radius of the earth
in a simple php program that returns nicely loaded json objects sorted
by distance from the latitude and longitude specified (for non human consumption, by browsers and android apps alike).
Now almost any programmer could do that, but the advantage here is that this
isn't an arbitrary latitude/longitude table from some dark corner of
the internet. It's a table with 130,524 locations (at the time I initially loaded it, it's updated roughly quarterly) purportedly
where people involved with patents have been
sighted! (inventor's or assignee's locations) So, logically, the next step would be to make a web service call
to the patentsview location endpoint using the nearby cities returned
by my site! That is now what my android app does
on its user's behalf! It determines the phone's current latitude and longitude
(which can take longer that you'd imagine it should when you are inside).
It then hits my site to find the five closest patent cities and when you
select one, it calls patentsview to see how many patents they have
for that location! If that isn't enough fun, press the Get More button
to get data for the next 5 closest patent cities, but be careful, it can be addicting.
Ideally, what I did would be incorporated into patentsview. You can
already query by an exact location but what if you want to include the surrounding area?
There really should be a proximity parameter etc. so we, the grateful
patentsview community, could
query for an area in a less precise way. Say I'm interested in determining
if the St. Louis area is some sort of patent hot bed. I already can query specifically for St. Louis, MO but what if I wanted to include
East St. Louis, IL and every nearby hamlet? I'd have to know the geography
in more detail than I may care to, especially since there is no guarantee
that there were patents issued to people in any of the cities I deem nearby (potentially lots of false positives, wasting my time and the patentsview server's time). The information I'm looking for is hiding behind the patentsview api,
but currently I cannot ask it to serve up data this way. So where exactly is the patentsview suggestion box?
A beta version of my app is available on Google Play!
Less Exciting update:
Patentsview Api changes coming in December 2022 will most likely break my adroid app and many of my sample pages,
including this page.
The fun part - Real Data Below!
Scroll down and hit the map results button to try it out!
This page tries to get your latitude/longitude and then call my web service
(less fun details above
) to get nearby patent cities to display for you. If something goes wrong while trying to get your location
this page uses hardcoded values so you'll still have something fun (real data) to look at
(Cincinnati, OH=not supported by your browser; Los Angeles, CA=not allowed by you or your brower).
The "get details" links below hit patentsview's location endpoint
for that row's city. The data that comes back is displayed below the table.
Pretty cool huh? The links specify what fields to return and is just a sampling of
the available fields. (Think giant spreadsheet where you can hide/show columns as you please.) Also if you click the "Map Results" link a google map will appear below
the table. So this seemingly simple page is mashing up data from
my site, patentsview.org and google, all controlled by your location
and mouse clicks! In terms of patent related web pages, it doesn't get any
more fun that this.
If proximity searching was added to patentsview they'd be able to return
attributes like the number of patents at these locations or any attribute listed on their
location endpoint page
. There wouldn't be a need
to make calls to patentsview for each city and my site's web service would not be needed. How cool would that be?
This is one example of what could be done using data returned by patentsview.
You are only limited by your imagination on what you could do with it.
Geo status: ?
|Nearby Cities With Patents
Get More Cities
||longitude||miles away||patentsview data|
|Requesting nearby cities . Results should appear here
in a few seconds!|
Starting location: ?
Rows returned: ?