Tài liệu API Hop
Tham chiếu Google Trends
Xem mức độ quan tâm tìm kiếm, gợi ý, xu hướng và tin liên quan trên Google Trends.
Giới hạn đồng thời
AI và Data mỗi loại dùng chung một nhóm lượt đồng thời trên toàn tài khoản: mặc định 5 AI / 2 Data, tùy theo gói đăng ký. Giới hạn riêng của endpoint vẫn chịu giới hạn tổng của loại API. Khi đạt bất kỳ giới hạn nào, API trả về HTTP 429. Tác vụ bất đồng bộ giữ chỗ đến khi thực thi kết thúc.
GET /v1/google-trends/search GET /v1/google-trends/autocomplete GET /v1/google-trends/news GET /v1/google-trends/trending-now Xem mức độ quan tâm tìm kiếm, gợi ý, xu hướng và tin liên quan trên Google Trends.
Xác thực và phí
Giá mặc định là $0.0003 (300 credits) cho mỗi yêu cầu thành công. Dùng khóa API API Hop. Quyền truy cập phụ thuộc cổng đang bật và quyền khóa. Xem danh mục và tài khoản để biết giá mỗi yêu cầu thành công; ưu tiên giá tài khoản. Kết quả rỗng thành công vẫn tính phí. Lỗi giải phóng khoản giữ trước. Hết hạn sau 60 giây, không tự thử lại hay phân trang. Lỗi quyết toán không gọi lại nhà cung cấp.
Authorization: Bearer YOUR_API_KEYChỉ nhận tham số truy vấn, không có phần thân. Từ chối giá trị lạ, trùng, trống hoặc không hợp lệ, trừ geo và gprop trống được ghi rõ. Chỉ JSON; không tự phân trang hay thử lại. AND = cả hai, OR = hoặc, XOR = đúng một, NOT = loại trừ, => = yêu cầu. Sao chép mã và mã tin tức từ phản hồi mới; ví dụ không phải kết quả kiểm thử thực tế. Mỗi truy vấn thành công tính phí riêng.
Google Trends: Xem mức độ quan tâm tìm kiếm
GET https://api.apihop.ai/v1/google-trends/search
Tham số
| Trường | Kiểu | Giới hạn | Ví dụ |
|---|---|---|---|
query | string | Từ khóa tìm kiếm; query: REQUIRED | tesla |
country | string | Mã quốc gia hoặc cửa hàng (country); country: optional; ^[A-Za-z]{2}$ | - |
language | string | Ngôn ngữ; language: optional | - |
category | string | Loại biểu đồ hoặc độ phân giải địa lý (category); category: optional; interest_over_time, interest_by_region, related_queries, related_topics | interest_over_time |
time_range | string | Khoảng thời gian tương đối hoặc ngày (time_range); time_range: optional | - |
device | string | Thiết bị; device: optional; desktop, mobile, tablet | desktop |
zero_trace | boolean | Không lưu trữ phản hồi; zero_trace: optional | true |
data_type | string | Loại biểu đồ hoặc độ phân giải địa lý (data_type); data_type: optional; TIMESERIES, GEO_MAP, GEO_MAP_0, RELATED_TOPICS, RELATED_QUERIES | TIMESERIES |
geo | string | Mã vị trí Trends (geo); geo: optional; UTF-8 bytes: 100 | - |
region | string | Loại biểu đồ hoặc độ phân giải địa lý (region); region: optional; COUNTRY, REGION, DMA, CITY | COUNTRY |
cat | integer | Mã phân loại chủ đề (cat); cat: optional; 0, 3, 5, 7, 8, 11, 12, 13, 14, 16, ... 1133 | 0 |
gprop | string | Nguồn tìm kiếm (gprop); gprop: optional; `, images, news, froogle, youtube` | |
date | string | Khoảng thời gian tương đối hoặc ngày (date); date: optional; UTF-8 bytes: 256 | - |
csv | boolean | Dữ liệu CSV bổ sung (csv); csv: optional | true |
include_low_search_volume | boolean | Bao gồm vùng có ít lượt tìm kiếm (include_low_search_volume); include_low_search_volume: optional | true |
tz | integer | Độ lệch múi giờ theo phút (quy ước trình duyệt) (tz); tz: optional; min: -1439; max: 1439 | -1439 |
Kiểm tra
GET query only; body = null; response = JSON; html, output, json_restrictor, no_cache: NOT supportedstring: UTF-8 bytes <= maxLength (default 8192); boolean = true OR false; integer: safe integerlanguage: /^[A-Za-z]{2,3}(?:[-_][A-Za-z]{2,4})?$/query: 1..5 nonempty comma-separated terms; NOT (category AND data_type); NOT (date AND time_range)category: interest_over_time = TIMESERIES, interest_by_region = GEO_MAP_0, related_queries = RELATED_QUERIES, related_topics = RELATED_TOPICS; default TIMESERIESregion OR include_low_search_volume => data_type = GEO_MAP OR GEO_MAP_0; GEO_MAP_0 requires exactly one termgeo: empty = worldwide; uppercase country or subdivision; overrides country; comma-separated locations require TIMESERIES and one location per termgprop: empty = web search; froogle = shopping; tz: browser offset minutes (420 = UTC-07:00)date, time_range: all, now 1-H, now 4-H, now 1-d, now 7-d, today 1-m, today 3-m, today 12-m, today 5-y, OR ordered YYYY-MM-DD YYYY-MM-DD within 2004-01-01..todaydate: multiple comma-separated custom ranges require TIMESERIES and one range per term; cat: topic ID (default 0)
Ví dụ
curl --get "https://api.apihop.ai/v1/google-trends/search" \
-H "Authorization: Bearer YOUR_API_KEY" \
--data-urlencode "query=tesla"Google Trends: Lấy gợi ý chủ đề
GET https://api.apihop.ai/v1/google-trends/autocomplete
Tham số
| Trường | Kiểu | Giới hạn | Ví dụ |
|---|---|---|---|
query | string | Từ khóa tìm kiếm; query: REQUIRED | tesla |
language | string | Ngôn ngữ; language: optional | - |
limit | integer | Giới hạn kết quả; limit: optional; min: 1; max: 100 | 1 |
device | string | Thiết bị; device: optional; desktop, mobile, tablet | desktop |
zero_trace | boolean | Không lưu trữ phản hồi; zero_trace: optional | true |
Kiểm tra
GET query only; body = null; response = JSON; html, output, json_restrictor, no_cache: NOT supportedstring: UTF-8 bytes <= maxLength (default 8192); boolean = true OR false; integer: safe integerlanguage: /^[A-Za-z]{2,3}(?:[-_][A-Za-z]{2,4})?$/
Ví dụ
curl --get "https://api.apihop.ai/v1/google-trends/autocomplete" \
-H "Authorization: Bearer YOUR_API_KEY" \
--data-urlencode "query=tesla"Google Trends: Lấy tin liên quan
GET https://api.apihop.ai/v1/google-trends/news
Tham số
| Trường | Kiểu | Giới hạn | Ví dụ |
|---|---|---|---|
page_token | string | Mã tin tức từ kết quả Trending Now mới nhất (page_token); page_token: REQUIRED; UTF-8 bytes: 32768; ^gtn1\.[A-Za-z0-9_-]+$ | ${NEWS_PAGE_TOKEN} |
device | string | Thiết bị; device: optional; desktop, mobile, tablet | desktop |
zero_trace | boolean | Không lưu trữ phản hồi; zero_trace: optional | true |
Kiểm tra
GET query only; body = null; response = JSON; html, output, json_restrictor, no_cache: NOT supportedstring: UTF-8 bytes <= maxLength (default 8192); boolean = true OR false; integer: safe integerlanguage: /^[A-Za-z]{2,3}(?:[-_][A-Za-z]{2,4})?$/page_token: exact news_page_token from a fresh Trending Now response; account-bound opaque continuation, do not fabricate or reuse expired tokens
Ví dụ
curl --get "https://api.apihop.ai/v1/google-trends/news" \
-H "Authorization: Bearer YOUR_API_KEY" \
--data-urlencode "page_token=${NEWS_PAGE_TOKEN}"Google Trends: Lấy tìm kiếm thịnh hành
GET https://api.apihop.ai/v1/google-trends/trending-now
Tham số
| Trường | Kiểu | Giới hạn | Ví dụ |
|---|---|---|---|
country | string | Mã quốc gia hoặc cửa hàng (country); country: optional; ^[A-Za-z]{2}$ | us |
language | string | Ngôn ngữ; language: optional | - |
limit | integer | Giới hạn kết quả; limit: optional; min: 1; max: 100 | 1 |
device | string | Thiết bị; device: optional; desktop, mobile, tablet | desktop |
zero_trace | boolean | Không lưu trữ phản hồi; zero_trace: optional | true |
geo | string | Mã vị trí Trends (geo); geo: optional; `, AL, DZ, AO, AR, AR-C, AR-B, AR-K, AR-H, AR-U`, ... 1445 | |
hours | integer | Số giờ trước (hours); hours: optional; 4, 24, 48, 168 | 4 |
category_id | integer | Mã phân loại chủ đề (category_id); category_id: optional; 0, 1, 2, 3, 20, 4, 5, 6, 7, 8, 9, 10, 11, 13, 14, 15, 16, 17, 18, 19 | 0 |
only_active | boolean | Chỉ xu hướng đang hoạt động (only_active); only_active: optional | true |
Kiểm tra
GET query only; body = null; response = JSON; html, output, json_restrictor, no_cache: NOT supportedstring: UTF-8 bytes <= maxLength (default 8192); boolean = true OR false; integer: safe integerlanguage: /^[A-Za-z]{2,3}(?:[-_][A-Za-z]{2,4})?$/geo: empty = US; overrides country; hours: default 24; category_id: 0 = all; only_active: active trends only
Ví dụ
curl --get "https://api.apihop.ai/v1/google-trends/trending-now" \
-H "Authorization: Bearer YOUR_API_KEY" \
--data-urlencode "country=us"Phản hồi và lỗi
Giữ JSON gốc và độ chính xác. Ví dụ kết quả rỗng thành công. HTTP 400: đầu vào; 401: xác thực; 402: số dư; 403: quyền; 405: phương thức; 429: giới hạn; 5xx: dịch vụ. Giữ X-Request-Id.
{
"success": true,
"request_id": "example-request",
"data": {
"format": "json",
"content": {
"results": []
}
}
}