Search code examples
google-search

Determine if a Google URL is a quick search


I have a list of URLs and I need to display the Google search terms that were performed within them. The problem is that some of the Google search terms that come up are just requests from the Google search bar so that it can display its dropdown list of suggestions. I need to distinguish between these and I am not sure how to since I don't understand Google's abbreviated request parameters.

I thought I would ask to see if anybody knew how to tell them apart before I dug in and did it myself. Thanks!

Here's a couple of example searches.

From the search bar:

http://www.google.com/webhp?hl=en&tab=iw#hl=en&client=hp&q=leonardo&aq=f&aqi=g10&aql=&oq=leonardo&gs_rfai=&fp=8631cdd35a4d476d

A full search:

http://www.google.com/search?hl=en&client=hp&q=leonardo&aq=f&aqi=g10&aql=&oq=leonardo&gs_rfai=&fp=8631cdd35a4d476d&tch=1&ech=1&psi=1idgTO3ODI6CsQPm5aH0DQ12813700709361


Solution

  • I'm pretty sure that the original query in either of the examples you've provided is simply 'leonardo', present in the q parameter of the query string. So in effect, all search terms will follow the 'q=', with multiple words separated by plus (+) symbols.

    Examples

    Single word: q=leonardo

    Multiple words: q=leonardo+da+vinci

    Hope this helps

    ~DJ