Google custom search JSON api explained

Google custom search JSON API Documentation explained

Rate this article

Share this article

Google Custom Search JSON API: Complete Guide, Pricing, Limits & Examples

Google Custom Search JSON API lets developers programmatically retrieve
Google search results (web and images) from a
Programmable Search Engine using RESTful requests.
This guide covers setup, API keys, CX ID, request examples, pricing,
limitations, and scalable alternatives like ExpertRec.

Trusted Website Search by 10,000+ Sites

Deliver fast, AI-powered search results that help visitors find content instantly and convert better.


⭐ 4.8/5 Rating


🔒 GDPR Compliant


⚡ 5 Min Setup


Try ExpertRec Free →

No credit card required • Free setup

What is Google Custom Search JSON API?

The Google Custom Search JSON API is a RESTful API that returns
Google search results in JSON format. It works with Google’s
Programmable Search Engine and allows developers to build custom search
interfaces for websites and applications.

  • Web search results
  • Image search support
  • Site-restricted or multi-site search
  • Custom UI with Google-powered results

Things to Do Before You Begin

  1. Create a Programmable Search Engine
  2. Retrieve your Search Engine ID (CX)
  3. Generate a Custom Search API key
  4. Enable billing if needed

Create a Custom Search Engine

  1. Visit https://cse.google.com
  2. Click Create
  3. Add your website or list of URLs
  4. Configure language and region
  5. Finish setup

Get Your Search Engine ID (CX)

The CX ID uniquely identifies your Programmable Search Engine.

  1. Open the search engine control panel
  2. Edit search engine
  3. Go to Basics → Details
  4. Copy the Search engine ID

Get Your Custom Search API Key

  1. Go to
    Google Custom Search API overview
  2. Click Get a key
  3. Create or select a Google Cloud project
  4. Generate and restrict your API key

Request Format & Parameters

https://www.googleapis.com/customsearch/v1

Required Parameters

  • key – API key
  • cx – Search Engine ID
  • q – Search query

Optional Parameters

  • num – Number of results (max 10)
  • start – Pagination
  • searchType – image
  • fileType – PDF, DOC, etc.

Sample API Request

https://www.googleapis.com/customsearch/v1?
key=YOUR_API_KEY
&cx=YOUR_CX_ID
&q=rocket+propulsion
&num=10

Pricing & Quota Limits

  • 100 free queries per day
  • $5 per 1,000 additional queries
  • Maximum 10,000 queries per day

High-traffic websites can quickly incur significant costs.

Monitoring API Usage

Monitor usage via Google Cloud Console → API Dashboard
or use Google Cloud Operations for alerts and dashboards.

Limitations of Google Custom Search JSON API

  • Maximum 10 results per request
  • Daily query limits
  • Expensive at scale
  • Ads may appear

ExpertRec: A Scalable Alternative

ExpertRec provides a site search API priced by
number of pages, not queries.

  • Unlimited searches
  • No ads
  • Fast performance
  • Multi-site support

Google Custom Search vs ExpertRec

Feature Google Custom Search API ExpertRec
Pricing model Per query Per page
Query limits Yes No
Ads Possible No ads
Best for Low-volume search High-traffic sites

Frequently Asked Questions

How many free searches does the API allow?

Google allows 100 free queries per day.

What is a CX ID?

It is the unique identifier of your Programmable Search Engine.

Is there a cheaper alternative?

Yes. ExpertRec offers unlimited queries with predictable pricing.

 

Are you showing the right products, to the right shoppers, at the right time? Contact us to know more.
You may also like