AOW >> Google search engine API 2016

Google search engine API 2016

Use Google search engine API is not very difficult. Now we let you know about how you will able to use the Google API.

Use Google search engine API | Google search API | integrate Google search in website | integrate Google search using PHP search using PHP.Use Google search engine API, Google API, Google search API, Google search, integrate Google search in the website, integrate Google search using PHP, Google search using PHP

What is Google search engine API?

Google search engine API is the script OR code which can be integrated into any website for searching purpose.

What Google search engine API do?

Google search engine API will make you able to search anything on your website like you search on google.

google search engine api

Follow the following steps for using the API:

  • Make a simple form in HTML with one input text field with one submit button.
  <form action="searching.php" method="get">
   <input type="text" name="query" value="" /><br />
   <input type="submit" name="submit" value="Submit" />
  • After the copy, the below code and save it in the searching.php named file.
if(empty($_POST['query'])) exit;
$query=str_replace(" ", "+", $_POST['query']);
$ch = curl_init();
$timeout = 30;
curl_setopt ($ch, 
CURLOPT_URL, $url); 
curl_setopt ($ch, 
curl_setopt ($ch, 
$response = curl_exec($ch);
///Write out the response
$response=str_replace("<?xml version=1.0?><SearchSuggestion version=2.0 xmlns=><Query>", "", $response);
$response=str_replace('<?xml version="1.0"?><SearchSuggestion version="2.0" xmlns=""><Query>', "", $response);
$response=str_replace($_POST['query']."</Query><Section title=Google Suggestions>", "", $response);
$response=str_replace($_POST['query'].'</Query><Section title="Google Suggestions">', "", $response);

$response=str_replace('<Image source="/images/cleardot.gif" alt="f" width="1" height="1" align="middle"/>', "", $response);
$response=str_replace('<Image source=/images/cleardot.gif alt=f width=1 height=1 align=middle/>', "", $response);
echo $response;

  • The above-given script will take the keywords/query from the user and send it to the Google and get the searching result against the keywords/query and show.

Hope you enjoy this.

If you face any problem, OR you want to discuss anything with us, please let us know we are here for your help.


Please follow and like us:

Leave a Reply

Your email address will not be published. Required fields are marked *