python - Trying to find follower count in Instagram API -



python - Trying to find follower count in Instagram API -

i looking find follower count particular user much if using instagram api console:

from instagram.client import instagramapi access_token = "access token" api = instagramapi(access_token=access_token) user_info = api.user(user_id) print user_info

what getting api console when search user_id

{ "meta": { "code": 200 }, "data": { "username": "igname", "bio": "comments, "website": "http://instagram, "profile_picture": "picture", "full_name": "igrealname", "counts": { "media": number1, "followed_by": number2, "follows": number3 }, "id": "iguserid" }

i looking username, follows, , followed fields output python.

all getting username , it.

when phone call user info returned you. endpoint is: https://api.instagram.com/v1/users/userid/

the info want in "counts" array.

but, in example, user private. when private can't counts nether medias. response have 400 header (bad request) , body be:

{"meta": {"error_type":"apinotallowederror", "code":400,"error_message":"you cannot view resource" } }

if wish, comment here user id double check it.

python json instagram

Comments

Popular posts from this blog

xslt - DocBook 5 to PDF transform failing with error: "fo:flow" is missing child elements. Required content model: marker* -

mediawiki - How do I insert tables inside infoboxes on Wikia pages? -

Local Service User Logged into Windows -