更新时间:2022-10-30 08:24:05
您可以使用以下Instagram API端点获取用户关注的人员列表.
https://api.instagram.com/v1/users/{user-id}/follows?access_token=ACCESS-TOKEN
这是该端点的完整文档. GET /users/user-id/follows >
这是执行该端点的示例响应.
由于此终结点需要一个user-id
(而不是user-name
),因此取决于您编写API客户端的方式,您可能必须调用 IANAL ,但考虑到它已记录在他们的API中,并查看了使用条款,我不认为这样做是不合法的.
I would like to know how I can retrieve the list of people a user is following on Instagram. This is given that this particular user is someone that I follow. So I have access to his/her photos and his followers on the Instagram app.
How can I use the Instagram API to do this? Is this legal to do?
You can use the following Instagram API Endpoint to get a list of people a user is following.
https://api.instagram.com/v1/users/{user-id}/follows?access_token=ACCESS-TOKEN
Here's the complete documentation for that endpoint. GET /users/user-id/follows
And here's a sample response from executing that endpoint.
Since this endpoint required a user-id
(and not user-name
), depending on how you've written your API client, you might have to make a call to the /users/search endpoint with a username, and then get the user-id from the response and pass it on to the above /users/user-id/follows
endpoint to get the list of followers.
IANAL, but considering it's documented in their API, and looking at the terms of use, I don't see how this wouldn't be legal to do.