REST-JSON/Atom Custom Search API and Google-branding?

54 views
Skip to first unread message

yotam

unread,
Aug 27, 2011, 4:01:03 PM8/27/11
to Google AJAX APIs
With various references to Google's search API, some of which are
declared deprecated (See http://code.google.com/apis/websearch/docs/),
some recommend API-keys of different flavors
(Simple API Access, OAuh 2.0), it is easy to get confused.

The search control (deprecated?) interface:
var my_csc = google.search.CustomSearchControl("MyCustomSearchId")
my_csc.draw("MyHtmlSearchDiv")
draws an input box for search words,
and it does take care of showing the Google-branding
by attaching a small image below the input-box to its right reading:
"powered by Google^{TM}"

Google now encourages us to move to the new Custom Search API
with a link to
The 'JSON/Atom Custom Search API'
http://code.google.com/apis/customsearch/v1/overview.html
The 'Getting Started' link there describes a JavaScript interface
with an example in
http://code.google.com/apis/customsearch/v1/getting_started.html#REST
The query words are simply concatenated to the '&q=' parameter
of the URL. The results are handled in a callback that puts them
in some <div> element of an HTML document.

But where and how should the Google-branding be rendered?
Isn't it required?
Is there an API for drawing an "Google-branded" box whose input
will be fed to the "REST JavaScript" API?

regards -- yotam

Adam Feldman

unread,
Aug 29, 2011, 2:09:12 PM8/29/11
to google-ajax...@googlegroups.com
Hi Yotam,

You might be interested in the Custom Search Element, which provides a similar experience as the Search Control, but is not deprecated.  If you use the element, you won't have to worry about doing the branding manually.  You can find it at http://www.google.com/webelements/customsearch (or in your Custom Search Engine control panel) and the documentation (for more advanced usage) at http://code.google.com/apis/customsearch/docs/js/cselement-devguide.html.

Thanks,
Adam
Reply all
Reply to author
Forward
0 new messages