API Hop

Tài liệu

Tài liệu API Hop

Tham chiếu Google Shopping

Tìm sản phẩm trên Google Shopping và lấy bộ lọc, thông tin chi tiết và ưu đãi của cửa hàng.

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-shopping/search
Giới hạn mặc định: 2
GET /v1/google-shopping/light
Giới hạn mặc định: 2
GET /v1/google-shopping/filters
Giới hạn mặc định: 2
GET /v1/google-shopping/product
Giới hạn mặc định: 2
GET /v1/google-shopping/immersive-product
Giới hạn mặc định: 2

Tìm sản phẩm trên Google Shopping và lấy bộ lọc, thông tin chi tiết và ưu đãi của cửa hàng.

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.

http
Authorization: Bearer YOUR_API_KEY

Google Shopping: Tìm sản phẩm

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

Tham số

TrườngKiểuGiới hạnVí dụ
querystringTừ khóa tìm kiếm; query: optionalcoffee grinder
countrystringMã quốc gia hoặc cửa hàng (country); country: optional; ^[A-Za-z]{2}$-
languagestringNgôn ngữ; language: optional-
pageintegerTrang bắt đầu từ 1; page: optional; min: 1; max: 10001
devicestringThiết bị; device: optional; desktop, mobile, tabletdesktop
zero_tracebooleanKhông lưu trữ phản hồi; zero_trace: optionaltrue
locationstringVị trí tìm kiếm; location: optional-
latitudenumberVĩ độ; latitude: optional; min: -90; max: 90-90
longitudenumberKinh độ; longitude: optional; min: -180; max: 180-180
safestringBộ lọc gốc (safe); safe: optional; active, offactive
uulestringBộ lọc gốc (uule); uule: optional; UTF-8 bytes: 4096-
google_domainstringTên miền theo vùng (google_domain); google_domain: optional-
startintegerVị trí kết quả; start: optional; min: 0; max: 10000
shoprsstringBộ lọc gốc (shoprs); shoprs: optional; UTF-8 bytes: 16384-
min_pricenumberGiá tối thiểu (min_price); min_price: optional; min: 0; max: 10000000000
max_pricenumberGiá tối đa (max_price); max_price: optional; min: 0; max: 10000000000
sort_bystringSắp xếp; sort_by: optional; 1, 21
free_shippingbooleanMiễn phí giao hàng (free_shipping); free_shipping: optionaltrue
on_salebooleanSản phẩm giảm giá (on_sale); on_sale: optionaltrue
small_businessbooleanDoanh nghiệp nhỏ (small_business); small_business: optionaltrue

Kiểm tra

Chỉ nhận tham số truy vấn, không có phần thân. Từ chối giá trị lạ, trùng lặp, trống hoặc không hợp lệ. Chỉ hỗ trợ JSON; không tự phân trang hay thử lại. Quy tắc: AND = cả hai, OR = hoặc, XOR = đúng một, NOT = loại trừ, => = yêu cầu.

  • 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})?$/
  • latitude => longitude; longitude => latitude
  • NOT (page AND start)
  • min_price <= max_price
  • query OR shoprs: required
  • uule => NOT location AND NOT latitude AND NOT longitude

Ví dụ

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

Google Shopping: Tìm sản phẩm (rút gọn)

GET https://api.apihop.ai/v1/google-shopping/light

Tham số

TrườngKiểuGiới hạnVí dụ
querystringTừ khóa tìm kiếm; query: optionalcoffee grinder
countrystringMã quốc gia hoặc cửa hàng (country); country: optional; ^[A-Za-z]{2}$-
languagestringNgôn ngữ; language: optional-
pageintegerTrang bắt đầu từ 1; page: optional; min: 1; max: 10001
devicestringThiết bị; device: optional; desktop, mobile, tabletdesktop
zero_tracebooleanKhông lưu trữ phản hồi; zero_trace: optionaltrue
locationstringVị trí tìm kiếm; location: optional-
latitudenumberVĩ độ; latitude: optional; min: -90; max: 90-90
longitudenumberKinh độ; longitude: optional; min: -180; max: 180-180
safestringBộ lọc gốc (safe); safe: optional; active, offactive
uulestringBộ lọc gốc (uule); uule: optional; UTF-8 bytes: 4096-
google_domainstringTên miền theo vùng (google_domain); google_domain: optional-
startintegerVị trí kết quả; start: optional; min: 0; max: 10000
shoprsstringBộ lọc gốc (shoprs); shoprs: optional; UTF-8 bytes: 16384-
min_pricenumberGiá tối thiểu (min_price); min_price: optional; min: 0; max: 10000000000
max_pricenumberGiá tối đa (max_price); max_price: optional; min: 0; max: 10000000000
sort_bystringSắp xếp; sort_by: optional; 1, 21
free_shippingbooleanMiễn phí giao hàng (free_shipping); free_shipping: optionaltrue
on_salebooleanSản phẩm giảm giá (on_sale); on_sale: optionaltrue
small_businessbooleanDoanh nghiệp nhỏ (small_business); small_business: optionaltrue

Kiểm tra

Chỉ nhận tham số truy vấn, không có phần thân. Từ chối giá trị lạ, trùng lặp, trống hoặc không hợp lệ. Chỉ hỗ trợ JSON; không tự phân trang hay thử lại. Quy tắc: AND = cả hai, OR = hoặc, XOR = đúng một, NOT = loại trừ, => = yêu cầu.

  • 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})?$/
  • latitude => longitude; longitude => latitude
  • NOT (page AND start)
  • min_price <= max_price
  • query OR shoprs: required
  • uule => NOT location AND NOT latitude AND NOT longitude

Ví dụ

bash
curl --get "https://api.apihop.ai/v1/google-shopping/light" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  --data-urlencode "query=coffee grinder"

Google Shopping: Lấy bộ lọc mua sắm

GET https://api.apihop.ai/v1/google-shopping/filters

Tham số

TrườngKiểuGiới hạnVí dụ
querystringTừ khóa tìm kiếm; query: REQUIREDcoffee grinder
countrystringMã quốc gia hoặc cửa hàng (country); country: optional; ^[A-Za-z]{2}$-
languagestringNgôn ngữ; language: optional-
locationstringVị trí tìm kiếm; location: optional-
latitudenumberVĩ độ; latitude: optional; min: -90; max: 90-90
longitudenumberKinh độ; longitude: optional; min: -180; max: 180-180
uulestringBộ lọc gốc (uule); uule: optional; UTF-8 bytes: 4096-
google_domainstringTên miền theo vùng (google_domain); google_domain: optional-
shoprsstringBộ lọc gốc (shoprs); shoprs: optional; UTF-8 bytes: 16384-
devicestringThiết bị; device: optional; desktop, mobile, tabletdesktop
zero_tracebooleanKhông lưu trữ phản hồi; zero_trace: optionaltrue

Kiểm tra

Chỉ nhận tham số truy vấn, không có phần thân. Từ chối giá trị lạ, trùng lặp, trống hoặc không hợp lệ. Chỉ hỗ trợ JSON; không tự phân trang hay thử lại. Quy tắc: AND = cả hai, OR = hoặc, XOR = đúng một, NOT = loại trừ, => = yêu cầu.

  • 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})?$/
  • latitude => longitude; longitude => latitude
  • uule => NOT location AND NOT latitude AND NOT longitude

Ví dụ

bash
curl --get "https://api.apihop.ai/v1/google-shopping/filters" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  --data-urlencode "query=coffee grinder"

Google Shopping: Lấy thông tin sản phẩm

GET https://api.apihop.ai/v1/google-shopping/product

Tham số

TrườngKiểuGiới hạnVí dụ
idstringMã sản phẩm hoặc người bán từ kết quả (id); id: optional17755277695162489284
querystringTừ khóa tìm kiếm; query: optionalsony wh-1000xm5
countrystringMã quốc gia hoặc cửa hàng (country); country: optional; ^[A-Za-z]{2}$-
languagestringNgôn ngữ; language: optional-
zero_tracebooleanKhông lưu trữ phản hồi; zero_trace: optionaltrue
page_tokenstringMã chọn sản phẩm từ phản hồi mới nhất (page_token); page_token: optional; UTF-8 bytes: 16384-
offer_viewbooleanƯu đãi từ người bán khác (offer_view); offer_view: optionaltrue

Kiểm tra

Chỉ nhận tham số truy vấn, không có phần thân. Từ chối giá trị lạ, trùng lặp, trống hoặc không hợp lệ. Chỉ hỗ trợ JSON; không tự phân trang hay thử lại. Quy tắc: AND = cả hai, OR = hoặc, XOR = đúng một, NOT = loại trừ, => = yêu cầu.

  • 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})?$/
  • id XOR page_token: required; page_token => NOT query AND NOT country AND NOT language AND NOT offer_view
  • id: /^[0-9]{1,30}$/
  • Tokens: copy the exact token from a fresh response; do not invent or reuse expired tokens

Ví dụ

bash
curl --get "https://api.apihop.ai/v1/google-shopping/product" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  --data-urlencode "id=17755277695162489284" \
  --data-urlencode "query=sony wh-1000xm5"

Google Shopping: Lấy thông tin sản phẩm mở rộng

GET https://api.apihop.ai/v1/google-shopping/immersive-product

Tham số

TrườngKiểuGiới hạnVí dụ
page_tokenstringMã chọn sản phẩm từ phản hồi mới nhất (page_token); page_token: REQUIRED; UTF-8 bytes: 16384gprod1.eyJ2IjoxLCJpZCI6IjE3NzU1Mjc3Njk1MTYyNDg5Mjg0IiwicSI6InNvbnkgd2gtMTAwMHhtNSIsImdsIjoidXMiLCJobCI6ImVuIn0
more_storesbooleanThêm ưu đãi cửa hàng (more_stores); more_stores: optionaltrue
next_page_tokenstringMã trang tiếp theo; next_page_token: optional; UTF-8 bytes: 24576-
zero_tracebooleanKhông lưu trữ phản hồi; zero_trace: optionaltrue

Kiểm tra

Chỉ nhận tham số truy vấn, không có phần thân. Từ chối giá trị lạ, trùng lặp, trống hoặc không hợp lệ. Chỉ hỗ trợ JSON; không tự phân trang hay thử lại. Quy tắc: AND = cả hai, OR = hoặc, XOR = đúng một, NOT = loại trừ, => = yêu cầu.

  • 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: copy immersive_product_page_token from a fresh search result; next_page_token requires more_stores = true
  • Tokens: copy the exact token from a fresh response; do not invent or reuse expired tokens

Ví dụ

bash
curl --get "https://api.apihop.ai/v1/google-shopping/immersive-product" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  --data-urlencode "page_token=gprod1.eyJ2IjoxLCJpZCI6IjE3NzU1Mjc3Njk1MTYyNDg5Mjg0IiwicSI6InNvbnkgd2gtMTAwMHhtNSIsImdsIjoidXMiLCJobCI6ImVuIn0"

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.

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