Flickr API - Custom URL to NSID - flickr

I'm trying to fetch the user information and images when I have a URL that is from flickr, however I cannot figure out how to get the username or user_id from the custom URLs.
The custom URL are with the following format.
https://www.flickr.com/photos/tataouane/
However the "tataouane" is not a NSID or a username that I can use the methods to fetch the information.
If I read the documentation I get the following:
URLs to photo and profile pages use either the user's NSID (the number with the '#' sign in it) or their custom URL (if they've chosen one). You can find their custom URL with a call to flickr.people.getInfo.
But to call the flickr.people.getInfo I need an NSID, and I want precisely the opposite.
I've tried to double check and the flickr.people.findByUsername return an "User not found" error message (as it should).
How can I get the NSID? Any ideas?
Thanks a lot!

OK, I found the solution and I hope this will help someone.
There's another API method that can be used that parses the URL into a NSID and username.
www.flickr.com/services/api/explore/flickr.urls.lookupUser
Flickr discussion here:
https://www.flickr.com/groups/api/discuss/72157649116650355/#comment72157649063153796

Related

how to access Instagram user profile by using user id instead of username?

I need to scrape Instagram by user id number instead of username. How can I do it?
You can access user profile like this
https://instagram.com/{username}
but I need to access it like below. It doesn't have to be exactly like below. Is it possible to find such path?
https://instagram.com/{profile_id}
I don't think there's any possible way to do it.
Anyway, how do you get the profile_id. I thought it is not available to be seen anywhere?
you could send a GET request to this url
https://i.instagram.com/api/v1/users/<user_id>/info/
from its response you'll get the username and from that you can use your initial url
https://instagram.com/<username>/

Is it allowed to use this link (https://www.instagram.com/[username]/?__a=1)

at the moment I am working on a Instagram implementation for the homepage of my school.
My problem was, that I didn’t got access to the account, so I couldn’t generate an access token (which all free joomla plugins need).
So I have decided to write my own plugin (I am not the best programmer, but it works), because of that I found this link (https://www.instagram.com/[username]/?__a=1) where I could get the JSON of the public page without the need of any token or ID.
My question is if I am allowed to use it or not (because I can’t find this link in the official api)?
We've built a small API that scrapes exactly that data and presents it to you via JSON:
https://apinsta.herokuapp.com/u/<username>
(In case you are still interested in this)
This URL closed by instagram on 14 April. You can get user's information json with this link:
https://i.instagram.com/api/v1/users/USER_ID/info/
Also you can find user ID like this:
Go to the https://www.instagram.com/USERNAME/
Look source code and find this code:
"id":"
You'll see the user ID between quotes.
Good luck.

Instagram /tag/search looks like getting results out of sandbox for me, how come

All endpoints like for hashtag, work in sandbox and get info in json from within sandbox users in public_content scope with users info.
Yet "https://api.instagram.com/v1/tags/search?q=cat&access_token=..." brings me result apparantly out of sandbox, results I have not seen before, and only with items include "data: name, media_count", without user info.
Question 1, is it really getting out of sandbox, is it a bug?
Question2, why not user info then, cause I can use more info, Image URL for example, why not? am I missing something?
Thanks :)
https://api.instagram.com/v1/tags/search?q=snowy&access_token=ACCESS-TOKEN
This endpoint only gives you similar hashtag name and count for the search term.
Documentation here: https://www.instagram.com/developer/endpoints/tags/#get_tags_search
If you want all photos and user details for a hashtag then use this API:
https://api.instagram.com/v1/tags/{tag-name}/media/recent?access_token=ACCESS-TOKEN

instagram api APIAgeGatedError not in the document

when I try to get few people profile use instagram api it shows error message APIAgeGatedError, what does this mean? how to solve it
I can't find documentation about this exception, but I think this problem is related with your IP, I changed IP-adress and problem was solved. Or try to use proxy-server.
The APIAgeGatedError type error is generated because the content from the requested profile is restricted to a minimum age. You can't reach the content for sure with your "general token". Perhaps with an token that has been authorized from the page you are trying to get content from. However Instagram has no provided documentation about this.

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