---
title: "Google Search API on HTML Page"  
description: "In this article I am trying to explain how to implement simple Google search on HTML page."  
author: "Vijay Shukla"  
published: 2013-05-08  
updated: 2026-05-13  
canonical: https://www.mindstick.com/articles/1287/google-search-api-on-html-page  
category: "api(s)"  
tags: ["api(s)"]  
reading_time: 2 minutes  

---

# Google Search API on HTML Page

In this [article](https://yourviews.mindstick.com/view/81489/kashmir-now-after-an-year-of-abrogation-of-article-370) I am trying to explain how to implement simple [Google search](https://yourviews.mindstick.com/view/87722/history-of-google-search-engine-evolution-to-advancement) on HTML page.\

The fundamental method involved here is to be able to manipulate the [variables](https://www.mindstick.com/articles/715/php-variables) handed to the Google [search engine](https://www.mindstick.com/services/search-engine-optimization), this [variable](https://www.mindstick.com/blog/11493/what-is-a-variable) called sitesearch. If you set it to a null in the sitesearch variable then you able to search the entire [World Wide Web](https://www.mindstick.com/forum/156264/what-is-the-world-wide-web), but if you set it to a specific domain and it's forced exactly as if you had typed in the Google special notation.

Below is the code for implement simple Google search:-

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> \
<html xmlns="http://www.w3.org/1999/xhtml"> \
<head> \
<title>MindStick©</title> \
</head> \
<body> \
<form method="get" action="http://www.google.com/search"> \
<input type="text" name="q" size="40" maxlength="255" value="" /> \
<input type="submit" value="Google Search" /> \
<input type="radio" name="sitesearch" value="" /> \
The Web \
<input type="radio" name="sitesearch" value="mindstick.com" checked /> \
Search from MindStick®<br /> \
</form> \
</body> \
</html>

Output:-

\

![Google Search API on HTML Page](https://www.mindstick.com/mindstickarticle/c2547bbb-82f2-438b-9491-59606df3da57/images/d2c547cb-3594-4584-b3d0-b016c09d7f74.png)

In above image I type "Ajax" and click on the Google Search if you select the "Search from MindStick" [radio button](https://www.mindstick.com/articles/12743/radio-button-in-android) then it will search only from the "[www.mindstick.com](https://www.mindstick.com)" website. But if I select "The Web" then search the Ajax [content](https://www.mindstick.com/articles/12369/cms-extension-for-magento-2-advanced-content-manager-2) form www (World Wide Web).

After clicking the Google [Search button](https://answers.mindstick.com/qa/34597/what-is-site-search-button):-

![Google Search API on HTML Page](https://www.mindstick.com/mindstickarticle/c2547bbb-82f2-438b-9491-59606df3da57/images/e06c7f27-854e-4f8e-b807-f7398edf4710.png)

---

Original Source: https://www.mindstick.com/articles/1287/google-search-api-on-html-page

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
