6

I’ve a Flickr which I’m using to upload pictures from my phone and all images are public. On my blog I want to retrieve all the images to show and for that I’ve first tried to create an application to get my API key. I’m using the Flickr API flickr.people.getPublicPhotos. This API service is said to not require authentication and putting it all together I end up with this call:

http://api.flickr.com/services/rest/?method=flickr.people.getPublicPhotos&api_key=fc94274cd0335f3c171fe22c8490b7d9&user_id=5545356%40N04&extras=description%2Cdate_upload%2Cdate_taken%2Cowner_name%2Coriginal_format%2Ctags%2C+o_dims%2C+views%2C+media%2C+path_alias%2C+url_sq%2C+url_t%2C+url_s%2C+url_q%2C+url_m%2C+url_n%2C+url_z%2C+url_c%2C+url_l%2C+url_o&per_page=40&format=php_serial&api_sig=0c48e2b6b6d9a03521e5ca86a15cf471

The problem is that every around 10 hours I fails and returns the error message a:3:{s:4:"stat";s:4:"fail";s:4:"code";i:100;s:7:"message";s:31:"Invalid API Key (Key not found)";}

I tried to create the API call when logged in to Flickr and also with not logging in and in both cases I get the error message. It’s like the API key expires or stops working. Have a missed something on Flickr about the API key or what could cause this? It is really frustrating to renew the URL twice at day.

Thank you

Sincere
- Mestika

4 Answers 4

4

If I read the docs correctly, the &api_sig query string parameter is constructed using an authentication token, one that eventually expires. Remove that parameter (= do not sign your API request) and I think you'll be OK.

4
  • Hi David, thanks for your answer. Do you mean to remove the parameter "api_key=fc94274cd0335f3c171fe22c8490b7d9" from the query string? I tried that and it gives me the error: Invalid API Key (Key has invalid format). Or did I misunderstod you? Commented May 18, 2012 at 22:41
  • 1
    No, I mean remove this one: &api_sig=0c48e2b6b6d9a03521e5ca86a15cf471 Commented May 18, 2012 at 22:48
  • 4
    Ah I think I found the answer. I removed the API sign as you said in the end. The other issue was that I had used the API explore and for that it seems that it changes. I just used my accounts API key with no API sign and it seems to work. I just cross my fingers that it also works tomorrow :-) Commented May 18, 2012 at 22:49
  • i am doing as you said but i get this error Invalid API Key (Key not found), i have opened a question here stackoverflow.com/questions/34704221/…
    – Koala7
    Commented Jan 10, 2016 at 10:14
1

Mestika's comment seems correct. I was getting the same problem when using the API explorer. If you use your accounts API, or go in and create a new app, then use the API given for that, then the key doesn't change every few hours.

The url to request a key is: http://www.flickr.com/services/apps/create/apply

1

I got the same problem.

This is how i solved it:

  • removed the auth_token and the api_sig parameters
  • replaced the api_key value with an app key

Hope this helps.

0

i met this issue before. with new api key, only accept https request. Let's change your url to: https://api.flickr.com/services/rest/?method=flickr.people.getPublicPhotos&api_key.....

I am sure it will be work right know. thanks

Not the answer you're looking for? Browse other questions tagged or ask your own question.