---
title: "Integrated the Google Custom Search API in your website"  
description: "In this article I am going to explain how to Integrated Google Custom Search API in your web site."  
author: "Vijay Shukla"  
published: 2013-05-10  
updated: 2022-12-22  
canonical: https://www.mindstick.com/articles/1290/integrated-the-google-custom-search-api-in-your-website  
category: "api(s)"  
tags: ["api(s)"]  
reading_time: 2 minutes  

---

# Integrated the Google Custom Search API in your website

Integrated the [Google](https://yourviews.mindstick.com/story/1191/top-products-and-services-from-google) Custom Search API in your website

In this article I am going to explain how to Integrated Google Custom Search API in your web site.

Google Custom Search API

Google Custom Search API is a platform provided by Google that allows web developers to feature specialized information in web searches. Users can customize the search engine that is built using Google's core search technology. Once you've defined your search engine, Google provides code for a search box that users can copy and then paste right in to their own Web site.

![Integrated the Google Custom Search API in your website](https://www.mindstick.com/mindstickarticle/0ebc8b1e-71ff-4abb-87f1-fa42a283fbb8/images/4674254e-2898-4d8a-945a-15c211475333.png)

After login appear a form which is getting info about you’re searching.

![Integrated the Google Custom Search API in your website](https://www.mindstick.com/mindstickarticle/0ebc8b1e-71ff-4abb-87f1-fa42a283fbb8/images/b6a0fbdf-07b0-4018-b7f7-8cd3ced2a1be.png)

a. Sites to Search: - Here I give our website name for searching content.

b. Click to expand Learn More about URL formatting.

c. Language: - Select language.

d. Name: - The name of the CSE will be auto filled based on sites that you enter.

e. Terms of Service: - click on this link for read the terms of service of Google.

f. And in the last click to Create button for creating a script.

After Clicking the Create button now you will get a script.

![Integrated the Google Custom Search API in your website](https://www.mindstick.com/mindstickarticle/0ebc8b1e-71ff-4abb-87f1-fa42a283fbb8/images/2a51a571-5dd3-4d56-bc48-0d91506ce6da.png)

Now you will copy the script and paste script where which you want to set your Google Custom 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> \
<script> \
(function () { \
var cx = '008624464961907757347:rf7viccw_rg'; \
var gcse = document.createElement('script'); gcse.type = 'text/javascript'; \
gcse.async = true; \
gcse.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') + \
'//www.google.com/cse/cse.js?cx=' + cx; \
var s = document.getElementsByTagName('script')[0]; \
s.parentNode.insertBefore(gcse, s); \
})(); \
</script> \
</head> \
<body> \
<div style='width:350px;'><gcse:search></gcse:search></div> \
</body> \
</html>

Output:-

![Integrated the Google Custom Search API in your website](https://www.mindstick.com/mindstickarticle/0ebc8b1e-71ff-4abb-87f1-fa42a283fbb8/images/8ba0da96-5f6b-4d8a-bc72-8f8c559c86a8.png)

After type Ajax in textbox and click on search button below screen will be appear.

![Integrated the Google Custom Search API in your website](https://www.mindstick.com/mindstickarticle/0ebc8b1e-71ff-4abb-87f1-fa42a283fbb8/images/666e5ae6-d37b-4e96-8cb4-f521c76c89da.png)

---

Original Source: https://www.mindstick.com/articles/1290/integrated-the-google-custom-search-api-in-your-website

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
