Question

I'm doing a webpage about apples (the fruit), I want to include Google search results for apple recipes on the bottom of the page. How can I do this?

Was it helpful?

Solution

You can accomplish this using iframes, but you might want to consider some alternatives... you might want to create a Google Custom Search Engine to serve results only from recipe websites. And, instead of using a frame to display results, you might want to simply make the custom search engine available, so that, only if a user is interested in finding a recipe, he/she may do so. Something else to consider... you might want to monetize this, in which case using Google AdSense would be the way to go.

<iframe src="http://www.google.com/search?q=apple+recipe" />

If you want to use an iframe, you can use the code above; however, this is not a good design decision.

OTHER TIPS

For more advanced inclusion of Google results check out this: https://developers.google.com/web-search/docs/#fonje

You can use ajax based search queries for your keywords and put the results on your website. There are examples in the docs

Update:
As the API is deprecated you can now alternatively just scrape the results from Google instead of using their API. There is an open source PHP scraper that can be included into your website at http://scraping.compunect.com

<a href="http://www.google.com/?q=apples">See recipes about bananas</a>.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top