PubMed JSON API

PubMed doesn't have a JSON API, which makes the EUtils web service difficult to use in web applications.

However, Yahoo! Pipes is ideally suited to this kind of transformation. Here are some pipes that will take input parameters and return the output from EUtils as JSON:

  • ESearch (search PubMed for the given term).
  • EFetch (fetch the full information for one, or several comma-separated, PMIDs).
  • ESpell (return spelling suggestions for the given query).

The ESearch pipe takes three parameters: 'q' (the search term), 'n' (number of items to return), 'offset' (offset of the first item).
The EFetch pipe takes only one parameter: 'pmid'.
The ESpell pipe takes only one parameter: 'q'.

To get JSON output from each pipe, add _render=json to the parameters. To get JSONP add a _callback parameter.

Here's an example using jQuery (view source to copy it for your own use):

Comments

Quite useful, but I can't make it work with IE7.

Posted by: GK on September 10, 2008 12:43 PM

Fixed now, hopefully?

I'm afraid it's not fixed.
Works fine with Firefox and safari though.

Posted by: GK on September 11, 2008 7:58 AM

I think the pipes are clogged? :( Not sure if it's a Yahoo! or EUtils problem, though.

Posted by: Stew on January 24, 2009 7:10 PM

All fields are optional, email address will not be shown; no HTML, URLs are automatically hyperlinked.