Google Programmable Search API: A Tool for SEO and Custom Search
Google offers a programmable search engine tool for webmasters and developers that allows anyone to install a customisable search engine on their website with minimal effort.
The programmable search engine is a great way to utilise Google’s technical prowess to install a fast, accurate search engine within your domain. It also makes it easy for website makers to install powerful single-domain search and enable users to quickly find information. However, here at JL Creative, we have seen some other uses for it.
One key element of SEO is understanding what the Search Engine landscape is for the key terms you are targeting. To do this, it is essential to know where you and your competitors are ranking and get an idea of which pages appear on the first page of the search results. SEO tools like Ahrefs and SEMRush make this easy, but require a budget. Checking manually can be time-consuming, especially if you have a lot of terms you want to search.
Internally, we have created a tool that uses the programmable search engine API and Google Apps Scripts to fetch the top 10 results on Google from a list of queries and return key information about them that can be useful for your SEO. To use the tool, follow the steps below.
All you will need is a Google account, the spreadsheet below, and about 10 minutes to set it up!
Setting Up Your Programmable Search Engine:
Open the Programmable Search Engine Control Panel
Click ‘Add a Search Engine’ to start.
Name Your Search Engine
Give your search engine a name. If you would like your search engine to only look on a specific site or list of sites, you can also provide their URLs and any modifiers during this step. Otherwise, select ‘Search the entire web’.
3. Copy the Search Engine ID
After clicking ‘Create,’ copy your search engine’s ID from the displayed script. The ID is the number after “cx” in the URL parameter. For example, 460afa86bb9be4ce7.
4. Customise Search Engine Settings
If you click 'Customise,' you can alter the settings for your programmable search engine. As mentioned before, one important setting you may want to change is whether the search engine searches the entire web or only specific sites. Whichever option you choose, make sure that the option is reflected in the spreadsheet as well.
Obtaining an API key
5. Access the Custom Search API Website
Navigate to the Custom Search API website and click 'Get an API key'. When prompted, give your project a name.
6. Generate and Copy Your API Key
Click 'SHOW KEY' to reveal your API key and make a note of it for later.
Configuring Your Spreadsheet
7. Enter API Key and Search Engine ID
Paste your API key and Programmable Search Engine ID into the designated spots in the spreadsheet.
8. Fill in Search Queries and Domains
Populate the spreadsheet with your search terms and, if applicable, the domains you want to focus on.
Running the Script
9. Activate the Script
Click 'Extensions' in the top menu and you will find a sub-menu containing the trigger to run the Programmable Search Engine API script. Select it to run the script.
10. Grant Script Permissions
The script will ask for permission to run on your account. Once permission has been granted, you may need to click 'run' again.
Reviewing Your Results
Once the script has run, it will populate the output sheet and then delete the queries and URLs you placed in the first two columns. The results should look something like this:
Usage Limits
Note that the Programmable Search Engine API has a free usage limit of 100 daily queries. You can sign up for billing in the API Console if you want to use more. Additional requests cost $5 per 1000 queries, up to 10,000 queries per day.
Now that you have set the script up, you can use it for whatever you like!
Ready to Take Your SEO Strategy Further?
With your programmable search engine up and running, you now have a powerful tool to gain deeper SEO insights and better understand the competitive landscape. Whether you’re tracking rankings, researching keywords, or exploring content opportunities, this tool can be a game-changer.
If you’re looking to take your SEO to the next level, our team at JL Creative specialises in customised digital strategies for HVAC, construction, and trades businesses. From keyword research to technical SEO, we’re here to help you amplify your online presence and drive growth. Speak to an expert to learn how our digital marketing services can support your business!
For more information, read the Privacy Policy for this Script.