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

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

Related

Instagram graph API IG hashtag

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?

Twitter api doesn't send media element with timeline

So I am using the twitter node module and twitters rest api to fetch timelines.
All works well, except that attached images do not get sent with the response.
Even after I added "include_entities: true" to the options object.
I'm talking about an image directly attached to a twitter post, links get displayed just fine.
I simply can't find a way to get it to display, any help is appreciated.
Every tweet has a Media Entity attached to it. You need to find the Media Id and then get the URL from -mediaURL. The below picture shows the full object model.
PC : https://www.visual-paradigm.com/tutorials/rest-api-design-twitter-example.jsp

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

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 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.

Resources