Google Trends API endpoint
Returns the Top related queries widget for one or more Google Trends explore terms. Returns an empty queries array when Google returns no rows for the requested term/filter combination.
/google/trends/explore/top-queriesReturns only the Top related queries widget for one or more Google Trends Explore terms.
If Google returns no query rows for the requested term/filter combination, the response is still 200 with queries: [].
Request body:
keywords: required array of 1 to 5 keywords.geo: optional country/territory location code. Defaults to worldwide when omitted. Allowed values: WORLDWIDE, AF, AX, AL, DZ, AS, AD, AO, AI, AQ, AG, AR, AM, AW, AU, AT, AZ, BS, BH, BD, BB, BY, BE, BZ, BJ, BM, BT, BO, BA, BW, BV, BR, IO, VG, BN, BG, BF, BI, KH, CM, CA, CV, BQ, KY, CF, TD, CL, CN, CX, CC, CO, KM, CG, CD, CK, CR, CI, HR, CU, CW, CY, CZ, DK, DJ, DM, DO, EC, EG, SV, GQ, ER, EE, SZ, ET, FK, FO, FJ, FI, FR, GF, PF, TF, GA, GM, GE, DE, GH, GI, GR, GL, GD, GP, GU, GT, GG, GN, GW, GY, HT, HM, HN, HK, HU, IS, IN, ID, IR, IQ, IE, IM, IL, IT, JM, JP, JE, JO, KZ, KE, KI, XK, KW, KG, LA, LV, LB, LS, LR, LY, LI, LT, LU, MO, MG, MW, MY, MV, ML, MT, MH, MQ, MR, MU, YT, MX, FM, MD, MC, MN, ME, MS, MA, MZ, MM, NA, NR, NP, NL, NC, NZ, NI, NE, NG, NU, NF, KP, MK, MP, NO, OM, PK, PW, PS, PA, PG, PY, PE, PH, PN, PL, PT, PR, QA, RE, RO, RU, RW, WS, SM, ST, SA, SN, RS, SC, SL, SG, SX, SK, SI, SB, SO, ZA, GS, KR, SS, ES, LK, BL, SH, KN, LC, MF, PM, VC, SD, SR, SJ, SE, CH, SY, TW, TJ, TZ, TH, TL, TG, TK, TO, TT, TN, TR, TM, TC, TV, UM, VI, UG, UA, AE, GB, US, UY, UZ, VU, VA, VE, VN, WF, EH, YE, ZM, ZW.time_range: optional Trends time range. Allowed values: now 1-H, now 4-H, now 1-d, now 7-d, today 1-m, today 3-m, today 12-m, today 5-y, all. Defaults to today 12-m.hl: optional locale. Defaults to en-US.tz: optional timezone offset in minutes. Defaults to 0.category: optional Trends category id. Defaults to 0.type: optional search type. Allowed values: web, image, news, youtube, shopping. Defaults to web.property: optional legacy Trends property filter. Prefer type; if both are supplied they must describe the same search type.Notes:
503 with a Retry-After header and an error message naming the failing widget endpoint and upstream status, for example google trends widgetdata/relatedsearches rate limited by upstream (status 429).| Field | In the sample | Value in the sample |
|---|---|---|
| keywords | Has a value | 1 entry |
| geo | Has a value | “HK” |
| time_range | Has a value | “today 12-m” |
| hl | Has a value | “en-US” |
| tz | Has a value | 0 |
| category | Has a value | 0 |
| type | Has a value | “web” |
| query_type | Has a value | “top” |
| queries | Has a value | 1 entry |
| Parameter | Type | Required | Default | Description | Example |
|---|---|---|---|---|---|
| request (body) | object | Yes | Explore request | ||
| x-api-key (header) | string | Yes | API key required |
curl -X POST "https://api.crawlora.net/api/v1/google/trends/explore/top-queries" \
-H "x-api-key: $CRAWLORA_API_KEY" \
-H "Content-Type: application/json" \
-d '{"category":0,"geo":"US","hl":"en-US","keywords":["chatgpt","openai"],"property":"","time_range":"today 12-m","type":"web","tz":0}'{
"category": 0,
"geo": "US",
"hl": "en-US",
"keywords": [
"chatgpt",
"openai"
],
"property": "",
"time_range": "today 12-m",
"type": "web",
"tz": 0
}{
"code": 200,
"msg": "OK",
"data": {
"keywords": [
"google"
],
"geo": "HK",
"time_range": "today 12-m",
"query_type": "top",
"queries": [
{
"keyword": "google",
"items": [
{
"query": "google maps",
"value": 100,
"formatted_value": "100"
}
]
}
]
}
}Request schema
#/definitions/trends.ExploreRequest
| Field | Type | Required | Enum | Bounds | Example | Description |
|---|---|---|---|---|---|---|
| category | integer | No | 0 | |||
| geo | string | No | WORLDWIDE, AF, AX, AL, DZ, AS, AD, AO, AI, AQ, AG, AR, AM, AW, AU, AT, AZ, BS, BH, BD, BB, BY, BE, BZ, BJ, BM, BT, BO, BA, BW, BV, BR, IO, VG, BN, BG, BF, BI, KH, CM, CA, CV, BQ, KY, CF, TD, CL, CN, CX, CC, CO, KM, CG, CD, CK, CR, CI, HR, CU, CW, CY, CZ, DK, DJ, DM, DO, EC, EG, SV, GQ, ER, EE, SZ, ET, FK, FO, FJ, FI, FR, GF, PF, TF, GA, GM, GE, DE, GH, GI, GR, GL, GD, GP, GU, GT, GG, GN, GW, GY, HT, HM, HN, HK, HU, IS, IN, ID, IR, IQ, IE, IM, IL, IT, JM, JP, JE, JO, KZ, KE, KI, XK, KW, KG, LA, LV, LB, LS, LR, LY, LI, LT, LU, MO, MG, MW, MY, MV, ML, MT, MH, MQ, MR, MU, YT, MX, FM, MD, MC, MN, ME, MS, MA, MZ, MM, NA, NR, NP, NL, NC, NZ, NI, NE, NG, NU, NF, KP, MK, MP, NO, OM, PK, PW, PS, PA, PG, PY, PE, PH, PN, PL, PT, PR, QA, RE, RO, RU, RW, WS, SM, ST, SA, SN, RS, SC, SL, SG, SX, SK, SI, SB, SO, ZA, GS, KR, SS, ES, LK, BL, SH, KN, LC, MF, PM, VC, SD, SR, SJ, SE, CH, SY, TW, TJ, TZ, TH, TL, TG, TK, TO, TT, TN, TR, TM, TC, TV, UM, VI, UG, UA, AE, GB, US, UY, UZ, VU, VA, VE, VN, WF, EH, YE, ZM, ZW | US | ||
| hl | string | No | en-US | |||
| keywords | array | No | chatgpt,openai | |||
| property | string | No | ||||
| time_range | string | No | now 1-H, now 4-H, now 1-d, now 7-d, today 1-m, today 3-m, today 12-m, today 5-y, all | today 12-m | ||
| type | string | No | web, image, news, youtube, shopping | web | ||
| tz | integer | No | 0 |
Response schema
#/definitions/trends.exploreQueriesResponseDoc
| Field | Type | Required | Enum | Bounds | Example | Description |
|---|---|---|---|---|---|---|
| code | integer | No | 200 | |||
| data | trends.ExploreQueriesResponse | No | ||||
| data.category | integer | No | 0 | Trends category ID that was applied. `0` means all categories. | ||
| data.geo | string | No | US | Location code the data covers, such as `US`. | ||
| data.hl | string | No | en-US | Locale that was applied, such as `en-US`. | ||
| data.keywords | array | No | Keywords that were compared. | |||
| data.property | string | No | Google property filter that was applied, matching `type`. | |||
| data.queries | array | No | Related queries, grouped by keyword. | |||
| data.queries[].items | array | No | Related entries for this keyword. | |||
| data.queries[].items[].formatted_value | string | No | 100 | Value as Google Trends displays it. | ||
| data.queries[].items[].link | string | No | /trends/explore?q=chatgpt | Google Trends path that opens this entry in Explore. | ||
| data.queries[].items[].query | string | No | chatgpt login | Related search query. | ||
| data.queries[].items[].topic_mid | string | No | /g/11khcfz0y2 | Google topic ID of the related topic, such as `/g/11khcfz0y2`. | ||
| data.queries[].items[].topic_title | string | No | ChatGPT | Title of the related topic. | ||
| data.queries[].items[].topic_type | string | No | Topic | Type label of the related topic, such as `Topic`. | ||
| data.queries[].items[].value | integer | No | 100 | Relative popularity score Google Trends gives the entry. | ||
| data.queries[].keyword | string | No | chatgpt | Keyword the related entries belong to. | ||
| data.query_type | string | No | top | Kind of related queries returned: `top` or `rising`. | ||
| data.time_range | string | No | today 12-m | Time range that was applied, such as `today 12-m`. | ||
| data.type | string | No | web | Search type that was applied: `web`, `image`, `news`, `youtube` or `shopping`. | ||
| data.tz | integer | No | 0 | Timezone offset in minutes that was applied. | ||
| msg | string | No | OK |
| Status | Description | Schema |
|---|---|---|
| 400 | Invalid input | #/definitions/app.Response |
| 429 | Rate limit exceeded | #/definitions/app.Response |
| 500 | Internal server error | #/definitions/app.Response |
| 503 | Google Trends upstream request failed | #/definitions/app.Response |
Use environment variables for secrets and keep Crawlora API keys server-side.
curl -X POST "https://api.crawlora.net/api/v1/google/trends/explore/top-queries" \
-H "x-api-key: $CRAWLORA_API_KEY" \
-H "Content-Type: application/json" \
-d '{"category":0,"geo":"US","hl":"en-US","keywords":["chatgpt","openai"],"property":"","time_range":"today 12-m","type":"web","tz":0}'