How to access Google Search "I'm Feeling Lucky" functionality using API?

muraliv picture muraliv · Jun 2, 2013 · Viewed 7.4k times · Source

I'm creating a sample app that will take a query from user and will return the URL result returned from Google's "I'm Feeling Lucky" search. Does Google expose this functionality through their API? How to access this?

Answer

Ben Reich picture Ben Reich · Jun 2, 2013

There is nothing magic about Google's "I'm Feeling Lucky" functionality. It simply picks the first result of the search. So, however you're using the api, you can just select the first result as well.

Furthermore, you can use this format for a URL in order to hit the "I'm Feeling Lucky" result of Google:

http://www.google.com/search?q=my+keywords+for+search&btnI