Google Trends API
Call POST /v1/seo/google-trends with a bearer key to return live relative keyword popularity and related trends — structured JSON, documented errors, and code samples in five languages.
- One REST Endpoint
- Simple Authentication
- Structured JSON Response
- Predictable Errors
- Cursor Pagination
- Idempotent Retries
Request examples
curl -X POST "https://api.agentbody.io/v1/seo/google-trends" \
-H "Authorization: Bearer <YOUR_AGENTBODY_API_KEY>" \
-H "Content-Type: application/json" \
-d '{"category_code":"1","date_from":"YOUR_DATE_FROM","date_to":"YOUR_DATE_TO","item_types":"YOUR_ITEM_TYPES","keywords":"YOUR_KEYWORDS","language_code":"YOUR_LANGUAGE_CODE","language_name":"YOUR_LANGUAGE_NAME","location_code":"1","location_name":"YOUR_LOCATION_NAME","tag":"YOUR_TAG","time_range":"YOUR_TIME_RANGE","type":"web"}'Response examples
Documented responses from the OpenAPI specification.
Relative keyword trends.
{
"items": [],
"keywords": []
}Features
Technical properties of the Google Trends API endpoint and how to integrate it.
One REST Endpoint
Call POST /v1/seo/google-trends with a bearer API key. The Google Trends API returns documented JSON — no SDK required, any HTTP client works.
Simple Authentication
Pass your key as a bearer token. Keep it server-side: the key never belongs in browser code, public repos, or client bundles.
Structured JSON Response
Responses use stable, documented field names so parsers, spreadsheets, and agent pipelines can consume results without custom cleanup.
Predictable Errors
400-class responses mean fix the request; 401 means check the key; 429 means slow down. Temporary 5xx failures are safe to retry with backoff.
Cursor Pagination
List-style responses include next_cursor and has_more. Pass the cursor back unchanged to fetch the next page — never construct or modify cursors.
Idempotent Retries
Send an idempotency key so a repeated request replays the stored response instead of executing and billing twice.
How to use
Integrate the Google Trends API in six steps: key, request, parse, handle errors, paginate, and monitor.
Create An API Key
Create an AgentBody account and generate a key in the console. Store it in your server environment or secret manager — never ship it to clients.
Build The Request
Send POST /v1/seo/google-trends with the required input (keywords). The samples on this page show the exact call in five languages.
Parse The Response
Read the documented JSON fields into your application. Store only what your product needs.
Handle Errors Explicitly
Fix 400s by correcting input, refresh 401s by rotating keys, and retry 5xx with exponential backoff. Treat validation failures as final answers, not transient faults.
Paginate With Cursors
When has_more is true, pass next_cursor unchanged on the next request until the window you need is covered.
Monitor Usage
Track calls and credits in the console. The usage endpoints let your own dashboard reflect consumption in real time.
Frequently asked questions
What is the Google Trends API?
An authenticated REST endpoint (POST /v1/seo/google-trends) that return live relative keyword popularity and related trends and returns structured JSON. One AgentBody key covers it and every other AgentBody endpoint.
How do I authenticate the Google Trends API?
Send an Authorization: Bearer header with your API key. Create and rotate keys in the console; keep them server-side only.
What does the Google Trends API response look like?
A successful call returns JSON with documented, stable field names. Full request and response examples appear on this page and in the linked documentation.
How much does the Google Trends API cost?
Each call consumes account credits. Pricing is governed by the gateway and visible in the console — this page never shows fixed numbers, so the console is always authoritative.
Does the Google Trends API support pagination?
List endpoints return next_cursor and has_more. Pass the cursor back unchanged to continue. Detail endpoints return a single object with no pagination.
Can agents call the Google Trends API directly?
Yes. Install the official AgentBody skill with the one-prompt install on the Agent tab, and your agent can call this endpoint — and every other AgentBody endpoint — with the same key.