Blog posts tagged "api"

NYTimes Article Search API

February 7th, 2009

NYTimes: Sex & Scandal since 1981

I don’t have much to add that the New York Times hasn’t already said about their Article Search API. Its an amazing corpus to be searchable, both in breadth, and scope, and for sheer richness of the classification. I can’t think of an remotely comparable dataset with such a rich API.

Couple of things I noticed that I wanted to call out.

Get info about an article/Search by URL

Positioned as a search API, it also doubles as a “getInfo”-style API, as article URL is one of the searchable fields.

?query=url:$article_url

Just make sure to remove the various query string bits that the Times appends, as these aren’t indexed. Should make a “find the history of this topic being discussed” Greasemonkey script a snap.

Expert’s attention information

One of my less comprehensible requests to the NYTimes developer team at OSCON last year was to make sure their APIs exposed the “attention information of [their] editors.” Age of amateur, citizen journalism, and radical decentralization are all awesome, but the NYTimes’ editors job is to think about what is important and interesting full time; and that’s information worth mining.

And they did!

The page_facet, and nytd_section_facet both allow you to gauge some degree of relative weight given to a story. (section_page_facet seems like it ought to do the same thing, but I couldn’t get it to work)

?query=flickr nytd_section_facet:[Front Page]

Gives you articles mentioning “flickr” featured on the NYTimes front page. (of which it only finds 3, alas)

API Design

Good stuff:

  • Clean hackable URLs, you can play with it in your browser and see what you’re going to get.
  • The getList + extras (called fields in the NYTimes API) is the house wisdom at Flickr, and I’m glad to see it elsewhere
  • The parsed tokens block is neat, and I can see it being incredibly useful for working with such a large, varied corpus
  • The sure amount of searchable/indexable metadata and the granularity is really unprecedented, great to see them go out with such a rich, “here’s the data do something great” approach.

Visualizations

The graphic at the top of this blog post is a “visualization of the frequency of occurrence of the words ’sex’ and ’scandal’ in the New York Times, since 1981.”, part of a set of visualizations by blprnt_van built with the article search API, and Processing.

Tagged: , , ,
  • December 11, 2008

    My Flickr API library for PHP.

    I’m a big believer in Norvig’s “Code is liability” maxim. Which is how I justify my ugly, but functional Flickr API implementation, in 40 lines of PHP (not the most expressive of languages), which I wrote in about 15 minutes one evening, and I now use for all of my Flickr side projects. And all apropos of digging through other folks Flickr API impls, trying to get them working on GAE. Thankfully blech is already there.

    + 1. (Aside , , , , , , )

WOE “GeoPlanet”: HTTP/1.1 406 Not Acceptable

November 19th, 2008

not simple polygons

Just putting a note here for the next time I’m working with the Yahoo! GeoPlanet APIs.

The conudrum: a HTTP GET on a given resource (http://where.yahooapis.com/v1/place/23511846?appid=$appid) works in the browser, and works with wget from the command line, but fails from within PHP with a 406 Not Acceptable.

The solution, append format=XML to the resource URL, because the service is blowing out its brains on a missing Accepts header.

And that folks is the magic of REST.

update 2008/12/04: quick scan of my referer logs suggests this is biting folks using lwp-simple and wget particularly hard.

Netflix API: Looking good

October 1st, 2008

Netflix was pretty much the last place I was Web 2.0 style share cropping, creating value without a way to get it out. The Netflix API has been rumored for a long time, but with today’s release they really did an excellent job.

Also versioned documentation, and a quite reasonable set of branding guidelines.

The Netflix Web APIs provide the ability for you to integrate Netflix user services into your application. The APIs provide the following capabilities:
  • Performing searches of movies, TV series, cast members, and directors
  • Retrieving catalog titles, including details about the title such as name, box art, director, cast, etc.
  • Determining the subscriber’s relationship to a specific title, e.g, in queue, saved, available on DVD, etc.
  • Managing and displaying queues for users
  • Providing conveniences such as auto-completion of partial search terms typed by a user.
  • Displaying a user’s ratings and reviews.
  • Including functional Add and Play buttons in your web application.

Congratulations to Netflix, and Mashery.

WeeWar needs XMPP

May 14th, 2008

WeeWar broke in a wave across the office this afternoon. (thankfully late afternoon, or I might have gotten nothing done today). Its a Web-based turn based strategy game, thats very well done. Sort of a “Flickr for Risk”, with a nice value add pro account ($24.95/year), and APIs, social networking features, and a chatty tone.

XMPP

But I’ve never run into an application that needed an XMPP interface more.

The most fundamental missing functionality is a convenient, light weight way of getting notified that your turn has rolled around again. WeeWar will send you email, but now your inboxes is even more cluttered, and you’re having to check your inbox constantly. (something I try to keep to 1-2 times an hour)

Push

A Jabber interface you could trust to push to you the state changes news, and thereby remove the nagging, “Is it my turn?” and the variable positive reinforcement relationship it sets up with your inbox.

Additionally its a classic app where, if you’re polling, you want to keep the polling time very low, but the actual incident of change is fairly spare, which means WeeWar is going to at some point start resenting their polling based APIs.

Payload

Ideally messages would also include an XML payload describing either the changes since your last turn, or the current state of the map, allowing for rich consuming clients to build alternate interfaces to the world.

New Games

Orthogonally, a new games, and new games from your “preferred players” would also be excellent to get pushed out over Jabber.

Fire Eagle: Interesting Choices

March 5th, 2008

Fire Eagle

Other folks are talking about and writing about the long germinating, launched in beta, location broker from Yahoo’s Brickhouse, Fire Eagle.

I wanted to call out just a couple of the cool, and non-intuitve decisions they made.

Is NOT a consumer brand

Fire Eagle is a service for building and sharing location data. Its the application built on top of it that you’ll interact with, unless you’re building stuff.

Fire Eagle does NOT manage the social graph

Its a service for sharing your data with friends (or services, or your toaster), but it doesn’t know who your friends are. The social graph has been outsource. Best example of a small piece loosely joined I’ve seen in a long time.

Cares about privacy and ease of use

Ninja privacy is built in. But you don’t have to care. The TOS requires developers to discuss how the data is used. And privacy levels are front and center. And from day one data is delete-able, and in fact data is flushed on a regular basis.

Built on OAuth

Yay!

Facebook Data Store API

August 10th, 2007

When I heard that f.bk had a new Data Store API was thinking “Wow! That’s actually hard!”.

But if you read it closer you’ll notice the operations map to what can de done in memcache (down to transactions are handled via atomic auto-increments) with a bit of cleverness, and some persistence. (pun intended) Still a nice step towards making developing f.bk apps a bit less eye-pokey-outty

Everyone is building the giant hash table in the clouds.

Friends Done Good: Newscloud, Helium, Twitter

October 25th, 2006

Jeff has been rolling out the APIs at Newscloud, 51 and counting with code samples, and documentation. Everything you need to remix your own community collaborative news “vertical” (in valleyspeak), Digg-a-like, or simply progressive news aggregator.

A whole pack of the crew from Anyday/Palm just shipped Helium, newest entry in the paid writers community space, built on a slick Rails backend. But really, get better stock photos if you want to give the “made of people” feel. (see Flickr: Creative Commons)

And Blaine has soft launched Jabber integration for Twitter. Also a stream oriented XML webservice. (did I just repeat myself?)

Tagged: Uncategorized , , , ,