Skip to content

Instagram API

umurtrky edited this page Feb 15, 2017 · 1 revision

Instagram API

First of all you must have an Instagram account to use the Instagram API. After logging in, in order to use Instagram API you have to register your application and then you can use the API based on the documentation.

You can find related information here

Authentication

Instagram API requires authentication and you have to get an access token in order to authenticate. You can learn how to get an access token and how to authenticate from here.

Login Permissions

Instagram API allows you to specify the scope of your access to Instagram data. All apps have basic access scope by default. For example if you would like to post and delete comments your app must have comment scope access. If you would like to have access for scopes other than basic you must pass the review process. For login permissions detail you can look at here.

Permission Review

Every app using Instagram API starts with sandbox mode. This is a mode where your app have limited rate limits and number of users. It is a kind of test mode. You must pass a review process and your app must be approved to get full access and to get to real live mode. For details of permission review you can look at here.

End Points

Instagram API offers several end points to get from and post to Instagram. Some examples are: get information about a user, get recent media published by a user, search for a user, get followers and followed users of a user, search for recent media at a specific location, get recent comments of a media, post a comment on a media, delete a comment. You can find detailed information about end points here.

Rate Limits

Instagram API has global rate limits which do not depend on end points and valid for all of them. Also it has end point specific rate limits which from end point to end point. Rate limits depend on whether your app is in sandbox or live mode. Detailed information can be found here.

Example response

Below you can find an example response of getting the most recent media published by the owner of the access_token.

https://api.instagram.com/v1/users/self/media/recent/?access_token=ACCESS-TOKEN

Response:

{
    "data": [{
        "tags": [],
        "user": {
            "username": "socialcrm321",
            "profile_picture": "https://scontent-atl3-1.cdninstagram.com/t51.2885-19/11906329_960233084022564_1448528159_a.jpg",
            "full_name": "",
            "id": "2285371801"
        },
        "created_time": "1480061484",
        "user_has_liked": false,
        "link": "https://www.instagram.com/p/BNOdfKFAFaw/",
        "filter": "Clarendon",
        "location": null,
        "users_in_photo": [],
        "images": {
            "thumbnail": {
                "url": "https://scontent.cdninstagram.com/t51.2885-15/s150x150/e35/c0.135.1080.1080/15099440_213504809089737_8392000538832535552_n.jpg",
                "width": 150,
                "height": 150
            },
            "standard_resolution": {
                "url": "https://scontent.cdninstagram.com/t51.2885-15/s640x640/sh0.08/e35/c0.135.1080.1080/15099440_213504809089737_8392000538832535552_n.jpg",
                "width": 640,
                "height": 640
            },
            "low_resolution": {
                "url": "https://scontent.cdninstagram.com/t51.2885-15/s320x320/e35/c0.135.1080.1080/15099440_213504809089737_8392000538832535552_n.jpg",
                "width": 320,
                "height": 320
            }
        },
        "comments": {
            "count": 2
        },
        "likes": {
            "count": 1
        },
        "attribution": null,
        "id": "1391179019377989296_2285371801",
        "type": "image",
        "caption": {
            "text": "\u015ei\u015fe",
            "created_time": "1480061484",
            "from": {
                "username": "socialcrm321",
                "profile_picture": "https://scontent-atl3-1.cdninstagram.com/t51.2885-19/11906329_960233084022564_1448528159_a.jpg",
                "full_name": "",
                "id": "2285371801"
            },
            "id": "17859747073066907"
        }
    }, {
        "tags": [],
        "user": {
            "username": "socialcrm321",
            "profile_picture": "https://scontent-atl3-1.cdninstagram.com/t51.2885-19/11906329_960233084022564_1448528159_a.jpg",
            "full_name": "",
            "id": "2285371801"
        },
        "created_time": "1470296047",
        "user_has_liked": false,
        "link": "https://www.instagram.com/p/BIrbZQch1FQ/",
        "filter": "Clarendon",
        "location": null,
        "users_in_photo": [],
        "images": {
            "thumbnail": {
                "url": "https://scontent.cdninstagram.com/t51.2885-15/s150x150/e35/13737019_136437786795698_368914075_n.jpg",
                "width": 150,
                "height": 150
            },
            "standard_resolution": {
                "url": "https://scontent.cdninstagram.com/t51.2885-15/s640x640/sh0.08/e35/13737019_136437786795698_368914075_n.jpg",
                "width": 640,
                "height": 640
            },
            "low_resolution": {
                "url": "https://scontent.cdninstagram.com/t51.2885-15/s320x320/e35/13737019_136437786795698_368914075_n.jpg",
                "width": 320,
                "height": 320
            }
        },
        "comments": {
            "count": 3
        },
        "likes": {
            "count": 1
        },
        "attribution": null,
        "id": "1309260599582478672_2285371801",
        "type": "image",
        "caption": null
    }],
    "meta": {
        "code": 200
    },
    "pagination": {}
}