This is a question to those who have AdSense and use the Google search on there site:
why do you have the google search box leave your website when you click submit (aka it goes to http://www.google.com/custom?q=....)?

Google has some APIs which allows you to query there servers and display the results on your website so that you never have to let the user leave your website. That and you can display the search page however you want. Are there some benefits to usign the custom one versus usign there API's (and completly customizing it)? And yes u can restrict the searches to just your website(s) or the entire web, it's really all up to you!

Dani AI

Generated

A concise, up-to-date summary that follows the 2005 discussion by , and — the landscape has changed significantly since then. The old Web Search APIs those posts mention have been retired; Google now offers the Programmable Search Engine (formerly Custom Search) and a programmatic Custom Search JSON API as the supported ways to embed Google-powered search on your site. (developers.googleblog.com)

Practical differences that matter today: the easiest path is the client-side Standard Search Element (embed JavaScript) — it hosts results on your pages and can show AdSense search ads when you link your AdSense account. The programmatic Custom Search JSON API returns raw JSON for you to render (more UI control) but does not deliver the AdSense-sponsored links; it also has a small free quota and paid usage beyond that. Choose the Standard Element for fast setup + on-site ads; choose the JSON API when you need server-side control and are prepared to manage quota/costs. (developers.google.com)

Implementation tips and gotchas derived from the thread: create the engine in the control panel, link AdSense only on the hosted element if you want built-in ad revenue, and use the JSON API’s pagination fields (start, num, nextPage) if you render results yourself. Protect and restrict API keys in the Cloud Console, cache popular queries to reduce billed requests, monitor usage in the API dashboard, and provide a graceful fallback (hosted element or static results) if quotas are exhausted. If you relied on site-restricted programmatic calls, note Google has moved site-restricted customers toward Vertex AI Search — plan migration for advanced site-only programmatic search. ()

If you need higher volume, no ads, or more customization than Google’s paid API offers, consider alternatives (hosted SaaS search like Algolia or a self-hosted index with Elastic) — they trade hosting/ops for predictable service and larger throughput. The old forum advice about “use the API to stay on-site” still holds, but pick the modern product that matches your traffic, monetization, and control needs. (algolia.com)

Recommended Answers

All 7 Replies

thats pretty cool, are there written documents on how you can do that? or is it in the web dev. script (html, javascript etc.)

they give some examples in there api (including some in java and C++)
http://www.google.com/apis/

you could follow those (if not I could give a copy of the source code I used)

Using Google's (non-API) version is incredibly easy to implement and you get money when searchers click on sponsored links. When using the API version, none of the sponsored links show up (and until recently, google prohibited displaying AdSense on search result pages.) Of course you need programming experience to use the API version. But aside from that, one of the main reasons I don't use it here is because Google restricts you to a maximum number of searches per day, which isn't always practical with largescale sites.

I have a version of Google Search using the API on my site. I tried to integrate it to give the same features and feel of the actual Google Search page.

:)

I remember reading that Google's API restricted you to a maximum number of searches per day. Is this true? How limiting is Google's API, exactly?

My version combines ASP and the Google API so using some tricky coding technique's I was able to throw together a nice usable search page.

As for the limit number of Google's API, that is true and is limited to 1,000 queries per day. (http://www.google.com/apis/api_faq.html#gen7)

you are limited to 1000 queries a day, and only 10 results per query...
however you can specify an offset like VSBrown did to display more results... another thing you could do if you wanted to get 50 or 100 results in 1 page is just put the code in a loop and get 10 results each time so you could put as many as you want on a page

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.