Archive
🔍 Fetching #Flickr Profile Information by #Email Using AvatarAPI
As developers, integrating rich user profile data can elevate the experience of our apps, websites, and services. Today, let’s dive into how you can fetch Flickr profile information by email using AvatarAPI, a handy service that consolidates avatar and profile data from multiple platforms — including Flickr.
Why Flickr?
Flickr remains a popular photo-sharing platform with millions of users showcasing their photography. While many apps focus on social media giants like Twitter or LinkedIn, Flickr’s unique focus on imagery and photography makes it valuable for projects centered around visual content or creative communities.
What is AvatarAPI?
AvatarAPI is an API designed to fetch user profile avatars and metadata by providing common identifiers such as emails, usernames, or social media IDs. It supports many sources, including Flickr, making it a one-stop shop for profile enrichment.
How to Fetch Flickr Profile Data via AvatarAPI
When you request Flickr profile info through AvatarAPI, the data is returned in XML format, containing a rich set of fields to help you understand the user behind the email address.
Here’s an example snippet of the raw XML you get from AvatarAPI for a Flickr profile:
xmlCopyEdit<?xml version="1.0" encoding="utf-8" ?>
<rsp stat="ok">
<person id="12345678@N04" nsid="12345678@N04" ispro="0" is_deleted="0" iconserver="2257" iconfarm="3" path_alias="random_alias" has_stats="0" has_adfree="0" has_free_standard_shipping="0" has_free_educational_resources="0">
<username>Dr. Random</username>
<realname>Random Name</realname>
<location />
<timezone label="Random City, Random State" offset="+00:00" timezone_id="Europe/London" timezone="57" />
<description>Random Description</description>
<photosurl>https://www.flickr.com/photos/random_alias/</photosurl>
<profileurl>https://www.flickr.com/people/random_alias/</profileurl>
<mobileurl>https://m.flickr.com/photostream.gne?id=12345678</mobileurl>
<photos>
<firstdatetaken>2000-01-01 00:00:00</firstdatetaken>
<firstdate>946684800</firstdate>
<count>10</count>
</photos>
</person>
</rsp>
Breaking Down the XML
personattributes:idandnsid: The unique Flickr user ID.ispro: Whether the user has a pro account (1for yes,0for no).is_deleted: Indicates if the account is deleted.iconserverandiconfarm: Used to construct the user’s avatar image URL.path_alias: The user’s Flickr alias, used in URLs.
- Child elements:
<username>: The Flickr username.<realname>: The user’s real name, if provided.<location>: Location info, may be empty.<timezone>: Detailed timezone information with label and offset.<description>: User’s personal description or bio.<photosurl>,<profileurl>,<mobileurl>: URLs to various Flickr profile pages.<photos>: Info about user’s photos:<firstdatetaken>: When the user took their first photo.<count>: Number of photos uploaded.
How to Use This Data
With this data, you can:
- Display user avatars and profile links inside your app or website.
- Show contextual user info like location and bio.
- Highlight photography activity through photo counts and dates.
- Personalize user experiences by leveraging timezone and locale info.
Constructing the Avatar URL
Flickr stores user icons using a combination of the iconfarm, iconserver, and nsid. The avatar URL can be built as:
bashCopyEdithttps://farm{iconfarm}.staticflickr.com/{iconserver}/buddyicons/{nsid}.jpg
For example, with iconfarm=3, iconserver=2257, and nsid=12345678@N04:
bashCopyEdithttps://farm3.staticflickr.com/2257/buddyicons/12345678@N04.jpg
Wrapping Up
Thanks to AvatarAPI’s support for Flickr, accessing rich profile data by just knowing a user’s email has never been easier. Whether you’re building a photography community platform, enhancing contact profiles, or adding social proof, the Flickr profile data returned by AvatarAPI can help bring your users’ identities to life.
You can explore the full AvatarAPI docs for Flickr and other providers here: https://docs.avatarapi.com/.
If you want, I can help you write example code snippets in your favorite programming language to get started quickly with AvatarAPI and Flickr!
Happy coding!
— Your Friendly .NET Dev Blog