2015-06-29 186 views
1

的基本信息,我有Instagram信息頁/像不同用戶的網址數量https://instagram.com/xxxxx/等等等等等等。我想獲得該頁面獲取Instagram的網頁

name, number of followers, description, bio,

我尋覓的以下信息,無不流露出使用訪問令牌。但是,如果我從我的賬戶獲取訪問令牌,我很困惑,我怎樣才能獲得其他頁面的信息?

請指導我該怎麼做?

回答

2

你需要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" 
    } 
} 
+0

並通過這樣做我可以獲得任何用戶的信息? –

+0

@AwaisQarni是的,你可以。你只需要他們的'{user-id}'。我解釋瞭如何得到它。 – Sky

+0

這正是我所需要的 –