Spectragram is a Gateway to Instagram API

"A picture is worth a thousand words," the old saying goes, and Instagram's 7.3 million daily active users would seem to agree. But how does anybody find anything in that sea of over 5 million new photos every day? A new JavaScript Library named Spectragram provides an easy way for developers to add Instagram photos to a web site or app, without needing to learn all the ins and outs of the sprawling Instagram API.

right: images tagged 'converse'

Created by Adrian Quevedo, "a Multimedia Engineer living in Bogotá, Colombia," Spectragram is a plugin for JQuery (according to some analysts, the most popular JavaScript framework on the Internet) which offers simple methods to return one of three different lists:

  • The most recent photos published by a specified Instagram user;
  • The most popular Instagram photos at the moment; or
  • A list of Instagram photos tagged with a specific keyword.

Results are returned to the jQuery Container element which issued the query, and can be "wrapped" in a particular HTML tag for convenience; the provided code examples illustrate how to call Spectragram from a 'ul' (unordered list) element and get the list of results inside 'li' (list item) tags. Other options include the maximum number of results to return (default: ten) and the size of the photo images (default: medium).

Though Spectragram's first and third methods are straightforward, developers should note that "popular" photos are determined by Instagram using an undisclosed, internal algorithm. Earlier this year, third-party developer SnapWidget attempted to reverse-engineer how Instagram chooses "popular" photos, with limited success; they concluded that several factors were used, including total number of likes, how many followers the posting user has, and how quickly a photo accumulated likes and comments after it was first posted. This corroborates other analyses, so developers who want more control will have to access the Instagram API directly and use additional meta-data to filter their results.

For detailed Documentation on the Spectragram library, visit its GitHub repository.

Be sure to read the next Photos article: The Olapic API: Making Your Brand Picture Perfect with Fan Photos