问题
I've google for several hours now and I haven't found a suitable solution to my "problem". My previous solution was to use an url like this for fetching json-data of images related to my Instagram account.
https://www.instagram.com/[account-name-here]/media
For some reason this url doesn't work any more (404?). Perhaps Instagram has done some changes on their side.
That in mind I've searched for an alternative solution, with no luck.
I'm super exited to hear if any of you guys can point me in the right direction.
And ... I'm using C# :-)
回答1:
You can create a client i have an example here
public async Task<object> GetMediaInfo(string mediaId)
{
string clientId = "YOUR_CLIENT_ID";
string clientSecret = "YOUR_CLIENT_SECRET";
string accessToken = "A_VALID_ACCESS_TOKEN";
InstagramClient client = new InstagramClient(clientId,clientSecret);
var media = await client.MediaEndpoints.GetMediaInfoAsync(mediaId, accessToken);
//I use Json.NET for parsing the result
var mediaJson = JsonConvert.DeserializeObject(media);
//You can deserialize json result to one of the models in InstagramCSharp or to your custom model
//var mediaJson = JsonConvert.DeserializeObject<Envelope<Media>>(mediaJson);
return mediaJson;
}
}
回答2:
you can try this
https://www.instagram.com/USERID/?__a=1
it is working with me :)
来源:https://stackoverflow.com/questions/47238978/get-list-of-images-from-instagram-for-explicit-user-account