Google Custom Search
Leverage Google’s search power. Provide acx
ID to search the sites you specify; otherwise the request uses YouRouter’s default search engine. Create your own Custom Search Engine at programmablesearchengine.google.com to obtain a cx
ID.
Endpoint: GET /customsearch/v1
Parameters
Parameter | Type | Description | Required |
---|---|---|---|
q | string | The search query. | Yes |
cx | string | Custom Search Engine ID. Uses YouRouter’s default if omitted. | No |
num | integer | Number of search results to return (1-10). | No |
start | integer | The index of the first result to return. | No |
siteSearch | string | Specifies a given site to search. | No |
Response Format
A successful response contains an
items
array of search result objects.Use Cases & Best Practices
Q&A on Your Own Documentation
Q&A on Your Own Documentation
Use Case: Create a chatbot that can answer user questions about your products by searching your own documentation websites.
Best Practice: Create a Google Custom Search Engine configured to index only your documentation sites (e.g.,
docs.yourproduct.com
, help.yourproduct.com
). When a user asks a question, use their query to search your docs via the API. Pass the top search results to a language model to generate a specific, helpful answer. This is a core component of Retrieval-Augmented Generation (RAG).