PHPackages                             imarc/craft-googlecustomsearch - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. imarc/craft-googlecustomsearch

ActiveCraft-plugin[API Development](/categories/api)

imarc/craft-googlecustomsearch
==============================

A Craft plugin for integrating with Google's Custom Search (and Google's Site Search.)

2.3.0(1y ago)2312.3k↓50%7[3 PRs](https://github.com/imarc/craft-googlecustomsearch/pulls)Apache-2.0PHPPHP ^8.0CI failing

Since Apr 22Pushed 1y ago23 watchersCompare

[ Source](https://github.com/imarc/craft-googlecustomsearch)[ Packagist](https://packagist.org/packages/imarc/craft-googlecustomsearch)[ RSS](/packages/imarc-craft-googlecustomsearch/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)Dependencies (2)Versions (28)Used By (0)

Google Custom Search plugin for Craft CMS 3.x
=============================================

[](#google-custom-search-plugin-for-craft-cms-3x)

A Craft CMS plugin that incorporates a Google Custom Search into your website.

Google offers [free](https://cse.google.com/cse) and [paid](https://www.google.com/work/search/products/gss.html) tiers for accessing their search results.

*If you are looking for the Craft 2 version of this plugin, [see the `craft2` branch.](https://github.com/imarc/craft-googlecustomsearch/tree/craft2)*

Requirements
------------

[](#requirements)

This plugin requires Craft CMS 3.0.0 or later.

Installation
------------

[](#installation)

To install the plugin, follow these instructions.

1. Open your terminal and go to your Craft project:

    ```
     cd /path/to/project

    ```
2. Then tell Composer to load the plugin:

    ```
     composer require imarc/craft-googlecustomsearch

    ```
3. In the Control Panel, go to Settings → Plugins and click the “Install” button for googlecustomsearch.

Configuring
-----------

[](#configuring)

You will need a **Search Engine ID** and **API Key** from Google.

**Search Engine ID** - On the [Custom Search Engine Control Panel](http://www.google.com/cse/manage/all), create a new search engine for the site you would like to integrate. Once created, you can retrieve your Search Engine ID from the *Setup* tab.

**API Key** - **If you're using the free tier**, visit the [Google Developers Console](https://console.developers.google.com) and create a project for your search engine. Within your project, you’ll need to enable the *Custom Search API* from the *APIs* tab. Finally, on the *Credentials* tab, you will need to create a Public API access key by selecting the *Create new Key* option and choosing *Server key*. The API Key will now be available. **If you're using a paid tier**, you can find your API key in the [Control Panel](http://www.google.com/cse/manage/all) in the *Business &gt; XML &amp; JSON* tab.

The credentials can either be added from Craft's plugin settings or within `config/googlecustomsearch.php`.

```
