Instagram graph API IG hashtag - instagram-api

I need to get media from connected instagram profile by hashtag. For most part, I was successful, however I stumbled upon a few limitation I cannot find workaround for.
When I fetch media on IG user, I can send username as a field and get it back. However, I cannot get username on IG hashtag, it is not listed as field in documentation, and throws error if I send one.
I don't want to get back albums on IG hashtag, just image and video, but I can't seem to find a way to filter by type
What is interesting, I found an example of site that displays username when filtering by hashtag, but the only way I could think of achiving this is to send request for media details for each media I receive. Needless to say, I want to avoid it.
Has anyone had a similar problem and solved it?

Related

How to get linkedin followers when they have crossed 500 (i am using oauth passportjs in nodejs)

Is there a way to get count of linkedin followers of person authenticating through oAuth in my site when they have crossed 500? for example when his followers are 600 linkedin only shows it 500, but when the followers is 450 then it shows 450. Any help will be appreciated.
I've found a workaround to fetch follower counts, without using the API.
I used the LinkedIn Follow button generator and included it to my page. The generated iframe has a URL that you can use, to fetch the data.
For me it looked something like this:
https://www.linkedin.com/pages-extensions/FollowCompany?id={COMPANY_ID}&counter=bottom&xdOrigin={YOUR_URL}&xdChannel={NOT_SURE_WHAT_THIS_IS}&xd_origin_host={YOUR_URL}
This approach should also work for users but I haven't tested it.
Obviously this may fail in the future, but i just couldn't get any useful information from the documentation for my specific case.
Not very clean but it works for now.

APINotFoundError: invalid media id

I want to get information using the media endpoint from Instagram. I don't know what is going on when I request this particularly endpoint https://api.instagram.com/v1/media/shortcode/BIU_L3sg_9P?access_token=ACCESS_TOKEN. This shortcode Im sure that exists.
Anyone could help me?
where did u get that shortcode from?
I looked up the user and that photo from instagram, here is the same photo with different shortcode BH2XfKpB4br from instagram, this works:
https://api.instagram.com/v1/media/shortcode/BH2XfKpB4br?access_token=XXX

How to retrieve Instagram followers' locations?

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.

Spotify web api, get follow playlist's tracks

I want to get the tracks of a playlist that I follow via de new Spotify Web API. The issue is that, if the playlist isn't created by me, I get a 404 Error.
Any ideas how to solve this?
For next time, please provide the exact URL that you're calling, along with query parameters or potential body parameters. It makes it a lot easier for people to help you.
My assumption of what's going wrong here is that you're providing your own username instead of the playlist's owner's username as part of the URL.
Endpoint documentation for Get a Playlist's Tracks:
GET https://api.spotify.com/v1/users/{user_id}/playlists/{playlist_id}/tracks
The user_id here is the playlist's owner's user id, and the playlist_id is of course the id of the playlist, e.g. 6sUmrBvbrRDDbaYJmO9DaE.

How to find out on flickr the farm-id and other info of a photo

Im trying to display in my website photos froma photoset I have in Flickr. In the documentation says:
You can construct the source URL to a photo once you know its ID, server ID, farm ID and secret, as returned by many API methods.
But I only know how to get the Photo ID. How can I get the rest of the information?
The simplest API is flickr.photos.search, and you can find the documents from
http://www.flickr.com/services/api/flickr.photos.search.html
And an example output could be found there.
when you get the ouput, a photo could be accessed by
http://farm{farm-id}.staticflickr.com/{server-id}/{id}_{secret}.jpg

Resources