Skip to content
Hack the count limit Instagram imposes in its API
Branch: master
Clone or download

Latest commit

Fetching latest commit…
Cannot retrieve the latest commit at this time.


Type Name Latest commit message Commit time
Failed to load latest commit information.
examples new api parms Dec 25, 2016
.whitesource Initial WhiteSource configuration file Dec 5, 2018
LICENSE Initial commit Jan 22, 2015 new api parms Dec 25, 2016
instafetch.js new api parms Dec 25, 2016


Join the chat at

Fetch Instagram media without limit


What it does

instafetch fetches media from Instagram based on (and only on) the user and/or tag, relying on the Instagram API.

If you use the Instagram API to make a call, you will only get 33 results back, no matter what you specify in the count paramter. Instafetch will help you fetch more media than the limit imposes, in exchange for more API calls, which can count against your hourly limit.

How to Use

instafetch requires jQuery, which you can download here.

You can find an example in examples/example.html

  1. Include jQuery, followed by instafetch
  2. Write a function to be passed into the fetcher, all your logic should be written here. For example, you may want to use the params to specify the id of a div to which you will insert the media into
  3. Create an instance of a fetcher by passing in your client ID. (You must have an instagram developer's account, you can get one here)
  4. Use your fetcher to fetch media. A single fetcher can be used in more than one fetch.
$(function() {
  // Create a callback that simply logs the response and parameters
  var displayInstaBlocks = function(response, params) {

  // Get an instance of a fetcher
  var fetcher = new Instafetch('[--ACCESS TOKEN--]');

  // Fetch results
    user: [--USER ID--],
    tag: [--TAG NAME--],
    limit: 88,
    callback: displayInstaBlocks,
    params: 'instafeed'


option Type description Required?
user int The ID of the user whose media you are fetching At least one of user or tag is required
tag string A single tag At least one of user or tag is required
maxId string If specified, instafetch will only fetch media older than the media with this ID No
callback function Create a function and pass it (without ()) into the fetcher. This will be called once the results are ready. It should accept two arguments - the first is the response object from the fetch, and the second are the arguments passed in from the params property. Yes
params object An object that will be passed into the callback.

Coming soon...

We will provide more template callbacks so you can just plug-and-play. All the provided template callbacks shall have a params object with the following properties:

  • width
  • height
  • scale (cover, crop)
  • resolution (thumbnail, low, standard)
  • class
You can’t perform that action at this time.