Skip to main content
Endpoint: GET /customsearch/v1 Perform a Google Custom Search using the cx you provide. If omitted, the request uses YouRouter’s default search engine.
import requests
import json

response = requests.get(
    "https://api.yourouter.ai/customsearch/v1",
    headers={"Authorization": "Bearer YOUR_API_KEY"},
    params={
        "q": "how to set up billing",
        "cx": "YOUR_CUSTOM_SEARCH_ENGINE_ID",
        "num": 3
    }
)
print(json.dumps(response.json(), indent=2))

Parameters

ParameterTypeDescriptionRequired
qstringThe search query.Yes
cxstringCustom Search Engine ID. Uses YouRouter’s default if omitted.No
numintegerNumber of search results to return (1-10).No
startintegerThe index of the first result to return.No
siteSearchstringSpecifies a site to search.No

Response Format

A successful response contains an items array of search result objects.
{
  "kind": "customsearch#search",
  "items": [
    {
      "kind": "customsearch#result",
      "title": "Billing Information - Your Product Docs",
      "link": "https://docs.yourproduct.com/billing"
    }
  ]
}
I