Tools of the Trade or API 201

Live HTTP Headers is an add-on for Firebox that lets you see the requests your browser is making. These are probably similar tools for chrome or whatever browser you use. If you turn it on it will show the requests your browser is making on your behalf. It's especially useful when using the query client provided by a web service provider like patentsview or Pair Bulk Data. You can use their client to make sample requests in one tab and see exactly what it sends to the web service in the Live HTTP Headers tab. It's great fun to see how the subject matter experts (the web service provide) format the get or post to their own web service. You can then write your own queries using the monkey-see-monkey-do principle (you mimic whatever they did tweaking it for your needs).

Especially fun is to copy a json object from Live HTTP Headers of a request generated by the query client of the service provider. This object can then be pasted into Swagger and posted back to the web service with or without modification. This assumes the service provider or some thoughtful individual has generated the Swagger page. For Pair Bulk Data they've provided the Swagger page. For patentsview I generated the definition and Swagger page and unsuccessfully tried to get them to adopt its use and fix the bugs it exposes. For a post to an endpoint the object is self-contained, the entire json object just needs to be pasted into the Swagger page. If the endpoint is a get you'd have to copy each parameter into its corresponding input box on the Swagger page. It's a bit of a cut and paste nightmare to be sure but with a little persistence it can be accomplished.

In the case of patentsview they've provided a query building tool which is very nice. It relieves some of the mental burden that we computer programmers are used to dealing with. Their client will email you a query that you've built which can then be pasted back into Swagger or client you wrote.

Once you have queries of your own you can build web pages that issue those queries and display the results to users of your web site. Or you can write a client of your own and put it on the web and let visitors of your site use your client to query the web service. A bunch of pages on my site do the former. When a user views them the page makes a request to either patentsview or Pair Bulk Data and displays the results to the user. Some display bugs in the data that I've observed. Others display data as an example of what a person could make a web page do using data provided by the web service. In a couple of cases I display data from the web service based on the inputs proved by the person viewing my site. These qualify as cases of the latter, really specialized clients of my own.

The next logical step would be to move from the web page based interactions to native phone apps where the data comes from the same web service! Here the app writer is supplying a client that runs on a mobile device.

API Comparison

Here's a comparison of the two apis serving up patent data.