Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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?

like image 349
muraliv Avatar asked Jun 01 '13 22:06

muraliv


2 Answers

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
like image 96
Ben Reich Avatar answered Oct 23 '22 06:10

Ben Reich


It seems that Google change their I'm feeling lucky url.

A workaround is to use https://duckduckgo.com/?q=!ducky+github+foo+bar+foobar

https://duckduckgo.com/?q=!ducky+YOUR_URL_ENCODED_QUERY

like image 44
kuzdu Avatar answered Oct 23 '22 07:10

kuzdu