# Flickr API not working

**URL:** <https://www.ruby-forum.com/t/flickr-api-not-working/121674>\
**Category:** Rails\
**Created:** [November 29, 2007, 9:15pm UTC](https://www.ruby-forum.com/t/flickr-api-not-working/121674 "2007-11-29T21:15:17Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![rajatgarg](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/a183cd/32.png) [@rajatgarg](https://www.ruby-forum.com/u/rajatgarg)\
**Post date:** [November 29, 2007, 9:15pm UTC](https://www.ruby-forum.com/t/flickr-api-not-working/121674/1 "2007-11-29T21:15:17Z")

</div>

Hi Guys,

I am a newbie and I am trying to get ROR Flickr example working…

I installed the flickr gem and after that I did the necessary work as  
stated and here is the outcome -

[http://www.pilotoutlook.com/flickr](http://www.pilotoutlook.com/flickr)

My controller looks like -

require ‘flickr’  
class FlickrController \< ApplicationController

def search

```
flickr_obj_in_use = Flickr.new('MY KEY HERE')

render :partial => "photo", :collection =>
  flickr_obj_in_use.photos(:tags => params[:tags], :per_page =>

```

‘24’)  
end  
end

It gives a message “Invalid API Key (Key has expired)”. What am I  
doing wrong here?

Any help will be greatly appreciated.

Rajat

---

<div class="post-metadata">

**Author:** ![rajatgarg](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/a183cd/32.png) [@rajatgarg](https://www.ruby-forum.com/u/rajatgarg)\
**Post date:** [November 29, 2007, 10:36pm UTC](https://www.ruby-forum.com/t/flickr-api-not-working/121674/2 "2007-11-29T22:36:42Z")

</div>

Have you checked the status of your API key with flickr? Maybe you  
need to renew your key.

---

<div class="post-metadata">

**Author:** ![rajatgarg](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/a183cd/32.png) [@rajatgarg](https://www.ruby-forum.com/u/rajatgarg)\
**Post date:** [November 30, 2007, 5:00pm UTC](https://www.ruby-forum.com/t/flickr-api-not-working/121674/3 "2007-11-30T17:00:48Z")

</div>

I just got the key 2-3 days back. I will try to get another key

---

<div class="post-metadata">

**Author:** ![rajatgarg](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/a183cd/32.png) [@rajatgarg](https://www.ruby-forum.com/u/rajatgarg)\
**Post date:** [November 30, 2007, 5:23pm UTC](https://www.ruby-forum.com/t/flickr-api-not-working/121674/4 "2007-11-30T17:23:03Z")

</div>

I got a new key and it still is giving the same issue. Also, when I  
ping - flickr api usage statistics show the ping, however, it doesn’t  
allow it to get data from it.

---

<div class="post-metadata">

**Author:** ![rajatgarg](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/a183cd/32.png) [@rajatgarg](https://www.ruby-forum.com/u/rajatgarg)\
**Post date:** [November 30, 2007, 9:22pm UTC](https://www.ruby-forum.com/t/flickr-api-not-working/121674/5 "2007-11-30T21:22:18Z")

</div>

On Nov 30, 2007 4:22 PM, Rajat G. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> I got a new key and it still is giving the same issue. Also, when I  
> ping - flickr api usage statistics show the ping, however, it doesn’t  
> allow it to get data from it.

There’s a problem with the flickr gem, it sends the default (expired)  
API key instead of the one you assign it. There’s an updated version  
of flickr.rb mentioned in the comments on this page

[http://wonko.com/article/452](http://wonko.com/article/452)

but that seems to have problems of it’s own, so I fixed those and my  
updated code is here : [Parked at Loopia](http://pastie.caboo.se/123850) , which seems to  
work for me so far, although this gem is quite out of date now and  
doesn’t feature some of the newer aspects of the flickr API.

Hope that helps,

Barry
