0

Hi i'm on a project and want to use Flickr for my image galery, i'm using the photosets.* method but whenever i make a request i don't get images, i only get info.

Json Result:

{
    "photoset": {
        "id": "77846574839405047",
        "primary": "88575847594",
        "owner": "998850450@N03",
        "ownername": "mr.barde",
        "photo": [
            {
                "id": "16852316982",
                "secret": "857fur848c",
                "server": "8568",
                "farm": 9,
                "title": "wallpaper-lenovo-blue-pc-brand",
                "isprimary": "1",
                "ispublic": 1,
                "isfriend": 0,
                "isfamily": 0
            },
            {
                "id": "16665875068",
                "secret": "857fur848c",
                "server": "7619",
                "farm": 8,
                "title": "white_horses-1280x720",
                "isprimary": "0",
                "ispublic": 1,
                "isfriend": 0,
                "isfamily": 0
            }
        ],
        "page": 1,
        "per_page": "2",
        "perpage": "2",
        "pages": 3,
        "total": "6",
        "title": "My First Album"
    },
    "stat": "ok"
}

Please would like to have actual image URLs returned, how can i do this.

Daniel Barde
  • 2,603
  • 5
  • 31
  • 40

1 Answers1

3

Thanks to the comment by @CBroe

I found this in the Flickr API doc.

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.

https://farm{farm-id}.staticflickr.com/{server-id}/{id}_{secret}.jpg
    or
https://farm{farm-id}.staticflickr.com/{server-id}/{id}_{secret}_[mstzb].jpg
    or
https://farm{farm-id}.staticflickr.com/{server-id}/{id}_{o-secret}_o.(jpg|gif|png)

The final result would then look something like this.

https://farm1.staticflickr.com/2/1418878_1e92283336_m.jpg

Reference: https://www.flickr.com/services/api/misc.urls.html

Community
  • 1
  • 1
Daniel Barde
  • 2,603
  • 5
  • 31
  • 40