Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How does Google Chrome suggest url completions?

I've learned about Google's (unofficial) suggest API and their search API, which both look really great, but the suggest API doesn't actually suggest navigational completions. On the other hand, in Google Chrome if you start to type for example "apple", it will suggest "www.apple.com/trailers".

I know it searches your browsing history, but I've never been to that page so it's not getting it locally.

Is this another unofficial secret API?

like image 758
devios1 Avatar asked Apr 23 '09 23:04

devios1


1 Answers

If you use a transparent echoing proxy this can show you all http traffic Charles and fiddler are two good example, I recommend Charles.

Looking at new work traffic when I type "app" into chrome I see the following request

http://clients1.google.co.uk/complete/search?client=chrome&output=chrome&hl=en-US&q=app
GET /complete/search?client=chrome&output=chrome&hl=en-US&q=app HTTP/1.1
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/525.19 (KHTML, like Gecko) Chrome/1.0.154.53 Safari/525.19
Accept-Encoding: gzip,deflate,bzip2,sdch
Cookie: SID=DQAAAIYAAAATI2S8dKFp5KGjAbyGxNaA4R4qbW24KzjW3jHTJOqIewCl64OqpBjnj7ReJ1aoFBA_rJ5h32jTrwD_xFTEgVfSqqXMfh_1e8bIcvLgz8qSRnXxWNUepTD90fXeHh0KfKtI9EkdkjgOPT2a9_1DJBlyzpOItI7o-fD5zQ6fjA9YdlC4TeCZqlsjbD6O8nXR5mg; PREF=ID=427f2a6420c4c235:U=19879741710226bb:TM=1224000168:LM=1240414461:S=kGvdcM6wirgoK_L7; NID=21=QOXGkbW3w-orrYC5IFOpPW9jEwdTz4oNJ6Pem0lcyFlvzxZHQgyYsf63kR2g4Pq62H0xWR8l7mF03GLgIJoPAZPIlMFG-ghig5ManOtWA7f3bqqq1eNtWSYyZYo4Ja5z
Accept-Language: en-US,en
Accept-Charset: ISO-8859-1,*,utf-8
Host: clients1.google.co.uk

With the response

HTTP/1.1 200 OK
Content-Type: text/javascript; charset=utf-8
Date: Fri, 24 Apr 2009 08:06:54 GMT
Expires: Fri, 24 Apr 2009 09:06:54 GMT
Cache-Control: public, max-age=3600
Content-Encoding: gzip
Server: Auto-Completion Server
Content-Length: 175

["app",["http://www.apple.com/uk/","apple","apple store","apple trailers"],["Apple (United Kingdom)","437,000,000 results","37,700,000 results","995,000 results"],[],{"google:suggesttype":["NAVIGATION","QUERY","QUERY","QUERY"]}]

Charles knows about JSON so translates this into a pretty format Screen Shot Of Charles http://img2.imageshack.us/img2/2926/suggestionsforapp.png

See full size

As you can see (easiest the full size image) this google service returned 4 results, one of type NAVIGATION(http://www.apple.com/uk/) and 3 of type QUERY(apple, apple store, apple trailers). It also contains more information for each a description for the NAVIGATION result(Apple(United Kingdom)) and the number of results for each of the QUERY suggestions(437,000,000 37,700,00 995,000).

like image 197
David Waters Avatar answered Sep 21 '22 08:09

David Waters