Construct Profile Picture URL
Asked Answered
H

3

8

Most social apis have a way to construct a url to the user's profile picture using their user_id or username. Any chance foursquare has something similar or plans to?

http://graph.facebook.com/702855/picture

http://api.twitter.com/1/users/profile_image/akdotcom.png

Humphrey answered 2/12, 2011 at 18:18 Comment(2)
oh yeah... uhm, we were going to add that. Dusting off an old internal thread....Apparently
i am facing the same problem is there any way for doing it in Foursquare...Tequila
B
11

I had the same problem.

Since the last update (changes from June 9th) every user's pic can be constructed via an api call: https://developer.foursquare.com/docs/explore#req=users/self

which returns something like this:

photo: {
    prefix: "https://irs3.4sqi.net/img/user/"
    suffix: "/HBVX4T2WQOGG20FE.png"
}

Take the two parts and put e.g. 'original' between them:

[prefix]/original/[suffix]

which gives you the url to the profile pic: https://irs3.4sqi.net/img/user/original/HBVX4T2WQOGG20FE.png

Bailsman answered 25/6, 2012 at 17:16 Comment(0)
C
1

foursquare provides the URL prefix and suffix, example:

photo: {
  prefix: "https://irs3.4sqi.net/img/user/"
  suffix "/21325770-GWARVMMU2R5QLN04.jpg"
}

you can mount it as follows:

[prefix]/original/[suffix] -> for original image
[prefix]/200/[suffix] -> for squared 200x200 image
[prefix]/200x100/[suffix] -> for 200x100 image

exemple

https://irs3.4sqi.net/img/user/200/21325770-GWARVMMU2R5QLN04.jpg
Corelation answered 3/3, 2016 at 19:16 Comment(0)
W
0

At this time, there's no way to construct a profile photo from just the username/user ID.

Comments on this question by Akshay indicate that they might some day support this.

I'm answering here to get this off of the "unanswered" list.

West answered 21/1, 2012 at 1:19 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.