How to retrieve Instagram followers' locations? - instagram

I've searched through the topics but it seems that exactly this questions hadn't been asked yet.
Could anyone, please, share their opinion on how to retrieve an Instagram account followers' posts locations in order to map them after that on one map?
On the account there are around 2000-2100 followers.
Thank you in advance!

To get detailed user information from instagram you have to use the GET /users/user-id endpoint.
So to get the location information for all an accounts followers you have to use
GET/users/user-id/followed-by and iterate through the results.
Be careful. Instagram api limit is currently 5000 requests per hour. Accounts with more followers than that you will have to use some form of queue
Edit: just seen you want the post locations:
Similar method, excite instead of GET /users/user-id user GET /users/user-id/recent and grab the locations of the media. Note in my experience the location function is used very little by instagram users. I once pulled 3000 media that had only 20 media with a location

You cannot just location of a user using APIs, there are couple ways you can guess the location, by looking for bio information and check if they have any location specified or you can check location of all the photos posted by a user and kind of guess the location by analyzing where most of the photos are being posted at.
you can use the API /users/user-id/recent to get all the photos from a user and look for location property in API response and map it on google map.
you can use http://gramfeed.com to see user photos with a map of photo locations, you will have to do this for each user and determine the location.

Related

Instagram API Possible Solution

I have one question, with an Instagram Username. Can I get back data from that user? for example, get photos and number of followers? (only if profile is public)
I'm creating a website were users can upload their Instagram username #example and based on that scrap and create a profile on the website with their latest photos and the number of followers (all of this without logging).
I think This image will help to understand what I'm trying to achieve, Can someone guide me? this is possible with Instagram API?
Yes this was possible recently with https://www.instagram.com/<username>/?__a=1 but instagram recently blocked this possibility.
I'll update my post if I find a new method.

App only approved for basic scope

So my app just got approved, but only with the basic scope. I am creating a MyFollowers app that track new, lost followers etc.. I added video showing my login. Then the amount of following, followers and posts. Then I showed sandbox users for not follow me back.
These are the scopes I need: basic+follower_list+public_content+relationships
Any ideas what to do to get more scopes accepted?
From the Instagram page:
As of 10/1/2017, all permissions other than the basic permission will be unavailable to submit for or obtain.
If you need these permissions you would have to use the new Instagram graph API wich works only for instagram business accounts.
From my understanding, the basic permission ("basic - to read a user’s profile info and media"), which is the only one they are taking requests for now is for photo printing apps and apps like Tinder that retrieve photos.
I have been reading up on this the last few days and can't seem to find much else on the basic permission and how else it may apply, e.g. displaying posts, mind some forums say it doesn't allow this.
However If you look at this link they seem to be getting the thumbs up http://www.iamspecialized.com
Also, Tinder enables users to display 20 (i think) photos directly from Instagram which of course links the viewer to Instagram if they wish, thus they are displaying posts in a way.
See also https://vibbi.com which displays public profiles and posts.
From what sites I've seen with approval, and what I have read, it appears to me that the clause: "to read a user’s profile info and media" is quite broad so that Instagram have discretion as to who they approve. So, if you're not putting forward a great product built on a big budget, then you're likely not to be approved. IMO.
I will be going through the permission process next year. Would love to hear from others who have done so.

Instagram search user api always return empty result with success code

We are invoking instagram search users api to get profile list as
https://api.instagram.com/v1/users/search?q={search-term}&access_token={access-token}
but we are getting always empty result with success code as
{"meta": {"code": 200}, "data": []}
Our search term would be always instagram username i.e. username portion from https://www.instagram.com/username/
I remember this was working before 2-3 months. Any other are facing similar issue?
Sounds like you already figured out your problem. In case anyone else is having the same problem, here's a short article summarizing how Instagram's Sandbox Mode works.
TL;DR
“Sandbox mode” is the (unintuitively-named) gatekeeper walling off
most of what you want to do. This is the default status for all
clients, that have not undergone the strict submission process. An API
client in sandbox mode has extremely limited permissions. In fact, it
has fewer permissions than an anonymous user viewing public content
because your app basically lives on a tiny desert island in which you
are the only Instagram user and only your past twenty posts exist. So,
for example, the /media/search endpoint will only return the media you
uploaded near a given location, excluding the media from everyone else
or any posts beyond your last twenty.
So your API call is succeeding. It just isn't finding any results because it can only "see" other sanbox users for your client.

Instagram feeds using tag name of particular user

I am trying to fetch the instagram feeds to my site using tag name.
https://api.instagram.com/v1/tags/{tag-name}?access_token=ACCESS-TOKEN
above is the api which I am using to get the feeds.
Now the feeds are displaying from all the users who use the tag. I need to restrict the feeds for the particular user who use the tag name.
Anyone come across this?
Thanks,
The current version of the Instagram Api does not have an endpoint that will allow you to get media by tag-name AND user-id. Your best bet is to use 1 of the following endpoints, and then loop through the results and filter out the media that matches the 2nd condition.
Search for posts by given hashtag's name using GET /tags/{tag-name}/media/recent API endpoint request and then filter the response list of media to match the user-id for the particular user in question.
or
Search for posts by the particular user using GET /users/{user-id}/media/recent API endpoint request and then manually check every post if its tags array contains the specific hashtag you are looking for.
I recommend you go with option 2 as that will be faster, since an individual user feed is a much smaller data set than media from 1000s of Instagram users tagged with a hashtag.

How to grab instagram users based on a hashtag?

is there a way to grab instagram users based on a specific hashtag ?
I run contests based on re posting photos with specified hashtag then randomly pick a winner, i need a tool that can grab the usernames of those who reposted that photo and used that hashtag.
You can query instagram using the API. There are official clients for both python and ruby.
You didn't specify what language/platform you are using, so I'll give you the generic approach.
Query instagram using the Tag Recent Media endpoint.
In the response, you will receive a user object that has the user's username, id, profile url, and so on. This should be enough to do what you are describing.
As far as tools, there aren't great options to probably do things exactly how you want. If you just want a simple contest, you could use statigram, but it's not free.
If you roll your own solution, I highly recommend you also do the following:
Implement a rate limiting mechanism such as a task queue so you don't exceed your API calls (5000 per hour for most calls). Also useful for failures/network hicups, etc.
Have users authenticate so you can use OAuth to extend your API calls to 5000/per user/hour to get around #1.
Try the subscribe API if there won't be many items. You can subscribe to a specific tag as well, and you will get a change notification. At that point though you need to retrieve the actual media item(s), and this can cost a lot of API calls depending on how frequent and what volume these changes occur.
If your users don't have much photos/relatively small/known in advance, you can actually query the user's recent media instead and filter in your own code by hash tag.

Resources