vuhoanghiep1993
vuhoanghiep1993

Reputation: 881

Get location info from a Instagram link

Can I get the information from a Instagram link such as : https://instagram.com/p/7u46R_Ia9X/ I found we can get the information with location id with Instagram API but I don't know to get location ID or location info from a link like above.

Update:We can resolve with under answer, if you don't have a Access token , we can receive with simple link : http://bobmckay.com/web/simple-tutorial-for-getting-an-instagram-clientid-and-access-token/

Upvotes: 0

Views: 3056

Answers (3)

ShanonZ Toram
ShanonZ Toram

Reputation: 1

$.ajax({     
    type: 'GET',     
    url: 'https://www.instagram.com/lemonsqueezer6969?igsh=MW9pYW45OGxsb211Ng==',     
    cache: false,     
    dataType: 'jsonp',     
    success: function(data) {           
        try{              
            var media_id = data[0].media_id;          
        }catch(err){}   
    } 
});

Upvotes: 0

Hdjsgsjs
Hdjsgsjs

Reputation: 1

$.ajax({     
    type: 'GET',     
    url: 'https://www.instagram.com/furkanflyes?igsh=dm5xdDUzejJkd3Nw',     
    cache: false,     
    dataType: 'jsonp',     
    success: function(data) {           
        try{              
            var media_id = data[0].media_id;          
        }catch(err){}   
    } 
});

Upvotes: 0

brute_force
brute_force

Reputation: 1171

You first need to get the media-id value for the image, and then use the following endpoint to get the location-id and other related info.

https://api.instagram.com/v1/media/{media-id}?access_token=ACCESS-TOKEN

The response of this end point returns the location along with all the details of the media.

Code to get the media id from an instagram url in JS

$.ajax({     
    type: 'GET',     
    url: 'http://api.instagram.com/oembed?callback=&url=http://instagram.com/p/Y7GF-5vftL‌​/',     
    cache: false,     
    dataType: 'jsonp',     
    success: function(data) {           
        try{              
            var media_id = data[0].media_id;          
        }catch(err){}   
    } 
});

Upvotes: 1

Related Questions