您需要access token 才能使用 Instagram API。因此,如果您收到 access token,则可以使用 Instagram API。
要获取有关用户的基本信息,请使用以下命令:
https://api.instagram.com/v1/users/{user-id}/?access_token=ACCESS-TOKEN
{user-id} 是不是用户名。要从用户名中获取{user-id},请使用:
https://api.instagram.com/v1/users/search?q=[USERNAME]&access_token=[ACCESS TOKEN]
要获得access token,请使用:
https://instagram.com/oauth/authorize/?client_id=[CLIENT_ID_HERE]&redirect_uri=http://localhost&response_type=token
最后的响应是这样的:
{
meta: {
code: 200
},
data: {
username: "lanadelrey",
bio: "Put not your trust in princes, nor in the son of man, in whom there is no help",
website: "http://www.lanadelrey.com",
profile_picture: "https://igcdn-photos-c-a.akamaihd.net/hphotos-ak-xpf1/t51.2885-19/10948781_564619503641170_898618667_a.jpg",
full_name: "Lana Del Rey",
counts: {
media: 114,
followed_by: 4207076,
follows: 78
},
id: "305506437"
}
}