Endpoints

This page provides an extensive list of all endpoints supported by Elogram.

Warning

All code examples below assume you have already instantiated the Client class with a valid access token. If you do not already have one, head over to the Authentication page to read about how to obtain one.

Users

get($id = 'self')

Get information about a user.

Parameters:
  • $id (string) – The ID of the user. Default is self
Returns:

Response

Example request:

$client   = new Client($clientId, $clientSecret, $accessToken, $redirectUrl);
$response = $client->users()->get(4);
echo json_encode($response->get());

Example response:

{
    "meta":
    {
        "code": 200
    },
    "data":
    {
        "username": "mikeyk",
        "first_name": "Mike",
        "profile_picture": "http://distillery.s3.amazonaws.com/profiles/profile_4_75sq_1292324747_debug.jpg",
        "id": "4",
        "last_name": "Krieger!!"
    }
}
getMedia($id = 'self', $count = null, $minId = null, $maxId = null)

Get the most recent media published by a user.

Parameters:
  • $id
  • $count (int|null) – Count of media to return
  • $minId (int|null) – Return media later than this min_id
  • $maxId (int|null) – Return media earlier than this max_id
Returns:

Response

Example request:

$client   = new Client($clientId, $clientSecret, $accessToken, $redirectUrl);
$response = $client->users()->getMedia('268047373');
echo json_encode($response->get());

Example response:

{
    "pagination":
    {
        "next_url": "http://localhost:8000/publicapi/v1/users/4/media/recent?q=iphone&lat=37.771&access_token=DEBUG&lng=-122.221&max_id=3382522&count=1",
        "next_max_id": 3382522
    },
    "meta":
    {
        "code": 200
    },
    "data": [
        {
            "type": "image",
            "tags": [],
            "location":
            {
                "latitude": 37.781109999999998,
                "id": null,
                "longitude": -122.3947,
                "name": null
            },
            "comments":
            {
                "count": 1,
                "data": [
                    {
                        "created_time": "1296713291",
                        "text": "Earear",
                        "from":
                        {
                            "username": "mikeyk",
                            "first_name": "Mike",
                            "last_name": "Krieger!!",
                            "type": "user",
                            "id": "4"
                        },
                        "id": "2611728"
                    }]
            },
            "caption":
            {
                "created_time": "1296713291",
                "text": "Earear",
                "from":
                {
                    "username": "mikeyk",
                    "first_name": "Mike",
                    "last_name": "Krieger!!",
                    "type": "user",
                    "id": "4"
                },
                "id": "2611728"
            },
            "link": "http://localhost:8000/p/M5z6/",
            "likes":
            {
                "count": 0
            },
            "created_time": "1296713289",
            "images":
            {
                "low_resolution":
                {
                    "url": "http://distillery-dev.s3.amazonaws.com/media/2011/02/02/1ce5f3f490a640ca9068e6000c91adc5_6.jpg",
                    "width": 480,
                    "height": 480
                },
                "thumbnail":
                {
                    "url": "http://distillery-dev.s3.amazonaws.com/media/2011/02/02/1ce5f3f490a640ca9068e6000c91adc5_5.jpg",
                    "width": 150,
                    "height": 150
                },
                "standard_resolution":
                {
                    "url": "http://distillery-dev.s3.amazonaws.com/media/2011/02/02/1ce5f3f490a640ca9068e6000c91adc5_7.jpg",
                    "width": 612,
                    "height": 612
                }
            },
            "user_has_liked": false,
            "id": "3382522",
            "user":
            {
                "username": "mikeyk",
                "profile_picture": "http://distillery.s3.amazonaws.com/profiles/profile_4_75sq_1292324747_debug.jpg",
                "id": "4"
            }
        },
        {
            "type": "video",
            "videos":
            {
                "low_resolution":
                {
                    "url": "http://distilleryvesper9-13.ak.instagram.com/090d06dad9cd11e2aa0912313817975d_102.mp4",
                    "width": 480,
                    "height": 480
                },
                "standard_resolution":
                {
                    "url": "http://distilleryvesper9-13.ak.instagram.com/090d06dad9cd11e2aa0912313817975d_101.mp4",
                    "width": 640,
                    "height": 640
                }
            },
            "users_in_photo": null,
            "filter": "Vesper",
            "tags": [],
            "comments":
            {
                "data": [
                    {
                        "created_time": "1279332030",
                        "text": "Love the sign here",
                        "from":
                        {
                            "username": "mikeyk",
                            "full_name": "Mikey Krieger",
                            "id": "4",
                            "profile_picture": "http://distillery.s3.amazonaws.com/profiles/profile_1242695_75sq_1293915800.jpg"
                        },
                        "id": "8"
                    },
                    {
                        "created_time": "1279341004",
                        "text": "Chilako taco",
                        "from":
                        {
                            "username": "kevin",
                            "full_name": "Kevin S",
                            "id": "3",
                            "profile_picture": "..."
                        },
                        "id": "3"
                    }],
                "count": 2
            },
            "caption": null,
            "likes":
            {
                "count": 1,
                "data": [
                    {
                        "username": "mikeyk",
                        "full_name": "Mikeyk",
                        "id": "4",
                        "profile_picture": "..."
                    }]
            },
            "link": "http://instagr.am/p/D/",
            "user":
            {
                "username": "kevin",
                "full_name": "Kevin S",
                "profile_picture": "...",
                "bio": "...",
                "website": "...",
                "id": "3"
            },
            "created_time": "1279340983",
            "images":
            {
                "low_resolution":
                {
                    "url": "http://distilleryimage2.ak.instagram.com/11f75f1cd9cc11e2a0fd22000aa8039a_6.jpg",
                    "width": 306,
                    "height": 306
                },
                "thumbnail":
                {
                    "url": "http://distilleryimage2.ak.instagram.com/11f75f1cd9cc11e2a0fd22000aa8039a_5.jpg",
                    "width": 150,
                    "height": 150
                },
                "standard_resolution":
                {
                    "url": "http://distilleryimage2.ak.instagram.com/11f75f1cd9cc11e2a0fd22000aa8039a_7.jpg",
                    "width": 612,
                    "height": 612
                }
            },
            "id": "3",
            "location": null
        }

    ]
}
getLikedMedia($count = null, $maxLikeId = null)

Get the list of recent media liked by the owner of the access token.

Parameters:
  • $count (int|null) – Count of media to return
  • $maxLikeId (int|null) – Return media liked before this id
Returns:

Response

Example request:

$client   = new Client($clientId, $clientSecret, $accessToken, $redirectUrl);
$response = $client->users()->getLikedMedia();
echo json_encode($response->get());

Example response:

{
    "pagination":
    {
        "next_url": "http://localhost:8000/publicapi/v1/users/self/feed?q=iphone&lat=37.771&access_token=DEBUG&lng=-122.221&max_id=3382520",
        "next_max_like_id": 50
    },
    "meta":
    {
        "code": 200
    },
    "data": [
        {
            "type": "image",
            "tags": [],
            "location":
            {
                "latitude": 37.781089999999999,
                "id": null,
                "longitude": -122.3946,
                "name": null
            },
            "comments":
            {
                "count": 1,
                "data": [
                    {
                        "created_time": "1296272101",
                        "text": "O hai.",
                        "from":
                        {
                            "username": "mikeyk",
                            "first_name": "Mike",
                            "last_name": "Krieger!!",
                            "type": "user",
                            "id": "4"
                        },
                        "id": "2611719"
                    }]
            },
            "caption":
            {
                "created_time": "1296272101",
                "text": "O hai.",
                "from":
                {
                    "username": "mikeyk",
                    "first_name": "Mike",
                    "last_name": "Krieger!!",
                    "type": "user",
                    "id": "4"
                },
                "id": "2611719"
            },
            "link": "http://localhost:8000/p/M5z4/",
            "likes":
            {
                "count": 0
            },
            "created_time": "1296673135",
            "images":
            {
                "low_resolution":
                {
                    "url": "http://distillery-dev.s3.amazonaws.com/media/2011/02/02/b6073350d89644ccb253b89ead6c75da_6.jpg",
                    "width": 480,
                    "height": 480
                },
                "thumbnail":
                {
                    "url": "http://distillery-dev.s3.amazonaws.com/media/2011/02/02/b6073350d89644ccb253b89ead6c75da_5.jpg",
                    "width": 150,
                    "height": 150
                },
                "standard_resolution":
                {
                    "url": "http://distillery-dev.s3.amazonaws.com/media/2011/02/02/b6073350d89644ccb253b89ead6c75da_7.jpg",
                    "width": 612,
                    "height": 612
                }
            },
            "user_has_liked": false,
            "id": "3382520",
            "user":
            {
                "username": "mikeyk",
                "profile_picture": "http://distillery.s3.amazonaws.com/profiles/profile_4_75sq_1292324747_debug.jpg",
                "id": "4"
            }
        }]
}

Get a list of users matching the query.

Parameters:
  • $query
  • $count
Returns:

Response

Example request:

$client   = new Client($clientId, $clientSecret, $accessToken, $redirectUrl);
$response = $client->users()->search('skrawg');
echo json_encode($response->get());

Example response:

{
    "meta":
    {
        "code": 200
    },
    "data": [
        {
            "username": "mikeyk",
            "first_name": "Mike",
            "profile_picture": "http://distillery.s3.amazonaws.com/profiles/profile_4_75sq_1292324747_debug.jpg",
            "id": "4",
            "last_name": "Krieger!!"
        }]
}
find($username)

Searches for and returns a single user’s information. If no results are found, null is returned.

Parameters:
  • $username (string) – A username to search for
Returns:

Response|null

Example request:

$client   = new Client($clientId, $clientSecret, $accessToken, $redirectUrl);
$response = $client->users()->find('mikeyk');
echo json_encode($response->get());

Example response:

{
    "meta":
    {
        "code": 200
    },
    "data": {
        "username": "mikeyk",
        "first_name": "Mike",
        "profile_picture": "http://distillery.s3.amazonaws.com/profiles/profile_4_75sq_1292324747_debug.jpg",
        "id": "4",
        "last_name": "Krieger!!"
    }
}

Relationships

follows()

Get the list of users this user follows.

Returns:Response

Example request:

$client   = new Client($clientId, $clientSecret, $accessToken, $redirectUrl);
$response = $client->users()->follows();
echo json_encode($response->get());

Example response:

{
    "pagination":
    {
        "next_url": "https://api.instagram.com/v1/users/self/follows?cursor=1201686",
        "next_cursor": "1201686"
    },
    "meta":
    {
        "code": 200
    },
    "data": [
        {
            "username": "kevin",
            "profile_picture": "http://distillery.s3.amazonaws.com/profiles/profile_3_75sq_1295493319_debug.jpg",
            "id": "3"
        },
        {
            "username": "moop55_ok",
            "profile_picture": "http://distillery.s3.amazonaws.com/profiles/profile_332654_75sq_1294963309_debug.jpg",
            "id": "332654"
        },
        {
            "username": "ooop",
            "profile_picture": "http://distillery.s3.amazonaws.com/profiles/profile_580183_75sq_1295562975_debug.jpg",
            "id": "580183"
        },
        {
            "username": "tastyboo",
            "profile_picture": "http://distillery.s3.amazonaws.com/profiles/profile_580178_75sq_1295490998_debug.jpg",
            "id": "580178"
        },
        {
            "username": "moopafa",
            "profile_picture": "http://distillery.s3.amazonaws.com/profiles/anonymousUser.jpg",
            "id": "580174"
        },
        {
            "username": "jalter",
            "profile_picture": "http://distillery.s3.amazonaws.com/profiles/anonymousUser.png",
            "id": "51"
        },
        {
            "username": "doug",
            "profile_picture": "http://distillery.s3.amazonaws.com/profiles/profile_17_75sq_1287382013.jpg",
            "id": "17"
        },
        {
            "username": "danman",
            "profile_picture": "http://distillery.s3.amazonaws.com/profiles/profile_139329_75sq_1287670462.jpg",
            "id": "139329"
        },
        {
            "username": "amine",
            "profile_picture": "http://distillery.s3.amazonaws.com/profiles/profile_136_75sq_1286357298.jpg",
            "id": "136"
        },
        {
            "username": "moopevil3",
            "profile_picture": "http://distillery.s3.amazonaws.com/profiles/anonymousUser.jpg",
            "id": "580164"
        },
        {
            "username": "kevnull",
            "profile_picture": "http://distillery.s3.amazonaws.com/profiles/profile_12169_75sq_1286433153.jpg",
            "id": "12169"
        },
        {
            "username": "wymp",
            "profile_picture": "http://distillery.s3.amazonaws.com/profiles/anonymousUser.jpg",
            "id": "402370"
        },
        {
            "username": "rad",
            "profile_picture": "http://distillery.s3.amazonaws.com/profiles/profile_330307_75sq_1288842417.jpg",
            "id": "330307"
        },
        {
            "username": "mpreysman",
            "profile_picture": "http://distillery.s3.amazonaws.com/profiles/profile_2431_75sq_1286378624.jpg",
            "id": "2431"
        },
        {
            "username": "joulee",
            "profile_picture": "http://distillery.s3.amazonaws.com/profiles/profile_354221_75sq_1288477666.jpg",
            "id": "354221"
        },
        {
            "username": "drtyhbo",
            "profile_picture": "http://distillery.s3.amazonaws.com/profiles/anonymousUser.jpg",
            "id": "451846"
        },
        {
            "username": "pm",
            "profile_picture": "http://distillery.s3.amazonaws.com/profiles/anonymousUser.jpg",
            "id": "21017"
        },
        {
            "username": "mike_matas",
            "profile_picture": "http://distillery.s3.amazonaws.com/profiles/anonymousUser.jpg",
            "id": "283400"
        },
        {
            "username": "joehewitt",
            "profile_picture": "http://distillery.s3.amazonaws.com/profiles/anonymousUser.jpg",
            "id": "340483"
        },
        {
            "username": "itod",
            "profile_picture": "http://distillery.s3.amazonaws.com/profiles/profile_73142_75sq_1288712029.jpg",
            "id": "73142"
        },
        {
            "username": "erickschonfeld",
            "profile_picture": "http://distillery.s3.amazonaws.com/profiles/profile_412333_75sq_1288708924.jpg",
            "id": "412333"
        },
        {
            "username": "edog1203",
            "profile_picture": "http://distillery.s3.amazonaws.com/profiles/anonymousUser.jpg",
            "id": "334077"
        },
        {
            "username": "addumb",
            "profile_picture": "http://distillery.s3.amazonaws.com/profiles/profile_156856_75sq_1287287045.jpg",
            "id": "156856"
        },
        {
            "username": "neo121",
            "profile_picture": "http://distillery.s3.amazonaws.com/profiles/profile_4124_75sq_1286682619.jpg",
            "id": "4124"
        },
        {
            "username": "heathsplosion",
            "profile_picture": "http://distillery.s3.amazonaws.com/profiles/profile_4962_75sq_1287559547.jpg",
            "id": "4962"
        },
        {
            "username": "baristaskills",
            "profile_picture": "http://distillery.s3.amazonaws.com/profiles/profile_400745_75sq_1288898161.jpg",
            "id": "400745"
        },
        {
            "username": "mephaust",
            "profile_picture": "http://distillery.s3.amazonaws.com/profiles/anonymousUser.jpg",
            "id": "379207"
        },
        {
            "username": "zuck",
            "profile_picture": "http://distillery.s3.amazonaws.com/profiles/anonymousUser.jpg",
            "id": "314216"
        },
        {
            "username": "kikife",
            "profile_picture": "http://distillery.s3.amazonaws.com/profiles/profile_89613_75sq_1288524236.jpg",
            "id": "89613"
        },
        {
            "username": "nathanfolkman",
            "profile_picture": "http://distillery.s3.amazonaws.com/profiles/profile_10331_75sq_1288543942.jpg",
            "id": "10331"
        },
        {
            "username": "szetopia",
            "profile_picture": "http://distillery.s3.amazonaws.com/profiles/profile_324431_75sq_1288324508.jpg",
            "id": "324431"
        },
        {
            "username": "savasavasava",
            "profile_picture": "http://distillery.s3.amazonaws.com/profiles/profile_230975_75sq_1288882103.jpg",
            "id": "230975"
        },
        {
            "username": "marcoarment",
            "profile_picture": "http://distillery.s3.amazonaws.com/profiles/profile_319323_75sq_1288295580.jpg",
            "id": "319323"
        },
        {
            "username": "jonathan",
            "profile_picture": "http://distillery.s3.amazonaws.com/profiles/profile_104_75sq_1286247931.jpg",
            "id": "104"
        },
        {
            "username": "marcin",
            "profile_picture": "http://distillery.s3.amazonaws.com/profiles/profile_3436_75sq_1286398236.jpg",
            "id": "3436"
        },
        {
            "username": "sara",
            "profile_picture": "http://distillery.s3.amazonaws.com/profiles/profile_3843_75sq_1286396157.jpg",
            "id": "3843"
        },
        {
            "username": "garrytan",
            "profile_picture": "http://distillery.s3.amazonaws.com/profiles/profile_118666_75sq_1287710518.jpg",
            "id": "118666"
        },
        {
            "username": "bijan",
            "profile_picture": "http://distillery.s3.amazonaws.com/profiles/profile_4415_75sq_1286388941.jpg",
            "id": "4415"
        },
        {
            "username": "kevinrose",
            "profile_picture": "http://distillery.s3.amazonaws.com/profiles/profile_124163_75sq_1287092509.jpg",
            "id": "124163"
        },
        {
            "username": "joshjohnson",
            "profile_picture": "http://distillery.s3.amazonaws.com/profiles/profile_98476_75sq_1288321499.jpg",
            "id": "98476"
        },
        {
            "username": "andreklbacelar",
            "profile_picture": "http://distillery.s3.amazonaws.com/profiles/profile_9456_75sq_1287715249.jpg",
            "id": "9456"
        },
        {
            "username": "sacca",
            "profile_picture": "http://distillery.s3.amazonaws.com/profiles/profile_221307_75sq_1287732175.jpg",
            "id": "221307"
        },
        {
            "username": "suzykrieger",
            "profile_picture": "http://distillery.s3.amazonaws.com/profiles/profile_220658_75sq_1287968389.jpg",
            "id": "220658"
        },
        {
            "username": "nandakbp",
            "profile_picture": "http://distillery.s3.amazonaws.com/profiles/profile_269007_75sq_1287970385.jpg",
            "id": "269007"
        },
        {
            "username": "jpollock",
            "profile_picture": "http://distillery.s3.amazonaws.com/profiles/anonymousUser.jpg",
            "id": "157011"
        },
        {
            "username": "iphonequeen",
            "profile_picture": "http://distillery.s3.amazonaws.com/profiles/profile_6392_75sq_1286477168.jpg",
            "id": "6392"
        },
        {
            "username": "igutfreund",
            "profile_picture": "http://distillery.s3.amazonaws.com/profiles/anonymousUser.jpg",
            "id": "248626"
        },
        {
            "username": "onwall",
            "profile_picture": "http://distillery.s3.amazonaws.com/profiles/anonymousUser.jpg",
            "id": "248299"
        },
        {
            "username": "missmallibu",
            "profile_picture": "http://distillery.s3.amazonaws.com/profiles/profile_235309_75sq_1287796262.jpg",
            "id": "235309"
        },
        {
            "username": "jimgoldstein",
            "profile_picture": "http://distillery.s3.amazonaws.com/profiles/profile_171983_75sq_1287376290.jpg",
            "id": "171983"
        }]
}
followedBy()

Get the list of users this user is followed by.

Returns:Response

Example request:

$client   = new Client($clientId, $clientSecret, $accessToken, $redirectUrl);
$response = $client->users()->followedBy();
echo json_encode($response->get());

Example response:

{
    "meta":
    {
        "code": 200
    },
    "data": [
        {
            "username": "shayne",
            "profile_picture": "http://distillery.s3.amazonaws.com/profiles/profile_20_75sq_1295492590_debug.jpg",
            "id": "20"
        }]
}
requestedBy()

List the users who have requested this user’s permission to follow.

Returns:Response

Example request:

$client   = new Client($clientId, $clientSecret, $accessToken, $redirectUrl);
$response = $client->users()->requestedBy();
echo json_encode($response->get());

Example response:

{
    "pagination":
    {},
    "meta":
    {
        "code": 200
    },
    "data": [
        {
            "username": "kevin",
            "profile_picture": "http://distillery.s3.amazonaws.com/profiles/profile_3_75sq_1295493319_debug.jpg",
            "id": "3"
        }]
}
getRelationship($targetUserId)

Get information about the relationship of the owner of the access token to another user.

Parameters:
  • $targetUserId (string) – The ID of the target user
Returns:

Response

Example request:

$client   = new Client($clientId, $clientSecret, $accessToken, $redirectUrl);
$response = $client->users()->getRelationship('268047373');
echo json_encode($response->get());

Example response:

{
  "data":
  {
    "outgoing_status": "none",
    "incoming_status": "requested_by"
  }
}
setRelationship($targetUserId, $action)

Modify the relationship between the owner of the access token and the target user.

Parameters:
  • $targetUserId (string) – The ID of the target user
  • $action (string) – Can be one of: follow | unfollow | approve | ignore
Returns:

Response

Example request:

$client   = new Client($clientId, $clientSecret, $accessToken, $redirectUrl);
$response = $client->users()->setRelationship('268047373', 'follows');
echo json_encode($response->get());

Example response:

{
    "meta":
    {
        "code": 200
    },
    "data":
    {
        "outgoing_status": "follows"
    }
}

Media

get($id)

Get information about a media object.

Parameters:
  • $id (string) – The ID of the media object
Returns:

Response

Example request:

$client   = new Client($clientId, $clientSecret, $accessToken, $redirectUrl);
$response = $client->media()->get('315');
echo json_encode($response->get());

Example response:

{
    "meta":
    {
        "code": 200
    },
    "data":
    {
        "type": "image",
        "location":
        {
            "latitude": 37.782179999999997,
            "id": null,
            "longitude": -122.38849999999999,
            "name": null
        },
        "comments":
        {
            "count": 6,
            "data": [
                {
                    "created_time": "1280379782",
                    "text": "Next muni is in an hour; forget that, walking home instead",
                    "from":
                    {
                        "username": "mikeyk",
                        "first_name": "Mike",
                        "last_name": "Krieger!!",
                        "type": "user",
                        "id": "4"
                    },
                    "id": "367"
                },
                {
                    "created_time": "1280417247",
                    "text": "I'm on the new Burbn!!! So beautiful, @kevin and @mikeyk!",
                    "from":
                    {
                        "username": "grex",
                        "first_name": "Gregor",
                        "last_name": "Hochmuth",
                        "type": "user",
                        "id": "25"
                    },
                    "id": "384"
                },
                {
                    "created_time": "1296711880",
                    "text": "hawwoo",
                    "from":
                    {
                        "username": "mikeyk",
                        "first_name": "Mike",
                        "last_name": "Krieger!!",
                        "type": "user",
                        "id": "4"
                    },
                    "id": "2611722"
                },
                {
                    "created_time": "1296712932",
                    "text": "foo",
                    "from":
                    {
                        "username": "mikeyk",
                        "first_name": "Mike",
                        "last_name": "Krieger!!",
                        "type": "user",
                        "id": "4"
                    },
                    "id": "2611725"
                },
                {
                    "created_time": "1296712932",
                    "text": "foo",
                    "from":
                    {
                        "username": "mikeyk",
                        "first_name": "Mike",
                        "last_name": "Krieger!!",
                        "type": "user",
                        "id": "4"
                    },
                    "id": "2611726"
                },
                {
                    "created_time": "1296770323",
                    "text": "o_hai",
                    "from":
                    {
                        "username": "mikeyk",
                        "first_name": "Mike",
                        "last_name": "Krieger!!",
                        "type": "user",
                        "id": "4"
                    },
                    "id": "2611747"
                }]
        },
        "caption": null,
        "link": "https://www.instagram.com/p/9mDRRppRE7/",
        "likes":
        {
            "count": 3
        },
        "created_time": "1280379741",
        "images":
        {
            "low_resolution":
            {
                "url": "http://distillery-dev.s3.amazonaws.com/media/2010/07/28/84967fafe5f44b43a133ebabdd1f89a2_6.jpg",
                "width": 480,
                "height": 480
            },
            "thumbnail":
            {
                "url": "http://distillery-dev.s3.amazonaws.com/media/2010/07/28/84967fafe5f44b43a133ebabdd1f89a2_5.jpg",
                "width": 150,
                "height": 150
            },
            "standard_resolution":
            {
                "url": "http://distillery-dev.s3.amazonaws.com/media/2010/07/28/84967fafe5f44b43a133ebabdd1f89a2_7.jpg",
                "width": 612,
                "height": 612
            }
        },
        "user_has_liked": true,
        "id": "315",
        "user":
        {
            "username": "mikeyk",
            "profile_picture": "http://distillery.s3.amazonaws.com/profiles/profile_4_75sq_1292324747_debug.jpg",
            "id": "4"
        }
    }
}
getByShortcode($shortcode)

This method returns the same response as Media::get

Parameters:
  • $shortcode (string) – The shortcode of the media object
Returns:

Response

Example request:

$client   = new Client($clientId, $clientSecret, $accessToken, $redirectUrl);
$response = $client->media()->getByShortcode('9mDRRppRE7');
echo json_encode($response->get());

Example response:

{
    "meta":
    {
        "code": 200
    },
    "data":
    {
        "type": "image",
        "location":
        {
            "latitude": 37.782179999999997,
            "id": null,
            "longitude": -122.38849999999999,
            "name": null
        },
        "comments":
        {
            "count": 6,
            "data": [
                {
                    "created_time": "1280379782",
                    "text": "Next muni is in an hour; forget that, walking home instead",
                    "from":
                    {
                        "username": "mikeyk",
                        "first_name": "Mike",
                        "last_name": "Krieger!!",
                        "type": "user",
                        "id": "4"
                    },
                    "id": "367"
                },
                {
                    "created_time": "1280417247",
                    "text": "I'm on the new Burbn!!! So beautiful, @kevin and @mikeyk!",
                    "from":
                    {
                        "username": "grex",
                        "first_name": "Gregor",
                        "last_name": "Hochmuth",
                        "type": "user",
                        "id": "25"
                    },
                    "id": "384"
                },
                {
                    "created_time": "1296711880",
                    "text": "hawwoo",
                    "from":
                    {
                        "username": "mikeyk",
                        "first_name": "Mike",
                        "last_name": "Krieger!!",
                        "type": "user",
                        "id": "4"
                    },
                    "id": "2611722"
                },
                {
                    "created_time": "1296712932",
                    "text": "foo",
                    "from":
                    {
                        "username": "mikeyk",
                        "first_name": "Mike",
                        "last_name": "Krieger!!",
                        "type": "user",
                        "id": "4"
                    },
                    "id": "2611725"
                },
                {
                    "created_time": "1296712932",
                    "text": "foo",
                    "from":
                    {
                        "username": "mikeyk",
                        "first_name": "Mike",
                        "last_name": "Krieger!!",
                        "type": "user",
                        "id": "4"
                    },
                    "id": "2611726"
                },
                {
                    "created_time": "1296770323",
                    "text": "o_hai",
                    "from":
                    {
                        "username": "mikeyk",
                        "first_name": "Mike",
                        "last_name": "Krieger!!",
                        "type": "user",
                        "id": "4"
                    },
                    "id": "2611747"
                }]
        },
        "caption": null,
        "link": "https://www.instagram.com/p/9mDRRppRE7/",
        "likes":
        {
            "count": 3
        },
        "created_time": "1280379741",
        "images":
        {
            "low_resolution":
            {
                "url": "http://distillery-dev.s3.amazonaws.com/media/2010/07/28/84967fafe5f44b43a133ebabdd1f89a2_6.jpg",
                "width": 480,
                "height": 480
            },
            "thumbnail":
            {
                "url": "http://distillery-dev.s3.amazonaws.com/media/2010/07/28/84967fafe5f44b43a133ebabdd1f89a2_5.jpg",
                "width": 150,
                "height": 150
            },
            "standard_resolution":
            {
                "url": "http://distillery-dev.s3.amazonaws.com/media/2010/07/28/84967fafe5f44b43a133ebabdd1f89a2_7.jpg",
                "width": 612,
                "height": 612
            }
        },
        "user_has_liked": true,
        "id": "315",
        "user":
        {
            "username": "mikeyk",
            "profile_picture": "http://distillery.s3.amazonaws.com/profiles/profile_4_75sq_1292324747_debug.jpg",
            "id": "4"
        }
    }
}
search($latitude, $longitude, $distance = 1000)

Search for recent media in a given area.

Parameters:
  • $latitude (int) – Latitude of the center search coordinate. If used, $longitude is required
  • $longitude (int) – Longitude of the center search coordinate. If used, $latitude is required
  • $distance (int) – The distance in metres. Default is 1000 m, max distance is 5km
Returns:

Response

Example request:

$client   = new Client($clientId, $clientSecret, $accessToken, $redirectUrl);
$response = $client->media()->search(37.78, -122.22);
echo json_encode($response->get());

Example response:

{
    "meta":
    {
        "code": 200
    },
    "data": [
        {
            "type": "image",
            "tags": [],
            "location":
            {
                "latitude": 37.775382999999991,
                "id": "74480",
                "longitude": -122.223941,
                "name": "Fruitvale BART"
            },
            "comments":
            {
                "count": 1,
                "data": [
                    {
                        "created_time": "1288931764",
                        "text": "Emergency",
                        "from":
                        {
                            "username": "catchfoot",
                            "first_name": "Rachel",
                            "last_name": "Lightfoot",
                            "type": "user",
                            "id": "208329"
                        },
                        "id": "1916879"
                    }]
            },
            "caption":
            {
                "created_time": "1288931764",
                "text": "Emergency",
                "from":
                {
                    "username": "catchfoot",
                    "first_name": "Rachel",
                    "last_name": "Lightfoot",
                    "type": "user",
                    "id": "208329"
                },
                "id": "1916879"
            },
            "link": "https://www.instagram.com/p/9mDASDBRpR/",
            "likes":
            {
                "count": 0
            },
            "created_time": "1288931757",
            "images":
            {
                "low_resolution":
                {
                    "url": "http://distillery-dev.s3.amazonaws.com/media/2010/11/04/486c002f2fd14e2f8a1aef99dee7b95d_6.jpg",
                    "width": 480,
                    "height": 480
                },
                "thumbnail":
                {
                    "url": "http://distillery-dev.s3.amazonaws.com/media/2010/11/04/486c002f2fd14e2f8a1aef99dee7b95d_5.jpg",
                    "width": 150,
                    "height": 150
                },
                "standard_resolution":
                {
                    "url": "http://distillery-dev.s3.amazonaws.com/media/2010/11/04/486c002f2fd14e2f8a1aef99dee7b95d_7.jpg",
                    "width": 612,
                    "height": 612
                }
            },
            "user_has_liked": false,
            "id": "2582155",
            "user":
            {
                "username": "catchfoot",
                "profile_picture": "http://distillery.s3.amazonaws.com/profiles/profile_208329_75sq_1288164413.jpg",
                "id": "208329"
            }
        },
        {
            "type": "image",
            "tags": [],
            "location":
            {
                "latitude": 37.775289999999998,
                "id": "163042",
                "longitude": -122.224172,
                "name": "Powderface"
            },
            "comments":
            {
                "count": 1,
                "data": [
                    {
                        "created_time": "1288644742",
                        "text": "Caramel Beignets! Yummy :)",
                        "from":
                        {
                            "username": "mkram0s",
                            "first_name": "Kate",
                            "last_name": "Ramos",
                            "type": "user",
                            "id": "305504"
                        },
                        "id": "1494733"
                    }]
            },
            "caption":
            {
                "created_time": "1288644742",
                "text": "Caramel Beignets! Yummy :)",
                "from":
                {
                    "username": "mkram0s",
                    "first_name": "Kate",
                    "last_name": "Ramos",
                    "type": "user",
                    "id": "305504"
                },
                "id": "1494733"
            },
            "link": "https://www.instagram.com/p/9mDRRppH9R/",
            "likes":
            {
                "count": 0
            },
            "created_time": "1288644633",
            "images":
            {
                "low_resolution":
                {
                    "url": "http://distillery-dev.s3.amazonaws.com/media/2010/11/01/7a74951a954a44619b5b2afb64a7b17d_6.jpg",
                    "width": 480,
                    "height": 480
                },
                "thumbnail":
                {
                    "url": "http://distillery-dev.s3.amazonaws.com/media/2010/11/01/7a74951a954a44619b5b2afb64a7b17d_5.jpg",
                    "width": 150,
                    "height": 150
                },
                "standard_resolution":
                {
                    "url": "http://distillery-dev.s3.amazonaws.com/media/2010/11/01/7a74951a954a44619b5b2afb64a7b17d_7.jpg",
                    "width": 612,
                    "height": 612
                }
            },
            "user_has_liked": false,
            "id": "2086015",
            "user":
            {
                "username": "mkram0s",
                "profile_picture": "http://distillery.s3.amazonaws.com/profiles/profile_305504_75sq_1288204024.jpg",
                "id": "305504"
            }
        },
        {
            "type": "image",
            "tags": [],
            "location":
            {
                "latitude": 37.775382999999991,
                "id": "74480",
                "longitude": -122.223941,
                "name": "Fruitvale BART"
            },
            "comments":
            {
                "count": 1,
                "data": [
                    {
                        "created_time": "1288232768",
                        "text": "Bored on Bart ",
                        "from":
                        {
                            "username": "hannahc",
                            "first_name": "Hannah",
                            "last_name": "Coughlin ",
                            "type": "user",
                            "id": "304020"
                        },
                        "id": "1030446"
                    }]
            },
            "caption":
            {
                "created_time": "1288232768",
                "text": "Bored on Bart ",
                "from":
                {
                    "username": "hannahc",
                    "first_name": "Hannah",
                    "last_name": "Coughlin ",
                    "type": "user",
                    "id": "304020"
                },
                "id": "1030446"
            },
            "link": "http://localhost:8000/p/Fm-m/",
            "likes":
            {
                "count": 0
            },
            "created_time": "1288232753",
            "images":
            {
                "low_resolution":
                {
                    "url": "http://distillery-dev.s3.amazonaws.com/media/2010/10/27/1406596f54be46b4a538dd1d4b4c6f1e_6.jpg",
                    "width": 480,
                    "height": 480
                },
                "thumbnail":
                {
                    "url": "http://distillery-dev.s3.amazonaws.com/media/2010/10/27/1406596f54be46b4a538dd1d4b4c6f1e_5.jpg",
                    "width": 150,
                    "height": 150
                },
                "standard_resolution":
                {
                    "url": "http://distillery-dev.s3.amazonaws.com/media/2010/10/27/1406596f54be46b4a538dd1d4b4c6f1e_7.jpg",
                    "width": 612,
                    "height": 612
                }
            },
            "user_has_liked": false,
            "id": "1470374",
            "user":
            {
                "username": "hannahc",
                "profile_picture": "http://distillery.s3.amazonaws.com/profiles/profile_304020_75sq_1288194960.jpg",
                "id": "304020"
            }
        },
        {
            "type": "image",
            "tags": [],
            "location":
            {
                "latitude": 37.775382999999991,
                "id": "74480",
                "longitude": -122.223941,
                "name": "Fruitvale BART"
            },
            "comments":
            {
                "count": 1,
                "data": [
                    {
                        "created_time": "1288136425",
                        "text": "Emergency",
                        "from":
                        {
                            "username": "rolliefingaz",
                            "first_name": "Gregory",
                            "last_name": "Hurcomb",
                            "type": "user",
                            "id": "233618"
                        },
                        "id": "951869"
                    }]
            },
            "caption":
            {
                "created_time": "1288136425",
                "text": "Emergency",
                "from":
                {
                    "username": "rolliefingaz",
                    "first_name": "Gregory",
                    "last_name": "Hurcomb",
                    "type": "user",
                    "id": "233618"
                },
                "id": "951869"
            },
            "link": "http://localhost:8000/p/FOZf/",
            "likes":
            {
                "count": 0
            },
            "created_time": "1288136246",
            "images":
            {
                "low_resolution":
                {
                    "url": "http://distillery-dev.s3.amazonaws.com/media/2010/10/26/3459f1db2d6d422b950838715a04cb38_6.jpg",
                    "width": 480,
                    "height": 480
                },
                "thumbnail":
                {
                    "url": "http://distillery-dev.s3.amazonaws.com/media/2010/10/26/3459f1db2d6d422b950838715a04cb38_5.jpg",
                    "width": 150,
                    "height": 150
                },
                "standard_resolution":
                {
                    "url": "http://distillery-dev.s3.amazonaws.com/media/2010/10/26/3459f1db2d6d422b950838715a04cb38_7.jpg",
                    "width": 612,
                    "height": 612
                }
            },
            "user_has_liked": false,
            "id": "1369695",
            "user":
            {
                "username": "rolliefingaz",
                "profile_picture": "http://distillery.s3.amazonaws.com/profiles/profile_233618_75sq_1287785819.jpg",
                "id": "233618"
            }
        },
        {
            "type": "image",
            "tags": [],
            "location":
            {
                "latitude": 37.775194499999998,
                "id": "101132",
                "longitude": -122.227087,
                "name": "Guadalajara Mexican Cuisine and Bar"
            },
            "comments":
            {
                "count": 2,
                "data": [
                    {
                        "created_time": "1287969851",
                        "text": "Well hello there beautiful",
                        "from":
                        {
                            "username": "jorstaff",
                            "first_name": "Jordan",
                            "last_name": "Walker",
                            "type": "user",
                            "id": "154425"
                        },
                        "id": "818311"
                    },
                    {
                        "created_time": "1288072257",
                        "text": "Text me next time. I live down the st and I'm ways down for tacos!!",
                        "from":
                        {
                            "username": "melisaarreguin",
                            "first_name": "Melisa",
                            "last_name": "Arreguin",
                            "type": "user",
                            "id": "122725"
                        },
                        "id": "898954"
                    }]
            },
            "caption":
            {
                "created_time": "1287969851",
                "text": "Well hello there beautiful",
                "from":
                {
                    "username": "jorstaff",
                    "first_name": "Jordan",
                    "last_name": "Walker",
                    "type": "user",
                    "id": "154425"
                },
                "id": "818311"
            },
            "link": "http://localhost:8000/p/Ejh5/",
            "likes":
            {
                "count": 1
            },
            "created_time": "1287969827",
            "images":
            {
                "low_resolution":
                {
                    "url": "http://distillery-dev.s3.amazonaws.com/media/2010/10/24/8a466d809fe442a1a2df024543ae25e8_6.jpg",
                    "width": 480,
                    "height": 480
                },
                "thumbnail":
                {
                    "url": "http://distillery-dev.s3.amazonaws.com/media/2010/10/24/8a466d809fe442a1a2df024543ae25e8_5.jpg",
                    "width": 150,
                    "height": 150
                },
                "standard_resolution":
                {
                    "url": "http://distillery-dev.s3.amazonaws.com/media/2010/10/24/8a466d809fe442a1a2df024543ae25e8_7.jpg",
                    "width": 612,
                    "height": 612
                }
            },
            "user_has_liked": false,
            "id": "1194105",
            "user":
            {
                "username": "jorstaff",
                "profile_picture": "http://distillery.s3.amazonaws.com/profiles/profile_154425_75sq_1287413622.jpg",
                "id": "154425"
            }
        },
        {
            "type": "image",
            "tags": [],
            "location":
            {
                "latitude": 37.775382999999991,
                "id": "74480",
                "longitude": -122.223941,
                "name": "Fruitvale BART"
            },
            "comments":
            {
                "count": 1,
                "data": [
                    {
                        "created_time": "1287674437",
                        "text": "Morning commute",
                        "from":
                        {
                            "username": "catchfoot",
                            "first_name": "Rachel",
                            "last_name": "Lightfoot",
                            "type": "user",
                            "id": "208329"
                        },
                        "id": "555932"
                    }]
            },
            "caption":
            {
                "created_time": "1287674437",
                "text": "Morning commute",
                "from":
                {
                    "username": "catchfoot",
                    "first_name": "Rachel",
                    "last_name": "Lightfoot",
                    "type": "user",
                    "id": "208329"
                },
                "id": "555932"
            },
            "link": "http://localhost:8000/p/DMl1/",
            "likes":
            {
                "count": 0
            },
            "created_time": "1287674360",
            "images":
            {
                "low_resolution":
                {
                    "url": "http://distillery-dev.s3.amazonaws.com/media/2010/10/21/d9949ca81cb540d798acee59ea94223a_6.jpg",
                    "width": 480,
                    "height": 480
                },
                "thumbnail":
                {
                    "url": "http://distillery-dev.s3.amazonaws.com/media/2010/10/21/d9949ca81cb540d798acee59ea94223a_5.jpg",
                    "width": 150,
                    "height": 150
                },
                "standard_resolution":
                {
                    "url": "http://distillery-dev.s3.amazonaws.com/media/2010/10/21/d9949ca81cb540d798acee59ea94223a_7.jpg",
                    "width": 612,
                    "height": 612
                }
            },
            "user_has_liked": false,
            "id": "838005",
            "user":
            {
                "username": "catchfoot",
                "profile_picture": "http://distillery.s3.amazonaws.com/profiles/profile_208329_75sq_1288164413.jpg",
                "id": "208329"
            }
        },
        {
            "type": "image",
            "tags": [],
            "location":
            {
                "latitude": 37.775180799999987,
                "id": "68841",
                "longitude": -122.2270716,
                "name": "El Novillo Taco Truck"
            },
            "comments":
            {
                "count": 4,
                "data": [
                    {
                        "created_time": "1287585720",
                        "text": "Carne Asasa Torta. No Onions. ",
                        "from":
                        {
                            "username": "darodriguez",
                            "first_name": "David",
                            "last_name": "Rodriguez",
                            "type": "user",
                            "id": "113603"
                        },
                        "id": "495555"
                    },
                    {
                        "created_time": "1287585854",
                        "text": "Hey, I wanted onions. :(",
                        "from":
                        {
                            "username": "melisaarreguin",
                            "first_name": "Melisa",
                            "last_name": "Arreguin",
                            "type": "user",
                            "id": "122725"
                        },
                        "id": "495675"
                    },
                    {
                        "created_time": "1287603871",
                        "text": "You got onions. You had the al pastor, remember!?",
                        "from":
                        {
                            "username": "darodriguez",
                            "first_name": "David",
                            "last_name": "Rodriguez",
                            "type": "user",
                            "id": "113603"
                        },
                        "id": "507172"
                    },
                    {
                        "created_time": "1287606841",
                        "text": "Oh shiiiit this would have taken everything to the next level",
                        "from":
                        {
                            "username": "jorstaff",
                            "first_name": "Jordan",
                            "last_name": "Walker",
                            "type": "user",
                            "id": "154425"
                        },
                        "id": "508433"
                    }]
            },
            "caption":
            {
                "created_time": "1287585720",
                "text": "Carne Asasa Torta. No Onions. ",
                "from":
                {
                    "username": "darodriguez",
                    "first_name": "David",
                    "last_name": "Rodriguez",
                    "type": "user",
                    "id": "113603"
                },
                "id": "495555"
            },
            "link": "http://localhost:8000/p/C5cU/",
            "likes":
            {
                "count": 1
            },
            "created_time": "1287585671",
            "images":
            {
                "low_resolution":
                {
                    "url": "http://distillery-dev.s3.amazonaws.com/media/2010/10/20/ad6e8429c40c40ffabe0813ba302a479_6.jpg",
                    "width": 480,
                    "height": 480
                },
                "thumbnail":
                {
                    "url": "http://distillery-dev.s3.amazonaws.com/media/2010/10/20/ad6e8429c40c40ffabe0813ba302a479_5.jpg",
                    "width": 150,
                    "height": 150
                },
                "standard_resolution":
                {
                    "url": "http://distillery-dev.s3.amazonaws.com/media/2010/10/20/ad6e8429c40c40ffabe0813ba302a479_7.jpg",
                    "width": 612,
                    "height": 612
                }
            },
            "user_has_liked": false,
            "id": "759572",
            "user":
            {
                "username": "darodriguez",
                "profile_picture": "http://distillery.s3.amazonaws.com/profiles/profile_113603_75sq_1287035206.jpg",
                "id": "113603"
            }
        },
        {
            "type": "image",
            "tags": [],
            "location":
            {
                "latitude": 37.775180799999987,
                "id": "68841",
                "longitude": -122.2270716,
                "name": "El Novillo Taco Truck"
            },
            "comments":
            {
                "count": 1,
                "data": [
                    {
                        "created_time": "1287585453",
                        "text": "Tortas. ",
                        "from":
                        {
                            "username": "darodriguez",
                            "first_name": "David",
                            "last_name": "Rodriguez",
                            "type": "user",
                            "id": "113603"
                        },
                        "id": "495311"
                    }]
            },
            "caption":
            {
                "created_time": "1287585453",
                "text": "Tortas. ",
                "from":
                {
                    "username": "darodriguez",
                    "first_name": "David",
                    "last_name": "Rodriguez",
                    "type": "user",
                    "id": "113603"
                },
                "id": "495311"
            },
            "link": "http://localhost:8000/p/C5Wr/",
            "likes":
            {
                "count": 0
            },
            "created_time": "1287585407",
            "images":
            {
                "low_resolution":
                {
                    "url": "http://distillery-dev.s3.amazonaws.com/media/2010/10/20/1fde15405b6349ef949c9a8f5498868e_6.jpg",
                    "width": 480,
                    "height": 480
                },
                "thumbnail":
                {
                    "url": "http://distillery-dev.s3.amazonaws.com/media/2010/10/20/1fde15405b6349ef949c9a8f5498868e_5.jpg",
                    "width": 150,
                    "height": 150
                },
                "standard_resolution":
                {
                    "url": "http://distillery-dev.s3.amazonaws.com/media/2010/10/20/1fde15405b6349ef949c9a8f5498868e_7.jpg",
                    "width": 612,
                    "height": 612
                }
            },
            "user_has_liked": false,
            "id": "759211",
            "user":
            {
                "username": "darodriguez",
                "profile_picture": "http://distillery.s3.amazonaws.com/profiles/profile_113603_75sq_1287035206.jpg",
                "id": "113603"
            }
        }]
}

Comments

get($mediaId)

Get a list of recent comments on a media object.

Parameters:
  • $mediaId (int) – The ID of the media object
Returns:

Response

Example request:

$client   = new Client($clientId, $clientSecret, $accessToken, $redirectUrl);
$response = $client->comments()->get(420);
echo json_encode($response->get());

Example response:

{
  "data": [
    {
      "created_time": "1280780324",
      "text": "Really amazing photo!",
      "from":
      {
        "username": "snoopdogg",
        "profile_picture": "http://images.instagram.com/profiles/profile_16_75sq_1305612434.jpg",
        "id": "1574083",
        "full_name": "Snoop Dogg"
      },
      "id": "420"
    }]
}
create($mediaId, $text)

Create a comment on a media object using the following rules:

  • The total length of the comment cannot exceed 300 characters.
  • The comment cannot contain more than 4 hashtags.
  • The comment cannot contain more than 1 URL.
  • The comment cannot consist of all capital letters.
Parameters:
  • $mediaId
  • $text (string) – Text to post as a comment on the media object as specified by $mediaId
Returns:

Response

Example request:

$client   = new Client($clientId, $clientSecret, $accessToken, $redirectUrl);
$response = $client->comments()->create(315, 'A comment');
echo json_encode($response->get());

Example response:

{
  "meta":
  {
    "code": 200
  },
  "data": null
}
delete($mediaId, $commentId)

Remove a comment either on the owner of the access token’s media object or authored by the owner of the access token.

Parameters:
  • $mediaId
  • $commentId (string) – The ID of the comment
Returns:

Response

Example request:

$client   = new Client($clientId, $clientSecret, $accessToken, $redirectUrl);
$response = $client->comments()->delete(315, 1);
echo json_encode($response->get());

Example response:

{
  "meta":
  {
    "code": 200
  },
  "data": null
}

Likes

get($mediaId)

Get a list of likes on a media object.

Parameters:
  • $mediaId (int) – The ID of the media object
Returns:

Response

Example request:

$client   = new Client($clientId, $clientSecret, $accessToken, $redirectUrl);
$response = $client->likes()->get(420);
echo json_encode($response->get());

Example response:

{
  "meta":
  {
    "code": 200
  },
  "data": [
    {
      "username": "jec",
      "profile_picture": "http://distillery.s3.amazonaws.com/profiles/profile_16_75sq_1288978412.jpg",
      "id": "16"
    },
    {
      "username": "mikeyk",
      "profile_picture": "http://distillery.s3.amazonaws.com/profiles/profile_4_75sq_1292324747_debug.jpg",
      "id": "4"
    },
    {
      "username": "nicole",
      "profile_picture": "http://distillery.s3.amazonaws.com/profiles/profile_6_75sq_1285365377.jpg",
      "id": "6"
    }]
}
like($mediaId)

Set a like on a media object by the currently authenticated user.

Parameters:
  • $mediaId (int) – The ID of the media object
Returns:

Response

Example request:

$client   = new Client($clientId, $clientSecret, $accessToken, $redirectUrl);
$response = $client->likes()->like(315);
echo json_encode($response->get());

Example response:

{
  "meta":
  {
    "code": 200
  },
  "data": null
}
unlike($mediaId)

Remove a like on a media object by the currently authenticated user.

Parameters:
  • $mediaId (int) – The ID of the media object
Returns:

Response

Example request:

$client   = new Client($clientId, $clientSecret, $accessToken, $redirectUrl);
$response = $client->likes()->unlike(315);
echo json_encode($response->get());

Example response:

{
  "meta":
  {
    "code": 200
  },
  "data": null
}

Tags

get($tag)

Get information about a tag object.

Parameters:
  • $tag (string) – Name of the tag
Returns:

Response

Example request:

$client   = new Client($clientId, $clientSecret, $accessToken, $redirectUrl);
$response = $client->tags()->get('nofilter');
echo json_encode($response->get());

Example response:

{
  "data":
  {
    "media_count": 472,
    "name": "nofilter"
  }
}
getRecentMedia($tag, $count = null, $minTagId = null, $maxTagId = null)

Get a list of recently tagged media.

Parameters:
  • $tag
  • $count
  • $minTagId (string|null) – Return media before this min_tag_id
  • $maxTagId (string|null) – Return media after this max_tag_id
Returns:

Response

Example request:

$client   = new Client($clientId, $clientSecret, $accessToken, $redirectUrl);
$response = $client->tags()->getRecentMedia('snowy');
echo json_encode($response->get());

Example response:

{
  "data": [
    {
      "type": "image",
      "users_in_photo": [],
      "filter": "Earlybird",
      "tags": ["snow"],
      "comments":
      {
        "count": 3
      },
      "caption":
      {
        "created_time": "1296703540",
        "text": "#Snow",
        "from":
        {
          "username": "emohatch",
          "id": "1242695"
        },
        "id": "26589964"
      },
      "likes":
      {
        "count": 1
      },
      "link": "http://instagr.am/p/BWl6P/",
      "user":
      {
        "username": "emohatch",
        "profile_picture": "http://distillery.s3.amazonaws.com/profiles/profile_1242695_75sq_1293915800.jpg",
        "id": "1242695",
        "full_name": "Dave"
      },
      "created_time": "1296703536",
      "images":
      {
        "low_resolution":
        {
          "url": "http://distillery.s3.amazonaws.com/media/2011/02/02/f9443f3443484c40b4792fa7c76214d5_6.jpg",
          "width": 306,
          "height": 306
        },
        "thumbnail":
        {
          "url": "http://distillery.s3.amazonaws.com/media/2011/02/02/f9443f3443484c40b4792fa7c76214d5_5.jpg",
          "width": 150,
          "height": 150
        },
        "standard_resolution":
        {
          "url": "http://distillery.s3.amazonaws.com/media/2011/02/02/f9443f3443484c40b4792fa7c76214d5_7.jpg",
          "width": 612,
          "height": 612
        }
      },
      "id": "22699663",
      "location": null
    },
    {
      "type": "video",
      "videos":
      {
        "low_resolution":
        {
          "url": "http://distilleryvesper9-13.ak.instagram.com/090d06dad9cd11e2aa0912313817975d_102.mp4",
          "width": 480,
          "height": 480
        },
        "standard_resolution":
        {
          "url": "http://distilleryvesper9-13.ak.instagram.com/090d06dad9cd11e2aa0912313817975d_101.mp4",
          "width": 640,
          "height": 640
        },
        "users_in_photo": null,
        "filter": "Vesper",
        "tags": ["snow"],
        "comments":
        {
          "count": 2
        },
        "caption":
        {
          "created_time": "1296703540",
          "text": "#Snow",
          "from":
          {
            "username": "emohatch",
            "id": "1242695"
          },
          "id": "26589964"
        },
        "likes":
        {
          "count": 1
        },
        "link": "http://instagr.am/p/D/",
        "user":
        {
          "username": "kevin",
          "full_name": "Kevin S",
          "profile_picture": "...",
          "id": "3"
        },
        "created_time": "1279340983",
        "images":
        {
          "low_resolution":
          {
            "url": "http://distilleryimage2.ak.instagram.com/11f75f1cd9cc11e2a0fd22000aa8039a_6.jpg",
            "width": 306,
            "height": 306
          },
          "thumbnail":
          {
            "url": "http://distilleryimage2.ak.instagram.com/11f75f1cd9cc11e2a0fd22000aa8039a_5.jpg",
            "width": 150,
            "height": 150
          },
          "standard_resolution":
          {
            "url": "http://distilleryimage2.ak.instagram.com/11f75f1cd9cc11e2a0fd22000aa8039a_7.jpg",
            "width": 612,
            "height": 612
          }
        },
        "id": "3",
        "location": null
      }
    }]
}
search($tag)

Search for tags by name.

Parameters:
  • $tag (string) – Name of the tag
Returns:

Response

Example request:

$client   = new Client($clientId, $clientSecret, $accessToken, $redirectUrl);
$response = $client->tags()->search('snowy');
echo json_encode($response->get());

Example response:

{
  "data": [
    {
      "media_count": 43590,
      "name": "snowy"
    },
    {
      "media_count": 3264,
      "name": "snowyday"
    },
    {
      "media_count": 1880,
      "name": "snowymountains"
    }]
}

Locations

get($id)

Get information about a location.

Parameters:
  • $id (string) – The ID of the location
Returns:

Response

Example request:

$client   = new Client($clientId, $clientSecret, $accessToken, $redirectUrl);
$response = $client->locations()->get('1');
echo json_encode($response->get());

Example response:

{
  "data":
  {
    "id": "1",
    "name": "Dogpatch Labs",
    "latitude": 37.782,
    "longitude": -122.387
  }
}
getRecentMedia($id, $minId = null, $maxId = null)

Get a list of recent media objects from a given location.

Parameters:
  • $id
  • $minId (string|null) – Return media before this min_id
  • $maxId (string|null) – Return media after this max_id
Returns:

Response

Example request:

$client   = new Client($clientId, $clientSecret, $accessToken, $redirectUrl);
$response = $client->locations()->getRecentMedia('514276');
echo json_encode($response->get());

Example response:

{
  "data": [
    {
      "type": "image",
      "users_in_photo": [],
      "filter": "Earlybird",
      "tags": [
        "expobar"
      ],
      "comments":
      {
        "count": 0
      },
      "caption":
      {
        "created_time": "1296532028",
        "text": "@mikeyk pulls a shot on our #Expobar",
        "from":
        {
          "username": "josh",
          "full_name": "Josh Riedel",
          "type": "user",
          "id": "33"
        },
        "id": "25663923"
      },
      "likes":
      {
        "count": 35
      },
      "link": "http://instagr.am/p/BUS3X/",
      "user":
      {
        "username": "josh",
        "profile_picture": "...",
        "id": "33"
      },
      "created_time": "1296531955",
      "images":
      {
        "low_resolution":
        {
          "url": "http://distillery.s3.amazonaws.com/media/2011/01/31/32d364527512437a8a17ba308a7c83bb_6.jpg",
          "width": 306,
          "height": 306
        },
        "thumbnail":
        {
          "url": "http://distillery.s3.amazonaws.com/media/2011/01/31/32d364527512437a8a17ba308a7c83bb_5.jpg",
          "width": 150,
          "height": 150
        },
        "standard_resolution":
        {
          "url": "http://distillery.s3.amazonaws.com/media/2011/01/31/32d364527512437a8a17ba308a7c83bb_7.jpg",
          "width": 612,
          "height": 612
        }
      },
      "user_has_liked": false,
      "id": "22097367",
      "location":
      {
        "latitude": 37.780885099999999,
        "id": "514276",
        "longitude": -122.3948632,
        "name": "Instagram"
      }
    },
    {
      "type": "video",
      "videos":
      {
        "low_resolution":
        {
          "url": "http://distilleryvesper9-13.ak.instagram.com/090d06dad9cd11e2aa0912313817975d_102.mp4",
          "width": 480,
          "height": 480
        },
        "standard_resolution":
        {
          "url": "http://distilleryvesper9-13.ak.instagram.com/090d06dad9cd11e2aa0912313817975d_101.mp4",
          "width": 640,
          "height": 640
        },
        "users_in_photo": null,
        "filter": "Vesper",
        "tags": [],
        "comments":
        {
          "count": 2
        },
        "caption": null,
        "likes":
        {
          "count": 1
        },
        "link": "http://instagr.am/p/D/",
        "user":
        {
          "username": "kevin",
          "full_name": "Kevin S",
          "profile_picture": "...",
          "id": "3"
        },
        "created_time": "1279340983",
        "images":
        {
          "low_resolution":
          {
            "url": "http://distilleryimage2.ak.instagram.com/11f75f1cd9cc11e2a0fd22000aa8039a_6.jpg",
            "width": 306,
            "height": 306
          },
          "thumbnail":
          {
            "url": "http://distilleryimage2.ak.instagram.com/11f75f1cd9cc11e2a0fd22000aa8039a_5.jpg",
            "width": 150,
            "height": 150
          },
          "standard_resolution":
          {
            "url": "http://distilleryimage2.ak.instagram.com/11f75f1cd9cc11e2a0fd22000aa8039a_7.jpg",
            "width": 612,
            "height": 612
          }
        },
        "id": "3",
        "location":
        {
          "latitude": 37.780885099999999,
          "id": "514276",
          "longitude": -122.3948632,
          "name": "Instagram"
        }
      }
    }]
}
search($latitude, $longitude, $distance = 1000)

Search for a location by geographic coordinate.

Parameters:
  • $latitude (int) – Latitude of the center search coordinate. If used, $longitude is required
  • $longitude (int) – Longitude of the center search coordinate. If used, $latitude is required
  • $distance (int) – The distance in metres. Default is 1000 m, max distance is 5km
Returns:

Response

Example request:

$client   = new Client($clientId, $clientSecret, $accessToken, $redirectUrl);
$response = $client->locations()->search(48.858325999999998, 2.294505);
echo json_encode($response->get());

Example response:

{
  "data": [
    {
      "id": "788029",
      "latitude": 48.858844300000001,
      "longitude": 2.2943506,
      "name": "Eiffel Tower, Paris"
    },
    {
      "id": "545331",
      "latitude": 48.858334059662262,
      "longitude": 2.2943401336669909,
      "name": "Restaurant 58 Tour Eiffel"
    },
    {
      "id": "421930",
      "latitude": 48.858325999999998,
      "longitude": 2.294505,
      "name": "American Library in Paris"
    }]
}
searchByFacebookPlacesId($facebookPlacesId)

Search for a location by Facebook Places ID.

Parameters:
  • $facebookPlacesId (int) – A Facebook Places ID
Returns:

Response

Example request:

$client   = new Client($clientId, $clientSecret, $accessToken, $redirectUrl);
$response = $client->locations()->searchByFacebookPlacesId(114226462057675);
echo json_encode($response->get());

Example response:

{
  "meta":
  {
    "code": 200
  },
  "data": [
    {
      "id": "788029",
      "latitude": 48.858844300000001,
      "longitude": 2.2943506,
      "name": "Eiffel Tower, Paris"
    }]
}
searchByFoursquareId($foursquareId)

Search for a location by Foursquare location ID.

Parameters:
  • $foursquareId (string) – A Foursquare V2 API location ID
Returns:

Response

Example request:

$client   = new Client($clientId, $clientSecret, $accessToken, $redirectUrl);
$response = $client->locations()->searchByFoursquareId('51a2445e5019c80b56934c75');
echo json_encode($response->get());

Example response:

{
  "meta":
  {
    "code": 200
  },
  "data": [
    {
      "id": "788029",
      "latitude": 48.858844300000001,
      "longitude": 2.2943506,
      "name": "Eiffel Tower, Paris"
    }]
}