Where is the documentation for the Google Suggest API? [closed]
Asked Answered
A

6

77

Is there any official documentation on the Google Suggest API?

All my searches for the Google suggest API show pages with either outdated info or non-working scripts.

For example, at google.com, as soon as you type in "app", Google suggests Apple, Applebees, etc.

Armagh answered 24/2, 2011 at 9:45 Comment(3)
As of 20160601 this works: google.com/complete/search?client=chrome&q=pickle for returning JSONDyer
vote to reopen. This question is quite concise. it is not asking for recommendations of alternative tools to use, but rather asking how to use a specific tool (GoogleSuggestAPI)Brass
@Armagh , @ Angel Koh calling url with out api key, is there any violtion of terms.No need to create api key.Please Replay me need to create any api keys or create projectes in api console.Conde
M
46

As you can imagine, it's changed.

The newer URL is now http://clients1.google.com/complete/search?hl=en&output=toolbar&q=YOURSEARCHTERM

Or even more recent: http://suggestqueries.google.com/complete/search?output=toolbar&hl=en&q=YOURSEARCHTERM

Malina answered 29/11, 2012 at 10:6 Comment(7)
Is it possible to get Json Results back?I tried ouput=json but just get a blank page.Rutherford
Doesn't look like it works with this URL. Sounds like big G are locking it down.Malina
@Rutherford Using client=chrome currently works eg google.com/complete/search?client=chrome&q=YOURSEARCHEDTERMPharmacy
@Rutherford imo nicer JSON result when using client=firefoxCaton
can i get results to contry specific ? any parameters as such.Urogenital
@Malina calling url with out api key, is there any violtion of terms.No need to create api key.Please Replay me need to create any api keys or create projectes in api console.Conde
Yeah looks like they want an API key now.Malina
S
24

Summary of working examples:

From this question working example:

http://suggestqueries.google.com/complete/search?output=toolbar&hl=en&q=theory



From this question working example:

http://suggestqueries.google.com/complete/search?output=firefox&q=theory




From mhawksey comment above working example:

http://google.com/complete/search?client=chrome&q=theory

Here client=chrome can be changed to other browser client. For example for Firefox it will look like:

http://google.com/complete/search?client=firefox&q=theory




From mahoor13 comment above working example:

google.com/complete/search?output=toolbar&q=theory




From dhiraj-pandey answer "if you want country specific suggests, you need to add &gl= in the url". That only works with links for toolbar!

So for example working country specific example for India will be:

google.com/complete/search?output=toolbar&q=theory&gl=in




To separate words use %20 or + between them. For example:

http://suggestqueries.google.com/complete/search?output=toolbar&hl=en&q=a%20mykeyword

or

http://suggestqueries.google.com/complete/search?output=toolbar&hl=en&q=a+mykeyword




Also from here it possible to get two suggestions with YQL (first sugestion chuck norris, second steven seagal):

select * from xml where url in (
‘http://google.com/complete/search?output=toolbar&q=chuck+norris’,
‘http://google.com/complete/search?output=toolbar&q=steven+seagal’
)

Using above code gives:

http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20xml%20where%20url%20in%20%28%27http%3A%2F%2Fgoogle.com%2Fcomplete%2Fsearch%3Foutput%3Dtoolbar%26q%3Dchuck%2Bnorris%27%2C%27http%3A%2F%2Fgoogle.com%2Fcomplete%2Fsearch%3Foutput%3Dtoolbar%26q%3Dsteven%2Bseagal%27%29&format=xml&diagnostics=false




Some info from google about suggestions: http://www.google.com/support/enterprise/static/gsa/docs/admin/70/gsa_doc_set/xml_reference/query_suggestion.html

Successful answered 20/4, 2015 at 15:13 Comment(3)
calling url with out api key, is there any violtion of terms.No need to create api key.Please Replay me need to create any api keys or create projectes in api console.Conde
What is the method for getting the suggestions even if there are spelling mistakes ? The suggestions you get when you write something into chrome toolbar with small spelling mistakes, -> it still suggests with correct spelling. These methods are autocomplete that only show results on correct spelling. (edit: There is room for super small spelling mistakes like: spelling a word with u that is suppose to be ú, but in the search bar I can have three different spelling mistakes in a long word and it still suggests the correct word)Clintclintock
>http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20xml%20where%20url%20in%20%28%27http%3A%2F%2Fgoogle.com%2Fcomplete%2Fsearch%3Foutput%3Dtoolbar%26q%3Dchuck%2Bnorris%27%2C%27http%3A%2F%2Fgoogle.com%2Fcomplete%2Fsearch%3Foutput%3Dtoolbar%26q%3Dsteven%2Bseagal%27%29&format=xml&diagnostics=false this is not workingNavigate
C
17

Try http://google.com/complete/search?output=json&q=YOURSEARCHEDTERM or for XML output http://google.com/complete/search?output=toolbar&q=YOURSEARCHEDTERM

http://answers.oreilly.com/topic/1526-how-to-use-the-google-suggest-api-to-come-up-with-topics-for-answers/

I also found very interensting tool which use the Google Search API and it is based on Python and Flask ubersuggest and keysuggest's Googlealphabet soup method tool.

Carolacarolan answered 10/4, 2011 at 13:13 Comment(6)
This isn't working anymore.Homeopathic
I've test google.com/complete/search?output=toolbar&q=theoric and the reslut is nice. +1Nobel
F that I was using the following query in a loop and I think that google got mad at me but your computer or network may be sending automated queries. To protect our users, we can't process your request right nowRabia
calling url with out api key, is there any violtion of terms.No need to create api key.Please Replay me need to create any api keys or create projectes in api console.Conde
output=json is not working nowGarek
I'm getting a result like this b'window.google.ac.h(["cars b",[["cars baby",0,[433]],["cars balls",0,[433,131]],["cars believer",0],["cars best scenes",0,[433]],["cars babybus",0],["cars broom broom",0],["cars big",0],["cars behind the scenes",0],["cars blippi",0],["cars badass scene",0],["cars birthday party decorations",0],["car bus",0,[10]],["cars bako",0],["cars balls colors",0]],{"k":1,"q":"T8vE-uLW0GB7wmCStE2meAzKDoc"}])' with my q = cars b how can I make this into json format, the toolbar doesn't workNester
R
9

As @Harvest316 said, you can use those urls to get suggestions, but if you want country specific suggests, you need to add &gl= in the url. For example, if I search for India, it will be

http://suggestqueries.google.com/complete/search?output=toolbar&hl=en&q=YOURSEARCHTERM&gl=in

Romantic answered 27/8, 2014 at 18:54 Comment(1)
calling url with out api key, is there any violtion of terms.No need to create api key.Please Replay me need to create any api keys or create projectes in api console.Conde
L
4

Hi I'm the author of Übersuggest the tool mentioned by JonnyPea. There is no official Google Suggest API: the URL I and other people use is just something we have found hacking around Google. Here's a couple of advice:

  • Have a look at my application source code on Bitbucket (beware: I'm an hobbyist programmer so my code cold be improved a lot)
  • Do not call the API thousands times from the same IP or you will be banned.

[UPDATE]

Sorry the source code is no more available

Laurielaurier answered 16/11, 2011 at 6:18 Comment(4)
regarding ubersuggest, can I also look at your application code on Bitbucket too? thanksBerkeleianism
How often would you call the API an hour without risking being banned?Heartbreaking
@Laurielaurier when reaching out your repo on bitbucket gives following error- You do not have access to this repository.. Can make available code in here ?Urogenital
Oooo! That would be awesome! Yes, please, Raben!Malina
M
2

There is a working API that pulls data from Google Suggest (along with YouTube, Bing and App Store): http://keywordtool.io/api

Using this API you wouldn't need to worry about the number of requests from the same IP etc.

Google doesn't have an official API to share autocomplete data, moreover it often hides keywords that appear in Google suggest from Google Keyword Planner.

Note this API is by paid subscription and starts at $280 / month.

Melisent answered 23/12, 2014 at 10:19 Comment(3)
I got pretty excited about this until I saw the $88/mo price tag.Katiakatie
Can you suggest free APIs than commercial ones.Gaur
@Katiakatie Haha same here, except it's now $280/mo :(Monaural

© 2022 - 2024 — McMap. All rights reserved.