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.