API Hop

เอกสาร

เอกสาร API Hop

เอกสารอ้างอิง Google Trends

ดูความสนใจในการค้นหา คำแนะนำ การค้นหามาแรง และข่าวที่เกี่ยวข้องบน Google Trends

ขีดจำกัดการทำงานพร้อมกัน

AI และ Data ใช้โควตาคำขอพร้อมกันร่วมกันภายในแต่ละหมวดของบัญชี ค่าเริ่มต้นคือ 5 AI / 2 Data และปรับตามแพ็กเกจสมาชิก ขีดจำกัดเฉพาะ endpoint ยังอยู่ภายใต้ขีดจำกัดรวมของหมวด เมื่อถึงขีดจำกัดใดจะส่ง HTTP 429 งานอะซิงโครนัสใช้ช่องจนกว่าการทำงานจะสิ้นสุด

GET /v1/google-trends/search
ขีดจำกัดเริ่มต้น: 2
GET /v1/google-trends/autocomplete
ขีดจำกัดเริ่มต้น: 2
GET /v1/google-trends/news
ขีดจำกัดเริ่มต้น: 2
GET /v1/google-trends/trending-now
ขีดจำกัดเริ่มต้น: 2

ดูความสนใจในการค้นหา คำแนะนำ การค้นหามาแรง และข่าวที่เกี่ยวข้องบน Google Trends

การยืนยันตัวตนและค่าบริการ

ราคามาตรฐานต่อคำขอที่สำเร็จคือ $0.0003 (300 credits) ใช้คีย์ API ของ API Hop การเข้าถึงขึ้นอยู่กับเกตเวย์และสิทธิ์ ดูราคาต่อคำขอที่สำเร็จในแค็ตตาล็อกและบัญชี โดยใช้ราคาบัญชีก่อน ผลลัพธ์ว่างที่สำเร็จก็คิดค่าบริการ คำขอที่ล้มเหลวคืนยอดสำรอง หมดเวลาที่ 60 วินาที ไม่ลองซ้ำหรือแบ่งหน้าอัตโนมัติ ข้อผิดพลาดการชำระไม่เรียกผู้ให้บริการซ้ำ

http
Authorization: Bearer YOUR_API_KEY

รับเฉพาะพารามิเตอร์คิวรี ไม่รับเนื้อหาคำขอ ปฏิเสธค่าที่ไม่รู้จัก ซ้ำ ว่าง หรือไม่ถูกต้อง ยกเว้น geo และ gprop ว่างตามที่ระบุ รองรับ JSON เท่านั้น ไม่มีการเปลี่ยนหน้าหรือลองใหม่อัตโนมัติ AND = ทั้งคู่, OR = หรือ, XOR = อย่างใดอย่างหนึ่ง, NOT = ห้ามใช้, => = ต้องมี คัดลอกรหัสและโทเค็นข่าวจากคำตอบล่าสุด ตัวอย่างไม่ใช่ผลทดสอบจริง คิดค่าบริการแยกทุกคำขอที่สำเร็จ

GET https://api.apihop.ai/v1/google-trends/search

พารามิเตอร์

ฟิลด์ชนิดข้อจำกัดตัวอย่าง
querystringคำค้น; query: REQUIREDtesla
countrystringรหัสประเทศหรือร้านค้า (country); country: optional; ^[A-Za-z]{2}$-
languagestringภาษา; language: optional-
categorystringประเภทกราฟหรือความละเอียดพื้นที่ (category); category: optional; interest_over_time, interest_by_region, related_queries, related_topicsinterest_over_time
time_rangestringช่วงเวลาสัมพัทธ์หรือช่วงวันที่ (time_range); time_range: optional-
devicestringอุปกรณ์; device: optional; desktop, mobile, tabletdesktop
zero_tracebooleanไม่เก็บถาวรคำตอบ; zero_trace: optionaltrue
data_typestringประเภทกราฟหรือความละเอียดพื้นที่ (data_type); data_type: optional; TIMESERIES, GEO_MAP, GEO_MAP_0, RELATED_TOPICS, RELATED_QUERIESTIMESERIES
geostringรหัสพื้นที่ Trends (geo); geo: optional; UTF-8 bytes: 100-
regionstringประเภทกราฟหรือความละเอียดพื้นที่ (region); region: optional; COUNTRY, REGION, DMA, CITYCOUNTRY
catintegerรหัสหมวดหมู่หัวข้อ (cat); cat: optional; 0, 3, 5, 7, 8, 11, 12, 13, 14, 16, ... 11330
gpropstringแหล่งค้นหา (gprop); gprop: optional; `, images, news, froogle, youtube`
datestringช่วงเวลาสัมพัทธ์หรือช่วงวันที่ (date); date: optional; UTF-8 bytes: 256-
csvbooleanข้อมูล CSV เพิ่มเติม (csv); csv: optionaltrue
include_low_search_volumebooleanรวมพื้นที่ที่มีการค้นหาน้อย (include_low_search_volume); include_low_search_volume: optionaltrue
tzintegerส่วนต่างเขตเวลาเป็นนาที (ตามเบราว์เซอร์) (tz); tz: optional; min: -1439; max: 1439-1439

การตรวจสอบ

  • GET query only; body = null; response = JSON; html, output, json_restrictor, no_cache: NOT supported
  • string: UTF-8 bytes <= maxLength (default 8192); boolean = true OR false; integer: safe integer
  • language: /^[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 TIMESERIES
  • region OR include_low_search_volume => data_type = GEO_MAP OR GEO_MAP_0; GEO_MAP_0 requires exactly one term
  • geo: empty = worldwide; uppercase country or subdivision; overrides country; comma-separated locations require TIMESERIES and one location per term
  • gprop: 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..today
  • date: multiple comma-separated custom ranges require TIMESERIES and one range per term; cat: topic ID (default 0)

ตัวอย่าง

bash
curl --get "https://api.apihop.ai/v1/google-trends/search" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  --data-urlencode "query=tesla"

GET https://api.apihop.ai/v1/google-trends/autocomplete

พารามิเตอร์

ฟิลด์ชนิดข้อจำกัดตัวอย่าง
querystringคำค้น; query: REQUIREDtesla
languagestringภาษา; language: optional-
limitintegerจำนวนผลลัพธ์สูงสุด; limit: optional; min: 1; max: 1001
devicestringอุปกรณ์; device: optional; desktop, mobile, tabletdesktop
zero_tracebooleanไม่เก็บถาวรคำตอบ; zero_trace: optionaltrue

การตรวจสอบ

  • GET query only; body = null; response = JSON; html, output, json_restrictor, no_cache: NOT supported
  • string: UTF-8 bytes <= maxLength (default 8192); boolean = true OR false; integer: safe integer
  • language: /^[A-Za-z]{2,3}(?:[-_][A-Za-z]{2,4})?$/

ตัวอย่าง

bash
curl --get "https://api.apihop.ai/v1/google-trends/autocomplete" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  --data-urlencode "query=tesla"

GET https://api.apihop.ai/v1/google-trends/news

พารามิเตอร์

ฟิลด์ชนิดข้อจำกัดตัวอย่าง
page_tokenstringโทเค็นข่าวจากผล Trending Now ล่าสุด (page_token); page_token: REQUIRED; UTF-8 bytes: 32768; ^gtn1\.[A-Za-z0-9_-]+$${NEWS_PAGE_TOKEN}
devicestringอุปกรณ์; device: optional; desktop, mobile, tabletdesktop
zero_tracebooleanไม่เก็บถาวรคำตอบ; zero_trace: optionaltrue

การตรวจสอบ

  • GET query only; body = null; response = JSON; html, output, json_restrictor, no_cache: NOT supported
  • string: UTF-8 bytes <= maxLength (default 8192); boolean = true OR false; integer: safe integer
  • language: /^[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

ตัวอย่าง

bash
curl --get "https://api.apihop.ai/v1/google-trends/news" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  --data-urlencode "page_token=${NEWS_PAGE_TOKEN}"

GET https://api.apihop.ai/v1/google-trends/trending-now

พารามิเตอร์

ฟิลด์ชนิดข้อจำกัดตัวอย่าง
countrystringรหัสประเทศหรือร้านค้า (country); country: optional; ^[A-Za-z]{2}$us
languagestringภาษา; language: optional-
limitintegerจำนวนผลลัพธ์สูงสุด; limit: optional; min: 1; max: 1001
devicestringอุปกรณ์; device: optional; desktop, mobile, tabletdesktop
zero_tracebooleanไม่เก็บถาวรคำตอบ; zero_trace: optionaltrue
geostringรหัสพื้นที่ Trends (geo); geo: optional; `, AL, DZ, AO, AR, AR-C, AR-B, AR-K, AR-H, AR-U`, ... 1445
hoursintegerชั่วโมงที่ผ่านมา (hours); hours: optional; 4, 24, 48, 1684
category_idintegerรหัสหมวดหมู่หัวข้อ (category_id); category_id: optional; 0, 1, 2, 3, 20, 4, 5, 6, 7, 8, 9, 10, 11, 13, 14, 15, 16, 17, 18, 190
only_activebooleanเฉพาะแนวโน้มที่ยังทำงาน (only_active); only_active: optionaltrue

การตรวจสอบ

  • GET query only; body = null; response = JSON; html, output, json_restrictor, no_cache: NOT supported
  • string: UTF-8 bytes <= maxLength (default 8192); boolean = true OR false; integer: safe integer
  • language: /^[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

ตัวอย่าง

bash
curl --get "https://api.apihop.ai/v1/google-trends/trending-now" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  --data-urlencode "country=us"

ผลลัพธ์และข้อผิดพลาด

คง JSON ต้นฉบับและความแม่นยำ ตัวอย่างคือผลลัพธ์ว่างที่สำเร็จ HTTP 400: ข้อมูล; 401: ยืนยันตัวตน; 402: ยอดเงิน; 403: สิทธิ์; 405: วิธี; 429: จำกัด; 5xx: บริการ เก็บ X-Request-Id

json
{
  "success": true,
  "request_id": "example-request",
  "data": {
    "format": "json",
    "content": {
      "results": []
    }
  }
}