Foursquare API for venue user image error

Tuhin Subhra Dey picture Tuhin Subhra Dey · Jun 11, 2012 · Viewed 8.2k times · Source

The Foursquare API has divided its photo tag for user as prefix and suffix. But if I merge them to form a full image URL and paste this in my browser, gives me errors that says the image can't be displayed because it contains errors. Is it because server is temporarily unavailable or anything else?

I am using the API for Venue Detail.

I got the data like this

user: {

id: "26534686"
firstName: "Bobbi"
lastName: "E."
photo: {
    prefix: "https://irs3.4sqi.net/img/user/"
    suffix: "/K4VCI4MXHWFUGXOF.jpg"
}
}
visibility: "public" 

But when I call this url https://irs3.4sqi.net/img/user/K4VCI4MXHWFUGXOF.jpg gives me error.

Any clue?

Answer

Tuhin Subhra Dey picture Tuhin Subhra Dey · Jun 12, 2012

I don't know its right or not to show the way to Foursquare. But what I have investigated that Foursquare creates thumbnails of sizes 30 x 30 and 110 x 110 etc.

I formed the image path like this for small image

user->photo->prefix.'30x30'.user->photo->suffix;

for larger size

user->photo->prefix.'110x110'.user->photo->suffix;

That is I have concatenated them with (30x30) and (110x110).

Thus the above image becomes https://irs3.4sqi.net/img/user/30x30/K4VCI4MXHWFUGXOF.jpg and https://irs3.4sqi.net/img/user/110x110/K4VCI4MXHWFUGXOF.jpg which are valid till now.

Hope this will work until they change this.