An Instagram media
GET /v9.0/{instagram-media-id} HTTP/1.1
Host: graph.facebook.com
/* PHP SDK v5.0.0 */
/* make the API call */
try {
// Returns a `Facebook\FacebookResponse` object
$response = $fb->get(
'/{instagram-media-id}',
'{access-token}'
);
} catch(Facebook\Exceptions\FacebookResponseException $e) {
echo 'Graph returned an error: ' . $e->getMessage();
exit;
} catch(Facebook\Exceptions\FacebookSDKException $e) {
echo 'Facebook SDK returned an error: ' . $e->getMessage();
exit;
}
$graphNode = $response->getGraphNode();
/* handle the result */
/* make the API call */
FB.api(
"/{instagram-media-id}",
function (response) {
if (response && !response.error) {
/* handle the result */
}
}
);
/* make the API call */
new GraphRequest(
AccessToken.getCurrentAccessToken(),
"/{instagram-media-id}",
null,
HttpMethod.GET,
new GraphRequest.Callback() {
public void onCompleted(GraphResponse response) {
/* handle the result */
}
}
).executeAsync();
// For more complex open graph stories, use `FBSDKShareAPI`
// with `FBSDKShareOpenGraphContent`
/* make the API call */
FBSDKGraphRequest *request = [[FBSDKGraphRequest alloc]
initWithGraphPath:@"/{instagram-media-id}"
parameters:params
HTTPMethod:@"GET"];
[request startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection,
id result,
NSError *error) {
// Handle the result
}];
Field | Description |
---|---|
id numeric string | ID of the Instagram media |
caption_text string | Caption text |
comment_count int32 | Number of comments |
content_type int32 | 0 for photo, 1 for video |
display_url string | URL of the photo or cover frame |
filter_name string | Name of filter |
latitude float | Latitude of the location |
like_count int32 | Number of likes |
location | Location data |
location_name string | Name of location for location tag |
longitude float | Longitude of the location |
owner_instagram_user | The Instagram user that owns this media. |
permalink string | Link to the media page on Instagram |
taken_at datetime | When the media was created |
video_url string | URL of the video |
Edge | Description |
---|---|
Instagram comments |
Error | Description |
---|---|
80002 | There have been too many calls to this Instagram account. Wait a bit and try again. For more info, please refer to https://developers.facebook.com/docs/graph-api/overview/rate-limiting. |
100 | Invalid parameter |
200 | Permissions error |
190 | Invalid OAuth 2.0 Access Token |