7

I want to link directly to the first Google search result, is it possible? I would be using a very specific search query, including site:specificsite.example. Like a direct-link to the "I'm feeling lucky"-button.

Example: https://www.google.no/search?q=how+do+i+get+a+facebook+pixel+site%3Afacebook.com

From the top of my head, I'd think either a PHP curl request to either Google API or to the normal Google search site, and then echoing the first result as a link. OR doing the same, but with AJAX.

But I'm guessing there must be a more straight forward way?

PS: I don't want a discussion about if it's a good idea or not, just if it's possible or not, and maybe a hint on how to do it most simple.

Stephen Ostermiller
  • 23,933
  • 14
  • 88
  • 109
OnklMaps
  • 807
  • 8
  • 17
  • Should this already be listed in Google API documentation? /// What a comment section... (below) – user202729 Jan 19 '18 at 14:15
  • https://stackoverflow.com/questions/22657548/is-it-ok-to-scrape-data-from-google-results/22703153#22703153 something useful – L_Church Jan 19 '18 at 14:17
  • https://stackoverflow.com/q/5506561 – user202729 Jan 19 '18 at 14:17
  • https://stackoverflow.com/questions/16877882/how-to-access-google-search-im-feeling-lucky-functionality-using-api?rq=1 – Rebeca Maia Jan 19 '18 at 14:18
  • basically we have no direct answer this is just scattered everywhere lol – L_Church Jan 19 '18 at 14:19
  • Thanks. 1. Looks like there WAS a way using a parameter to trigger the "Feeling lucky"-button, but it's gone. 2. Also the open google search api is deprecated, so a simple api request without the hassle of registering first is also gone. 3. I'm left with using either my self-made php scraper or someones else. :) – OnklMaps Jan 19 '18 at 14:35

0 Answers0