Instagram get username from userId

前端 未结 3 1422
小鲜肉
小鲜肉 2021-02-09 05:34

I have the ability to get userId from username, but I do not have the ability to get username from userId.

I have a database of userId because that is all my app needed

3条回答
  •  猫巷女王i
    2021-02-09 05:43

    Instagram exposes a User Endpoint for that. From http://instagram.com/developer/endpoints/users/#get_users, you can use:

    https://api.instagram.com/v1/users/(user id)/?access_token=ACCESS-TOKEN

    The response is JSON and the data you want is data.username

提交回复
热议问题