Close Close Comment Creative Commons Donate Email Add Email Facebook Instagram Mastodon Facebook Messenger Mobile Nav Menu Podcast Print RSS Search Secure Twitter WhatsApp YouTube

A Super-Simple Tool to Search Instagram by Time and Location

We wrote a little tool to search for Instagram photos taken at certain times and places

This week, Justin Elliott wrote about new House Financial Services Committee chairman Rep. Jeb Hensarling (R-Texas) attending a weekend getaway with banking industry officials.

One of the ways he found out who was at the getaway was by using the Instagram photo sharing service, which turned up a snowy snapshot taken by Len Wolfson, a lobbyist for the Mortgage Bankers Association (which had contributed to Hensarling's PAC). Wolfson has since set his account to private.

The Instagram site has no search function, so finding shots like this can take a lot of digging. However, Instagram has an API with a "Media Search" endpoint that returns data both by timeframe and distance from a certain latitude and longitude -- a perfect way to see who's at a certain place at a certain time.

We wrote a simple Sinatra app that uses this endpoint which we're calling QIS (Quick Instagram Search). The API is pretty limited, so our tool is too. There's no way to search for text or hashtags (tags have their own endpoint which doesn't allow geolocation), there's no pagination of results, and results only go back a few months. We're using Google's Geocoder to take any place, landmark or address string and turn it into a latitude and longitude for Instagram. We're open-sourcing QIS today.

Here's an example of a search for yesterday between Noon and 7 p.m. at the New Orleans Fair Grounds, where the New Orleans Jazz and Heritage Festival is currently going on:


Just playing around with QIS for a few minutes, we found a shot of the finish line at the Boston Marathon, 8 minutes before the first bomb exploded, and a shot of Newt Gingrich outside the White House Correspondents' Dinner.

To bootstrap QIS, see the README file in the repository.

Latest Stories from ProPublica

Current site Current page