API Hop

เอกสาร

เอกสาร API Hop

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

ค้นหาเที่ยวบิน คำแนะนำสนามบิน และข้อเสนอบน Google Flights

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

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

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

ค้นหาเที่ยวบิน คำแนะนำสนามบิน และข้อเสนอบน Google Flights

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

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

http
Authorization: Bearer YOUR_API_KEY

Google Flights: ค้นหาเที่ยวบิน

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

พารามิเตอร์

ฟิลด์ชนิดข้อจำกัดตัวอย่าง
departure_idstringรหัสสนามบินหรือเมืองต้นทาง (departure_id); departure_id: optional; ^(?:[A-Z]{3}|/[mg]/[A-Za-z0-9_]+)(?:,(?:[A-Z]{3}|/[mg]/[A-Za-z0-9_]+))*$JFK
arrival_idstringรหัสสนามบิน เมือง หรือพื้นที่ปลายทาง (arrival_id); arrival_id: optional; ^(?:[A-Z]{3}|/[mg]/[A-Za-z0-9_]+)(?:,(?:[A-Z]{3}|/[mg]/[A-Za-z0-9_]+))*$LAX
outbound_datestringวันเดินทาง (YYYY-MM-DD) หรือช่วงวันที่ที่รองรับ (outbound_date); outbound_date: optional; ^[0-9]{4}-[0-9]{2}-[0-9]{2}$2026-12-12
return_datestringวันเดินทาง (YYYY-MM-DD) หรือช่วงวันที่ที่รองรับ (return_date); return_date: optional; ^[0-9]{4}-[0-9]{2}-[0-9]{2}$-
adultsintegerจำนวนผู้ใหญ่ (adults); adults: optional; min: 1; max: 91
childrenintegerจำนวนเด็ก (children); children: optional; min: 0; max: 80
infants_in_seatintegerจำนวนทารก (infants_in_seat); infants_in_seat: optional; min: 0; max: 80
infants_on_lapintegerจำนวนทารกนั่งตัก (infants_on_lap); infants_on_lap: optional; min: 0; max: 80
travel_classstringชั้นโดยสาร (travel_class); travel_class: optional; economy, premium_economy, business, firsteconomy
sort_bystringการเรียง; sort_by: optional; top_flights, price, departure_time, arrival_time, duration, emissionstop_flights
stopsintegerตัวกรองเที่ยวบินหรือจุดหมาย (stops); stops: optional; min: 0; max: 30
include_airlinesstringตัวกรองสายการบินหรือพันธมิตร (include_airlines); include_airlines: optional; UTF-8 bytes: 1000; ^(?:[A-Z][A-Z0-9]|[0-9][A-Z]|STAR_ALLIANCE|SKYTEAM|ONEWORLD)(?:,(?:[A-Z][A-Z0-9]|[0-9][A-Z]|STAR_ALLIANCE|SKYTEAM|ONEWORLD))*$-
exclude_airlinesstringตัวกรองสายการบินหรือพันธมิตร (exclude_airlines); exclude_airlines: optional; UTF-8 bytes: 1000; ^(?:[A-Z][A-Z0-9]|[0-9][A-Z]|STAR_ALLIANCE|SKYTEAM|ONEWORLD)(?:,(?:[A-Z][A-Z0-9]|[0-9][A-Z]|STAR_ALLIANCE|SKYTEAM|ONEWORLD))*$-
bagsintegerตัวกรองเที่ยวบินหรือจุดหมาย (bags); bags: optional; min: 0; max: 90
max_priceintegerราคาสูงสุด (max_price); max_price: optional; min: 1; max: 21474836471
outbound_timesstringตัวกรองเที่ยวบินหรือจุดหมาย (outbound_times); outbound_times: optional; UTF-8 bytes: 11; ^(?:[0-9]|1[0-9]|2[0-3])(?:,(?:[0-9]|1[0-9]|2[0-3])){1,3}$-
return_timesstringตัวกรองเที่ยวบินหรือจุดหมาย (return_times); return_times: optional; UTF-8 bytes: 11; ^(?:[0-9]|1[0-9]|2[0-3])(?:,(?:[0-9]|1[0-9]|2[0-3])){1,3}$-
emissionsintegerตัวกรองเที่ยวบินหรือจุดหมาย (emissions); emissions: optional; 11
exclude_connsstringตัวกรองเที่ยวบินหรือจุดหมาย (exclude_conns); exclude_conns: optional; UTF-8 bytes: 1000; ^[A-Z]{3}(?:,[A-Z]{3})*$-
max_durationintegerตัวกรองระยะเวลาเดินทาง (max_duration); max_duration: optional; min: 1; max: 21474836471
show_hiddenbooleanตัวกรองเที่ยวบินหรือจุดหมาย (show_hidden); show_hidden: optionaltrue
exclude_basicbooleanตัวกรองเที่ยวบินหรือจุดหมาย (exclude_basic); exclude_basic: optionaltrue
typeintegerตัวกรองเที่ยวบินหรือจุดหมาย (type); type: optional; 1, 2, 31
multi_city_jsonstringแผนการเดินทาง JSON (multi_city_json); multi_city_json: optional; UTF-8 bytes: 16384-
layover_durationstringตัวกรองระยะเวลาเดินทาง (layover_duration); layover_duration: optional; UTF-8 bytes: 21; ^[0-9]{1,10},[0-9]{1,10}$-
selected_flights_jsonstringแผนการเดินทาง JSON (selected_flights_json); selected_flights_json: optional; UTF-8 bytes: 16384-
departure_tokenstringโทเค็นเลือกจากคำตอบล่าสุด (departure_token); departure_token: optional; UTF-8 bytes: 32768-
booking_tokenstringโทเค็นเลือกจากคำตอบล่าสุด (booking_token); booking_token: optional; UTF-8 bytes: 32768-
deep_searchbooleanตัวกรองเที่ยวบินหรือจุดหมาย (deep_search); deep_search: optionaltrue
currencystringรหัสสกุลเงิน (currency); currency: optional; ALL, DZD, ARS, AMD, AWG, AUD, AZN, BSD, BHD, BYN, BMD, BAM, BRL, GBP, BGN, XPF, CAD, CLP, CNY, COP, CRC, CUP, CZK, DKK, DOP, EGP, EUR, GEL, HKD, HUF, ISK, INR, IDR, IRR, ILS, JMD, JPY, JOD, KZT, KWD, LBP, MKD, MYR, MXN, MDL, MAD, TWD, NZD, NOK, OMR, PKR, PAB, PEN, PHP, PLN, QAR, RON, RUB, SAR, RSD, SGD, ZAR, KRW, SEK, CHF, THB, TRY, USD, UAH, AED, VND; ^[A-Z]{3}$USD
countrystringรหัสประเทศหรือร้านค้า (country); country: optional; ^[A-Za-z]{2}$-
languagestringภาษา; language: optional-
limitintegerจำนวนผลลัพธ์สูงสุด; limit: optional; min: 1; max: 1001
devicestringอุปกรณ์; device: optional; desktop, mobile, tabletdesktop
zero_tracebooleanไม่เก็บถาวรคำตอบ; zero_trace: optionaltrue

การตรวจสอบ

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

  • 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})?$/
  • adults (default 1) + children + infants_in_seat + infants_on_lap <= 9; infants_on_lap <= adults
  • bags <= adults + children + infants_in_seat
  • departure_id AND arrival_id AND outbound_date: required unless selected_flights_json OR multi_city_json supplies the itinerary
  • Dates: valid YYYY-MM-DD; return_date >= outbound_date; type = 1 requires return_date; type = 2 excludes return_date; type = 3 requires multi_city_json
  • multi_city_json: JSON array of 2..5 ordered legs with departure_id, arrival_id, date and optional times
  • selected_flights_json: native JSON object of outbound flight segments and optional return segments; each segment has flight_number, departure_id, arrival_id, date; the data service validates the segment structure
  • NOT (departure_token AND booking_token); tokens require original itinerary parameters
  • outbound_times, return_times: 2 OR 4 hours (0..23); layover_duration: ordered min,max minutes
  • exclude_basic = true => country = us (default) AND travel_class = economy (default)
  • Tokens: copy the exact token from a fresh response; do not invent or reuse expired tokens; each page or token lookup is a separate billable successful request

ตัวอย่าง

bash
curl --get "https://api.apihop.ai/v1/google-flights/search" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  --data-urlencode "arrival_id=LAX" \
  --data-urlencode "currency=USD" \
  --data-urlencode "departure_id=JFK" \
  --data-urlencode "outbound_date=2026-12-12"

Google Flights: ดูคำแนะนำสนามบิน

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

พารามิเตอร์

ฟิลด์ชนิดข้อจำกัดตัวอย่าง
querystringคำค้น; query: REQUIREDNew York
countrystringรหัสประเทศหรือร้านค้า (country); country: optional; ^[A-Za-z]{2}$-
languagestringภาษา; language: optional-
limitintegerจำนวนผลลัพธ์สูงสุด; limit: optional; min: 1; max: 1001
devicestringอุปกรณ์; device: optional; desktop, mobile, tabletdesktop
zero_tracebooleanไม่เก็บถาวรคำตอบ; zero_trace: optionaltrue
exclude_regionsbooleanตัวกรองเที่ยวบินหรือจุดหมาย (exclude_regions); exclude_regions: optionaltrue

การตรวจสอบ

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

  • 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-flights/autocomplete" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  --data-urlencode "query=New York"

Google Flights: ค้นหาข้อเสนอเที่ยวบิน

GET https://api.apihop.ai/v1/google-flights/deals

พารามิเตอร์

ฟิลด์ชนิดข้อจำกัดตัวอย่าง
querystringคำค้น; query: optionalWeek long trip to a city with great food
departure_idstringรหัสสนามบินหรือเมืองต้นทาง (departure_id); departure_id: REQUIRED; ^(?:[A-Z]{3}&#124;/[mg]/[A-Za-z0-9_]+)(?:,(?:[A-Z]{3}&#124;/[mg]/[A-Za-z0-9_]+))*$JFK
adultsintegerจำนวนผู้ใหญ่ (adults); adults: optional; min: 1; max: 91
outbound_datestringวันเดินทาง (YYYY-MM-DD) หรือช่วงวันที่ที่รองรับ (outbound_date); outbound_date: optional; UTF-8 bytes: 21-
return_datestringวันเดินทาง (YYYY-MM-DD) หรือช่วงวันที่ที่รองรับ (return_date); return_date: optional; UTF-8 bytes: 21-
travel_durationintegerตัวกรองระยะเวลาเดินทาง (travel_duration); travel_duration: optional; min: 1; max: 31
trip_lengthstringตัวกรองระยะเวลาเดินทาง (trip_length); trip_length: optional; UTF-8 bytes: 21; ^[0-9]{1,10}(?:,[0-9]{1,10})?$-
childrenintegerจำนวนเด็ก (children); children: optional; min: 0; max: 80
infants_in_seatintegerจำนวนทารก (infants_in_seat); infants_in_seat: optional; min: 0; max: 80
infants_on_lapintegerจำนวนทารกนั่งตัก (infants_on_lap); infants_on_lap: optional; min: 0; max: 80
travel_classstringชั้นโดยสาร (travel_class); travel_class: optional; economy, premium_economy, business, firsteconomy
typeintegerตัวกรองเที่ยวบินหรือจุดหมาย (type); type: optional; 1, 21
stopsintegerตัวกรองเที่ยวบินหรือจุดหมาย (stops); stops: optional; min: 0; max: 30
include_airlinesstringตัวกรองสายการบินหรือพันธมิตร (include_airlines); include_airlines: optional; UTF-8 bytes: 1000; ^(?:[A-Z][A-Z0-9]&#124;[0-9][A-Z]&#124;STAR_ALLIANCE&#124;SKYTEAM&#124;ONEWORLD)(?:,(?:[A-Z][A-Z0-9]&#124;[0-9][A-Z]&#124;STAR_ALLIANCE&#124;SKYTEAM&#124;ONEWORLD))*$-
exclude_airlinesstringตัวกรองสายการบินหรือพันธมิตร (exclude_airlines); exclude_airlines: optional; UTF-8 bytes: 1000; ^(?:[A-Z][A-Z0-9]&#124;[0-9][A-Z]&#124;STAR_ALLIANCE&#124;SKYTEAM&#124;ONEWORLD)(?:,(?:[A-Z][A-Z0-9]&#124;[0-9][A-Z]&#124;STAR_ALLIANCE&#124;SKYTEAM&#124;ONEWORLD))*$-
max_priceintegerราคาสูงสุด (max_price); max_price: optional; min: 1; max: 21474836471
max_durationintegerตัวกรองระยะเวลาเดินทาง (max_duration); max_duration: optional; min: 1; max: 21474836471
currencystringรหัสสกุลเงิน (currency); currency: optional; ALL, DZD, ARS, AMD, AWG, AUD, AZN, BSD, BHD, BYN, BMD, BAM, BRL, GBP, BGN, XPF, CAD, CLP, CNY, COP, CRC, CUP, CZK, DKK, DOP, EGP, EUR, GEL, HKD, HUF, ISK, INR, IDR, IRR, ILS, JMD, JPY, JOD, KZT, KWD, LBP, MKD, MYR, MXN, MDL, MAD, TWD, NZD, NOK, OMR, PKR, PAB, PEN, PHP, PLN, QAR, RON, RUB, SAR, RSD, SGD, ZAR, KRW, SEK, CHF, THB, TRY, USD, UAH, AED, VND; ^[A-Z]{3}$ALL
countrystringรหัสประเทศหรือร้านค้า (country); country: optional; ^[A-Za-z]{2}$-
languagestringภาษา; language: optional-
limitintegerจำนวนผลลัพธ์สูงสุด; limit: optional; min: 1; max: 10010
devicestringอุปกรณ์; device: optional; desktop, mobile, tabletdesktop
zero_tracebooleanไม่เก็บถาวรคำตอบ; zero_trace: optionaltrue

การตรวจสอบ

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

  • 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})?$/
  • adults (default 1) + children + infants_in_seat + infants_on_lap <= 9; infants_on_lap <= adults
  • outbound_date, return_date: valid YYYY-MM-DD or ordered YYYY-MM-DD,YYYY-MM-DD window; return dates cannot precede departure dates
  • type = 2 => NOT return_date; flexible return windows require flexible departure windows
  • travel_duration: flexible round-trip duration; cannot combine with exact dates
  • trip_length: positive days or ordered min,max; requires flexible departure dates; query => NOT travel_duration

ตัวอย่าง

bash
curl --get "https://api.apihop.ai/v1/google-flights/deals" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  --data-urlencode "departure_id=JFK" \
  --data-urlencode "limit=10" \
  --data-urlencode "query=Week long trip to a city with great food"

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

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

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