For the complete documentation index, see llms.txt. This page is also available as Markdown.

比价搜索

Atlas API 比价搜索端点参考,用于检索和比较可用航班报价,支持后续报价或预订决策。

💬 需要帮助? 如果遇到问题,请在帮助中心咨询 Eva,快速获取诊断建议。

咨询 Eva

使用此 API 进行售前航线覆盖和原始价格发现。

这不是标准的预订步骤。

此 API 的功能

  • 以最大航线覆盖范围返回原始价格

  • 跳过预订规则过滤

  • 忽略供应商运营开关

  • 先检查 Atlas 缓存,然后回退到航司实时定价

请求兼容性

请求体与 search.do 完全兼容。

无需额外请求字段。

使用相同的核心字段:

  • tripTypeadultNumchildNuminfantNum

  • fromCitytoCityfromDateretDate

  • airlinescurrencyincludeMultipleFareFamily

如何读取响应

当存在结果时

API 返回 status: 0msg: "success" 和非空的 routings 数组。

routings 结构匹配 search.do

当不存在结果时

没有结果仍然返回 status: 0

这是正常的业务结果。

检查以下两者:

  • routings.length

  • noResultReason.code

不要仅依赖 status

noResultReason

routings 为空时,响应可能包含 noResultReason

它包含:

  • code — 机器可读的原因

  • message — 人类可读的详情

  • recentFlightDates — 可选的实际航班计划附近日期

原因代码

ROUTE_NOT_SUPPORTED

该航线不在 Atlas 覆盖范围内。

不要重试同一航线。

AIRLINE_NO_FLIGHT

航司未返回该航线和日期的航班信息。

检查 recentFlightDates 并使用其他支持的日期重试。

FLIGHT_SOLD_OUT

航班存在,但无可用座位。

检查 recentFlightDates 并使用其他日期重试。

PRICE_FETCH_FAILED

Atlas 无法从航司获取价格。

将此视为临时技术故障。

稍后重试。

recentFlightDates 如何工作

recentFlightDates 返回搜索日期前后最多 7 个实际计划日期。

窗口目标为前后 3 天。

如果较早日期不可用,较晚日期将填补空缺。

列表仅包含有实际航班计划的日期。

API 级别错误

status != 0 表示请求在 API 级别失败。

常见值包括:

  • 100101102 — 请求数据缺失或无效

  • 109 — 超出搜索限制

  • 110 — 超出 QPS 限制

  • 112 — 请求超时

  • 900 — 未授权

  • 9999 — 内部错误

集成指导

当你想在生产集成前评估 Atlas 航线覆盖范围时使用此 API。

当需要可预订的路径时,使用标准预订流程。

有关从搜索到出票的正常流程,请参见预订概述

Price Compare Search

post

Purpose: Search comparable fares for a route/date/airline filter. The endpoint performs synchronous smart search and is intended for fare comparison scenarios.

Dependency: No preceding function needs to be called before this API.

Important notes:

  • The returned settlement currency is determined by client configuration or the optional currency request field.

  • Total payable amount for one adult passenger is normally adultPrice + adultTax + transactionFeePerPax.

  • When supportCreditTransPayment = 1, vendorFare contains the airline/vendor-side fare. When pass-through payment is not supported, supportCreditTransPayment = 0 and vendorFare may be null or omitted.

  • ancillaryProductElements depends on client configuration and airline support.

  • links may include airline terms and conditions.

  • When status = 0 but routings is empty, check noResultReason for the business reason and possible recent available flight dates.

  • Display-currency values are for display only and should not be used for settlement, fare comparison, or accounting.

Header parameters
AcceptstringRequired

Expected response media type. Use application/json.

Example: application/json
Content-TypestringRequired

Request body media type. Use application/json.

Example: application/json
Accept-EncodingstringRequired

Enable gzip response compression when supported.

Example: gzip
x-atlas-client-idstringRequired

Atlas client ID. The server uses this value as the request customer identifier.

Example: JWC21872_api_1
x-atlas-client-secretstringRequired

Atlas client secret for authentication. Use the secret assigned to the client ID.

Example: w(s5VY8[qAT!vwcXa}DC%4O2$f5mY7sL
Body
tripTypestring · enumRequired

Trip type. 1 = one-way, 2 = round trip. retDate is required when tripType = 2.

Example: 2Possible values:
requestIdstring · nullableOptional

Client-side request identifier for tracing and troubleshooting. Optional but recommended.

Example: pc-20260222-0001
adultNuminteger · min: 1 · max: 9Required

Adult passenger count. Must be at least 1. adultNum + childNum cannot exceed 9.

Default: 0Example: 1
childNuminteger · max: 8Required

Child passenger count. adultNum + childNum cannot exceed 9.

Default: 0Example: 0
infantNuminteger · max: 9Required

Infant passenger count. Cannot exceed the adult passenger count.

Default: 0Example: 0
fromCitystringRequired

Departure city or airport IATA code in uppercase. If an airport code is supplied here, results are filtered by that airport.

Example: KUL
fromAirportstring · nullableOptional

Optional departure airport IATA code. Leave empty when fromCity already represents the desired city/airport filter.

toCitystringRequired

Arrival city or airport IATA code in uppercase. If an airport code is supplied here, results are filtered by that airport.

Example: BKI
toAirportstring · nullableOptional

Optional arrival airport IATA code. Leave empty when toCity already represents the desired city/airport filter.

fromDatestringRequired

Departure date in YYYYMMDD format.

Example: 20260222Pattern: ^\d{8}$
retDatestring · nullableOptional

Return date in YYYYMMDD format. Required for round-trip searches; use null or omit for one-way searches.

Example: 20260222Pattern: ^\d{8}$
airlinesstring[] · nullableOptional

Airline IATA code filter in uppercase. The response only contains flights operated/marketed by the specified airlines when supplied.

Example: ["OD"]
fromFlightNumbersstring[] · nullableOptional

Optional outbound flight-number filter. Use one string per candidate itinerary. For connecting flights, join segment flight numbers with a comma, e.g. OD1001,OD1002.

Example: ["OD1001"]
retFlightNumbersstring[] · nullableOptional

Optional return flight-number filter. For connecting flights, join segment flight numbers with a comma.

Example: ["OD1002"]
includeMultipleFareFamilyboolean · nullableOptional

Whether to return multiple fare families for the same flight. false returns the lowest fare per flight by default.

Default: falseExample: false
currencystring · nullableOptional

Optional settlement currency in ISO 4217 format. Use only when the client has multiple settlement currencies configured with Atlas.

Example: USD
displayCurrencystring · nullableOptional

Optional display currency in ISO 4217 format. Display-currency amounts are for presentation only and should not be used for settlement or accounting.

Example: USD
maxResponseTimeinteger · nullableOptional

Optional client-side expected maximum response time in milliseconds. Actual timeout is also controlled by Atlas configuration.

Example: 30000
baggagePieceinteger · nullableOptional

Optional requested checked baggage pieces used for filtering or pricing when supported.

Example: 1
baggageWeightinteger · nullableOptional

Optional requested checked baggage weight in kilograms used for filtering or pricing when supported.

Example: 20
requestSourcestring · nullableOptional

Traffic source label, e.g. Google Flights, Organic Search, or SkyScanner. Used for analytics and traffic governance.

Example: SkyScanner
channelstring · nullableOptional

Optional client channel label used for reporting and traffic segmentation.

Example: API
mainChannelstring · nullableOptional

Optional primary channel label used for reporting and traffic segmentation.

Example: META
subChannelIDstring · nullableOptional

Optional secondary channel identifier used for reporting and traffic segmentation.

Example: skyscanner-us
residentCodestring · nullableOptional

Optional resident discount code when an airline or market supports resident fares.

Example: MY
Responses
200

Successful HTTP response. Business success or failure is indicated by the status field in the response body.

application/json
statusintegerRequired

Business status code. 0 means success. Common non-zero values:

  • 100: Missing required request data.
  • 101: Illegal request data or invalid format.
  • 102: Illegal request parameter.
  • 105: OD is not in the client's round-trip whitelist.
  • 106: Search is not allowed for this client.
  • 107: Insufficient balance.
  • 108: Route is restricted or blocked by system limitations.
  • 109: Search limit exceeded. For price compare, this may also mean daily quota exceeded.
  • 110: Too many concurrent requests.
  • 111: Real-time search is not allowed.
  • 112: Search timed out.
  • 113: Airline is under maintenance in Atlas.
  • 114: No flights present.
  • 116: Search data was not captured.
  • 123: Too many requests but too few paid orders.
  • 124: Unsupported settlement currency.
  • 126: requestId does not exist or request is already ended.
  • 900: Unauthorized access.
  • 9999: Internal system error.
msgstring · nullableRequired

Business message. Usually success or null for successful responses; contains the error message when status is non-zero.

requestIdstring · nullableOptional

Atlas request identifier returned for tracing. May be absent when the request fails before request initialization.

Example: ATLAS-20260222-000001
clientRequestIdstring · nullableOptional

Echo of the client request identifier when provided.

Example: pc-20260222-0001
smartEndboolean · nullableOptional

Whether the smart-search process has completed for this synchronous response.

Example: true
post/priceCompareSearch.do
200

Successful HTTP response. Business success or failure is indicated by the status field in the response body.

Last updated

Was this helpful?