FR24 OpenAPI
  1. API 参考
FR24 OpenAPI
  • FR24_API_V2.0
    • 指南
      • API调用流程
      • 介绍
      • 附录
      • 错误码
    • API 参考
      • OrderChangeInforming 订单信息变更通知
      • shopping 航班搜索接口
        POST
      • pricing 校验接口
        POST
      • booking 生单接口
        POST
      • ticketing 申请出票接口
        POST
      • orderDetail 订单详情接口
        POST
      • presaleAncillaryShopping 售前辅营搜索接口
        POST
      • postsaleAncillaryShopping 售后行李搜索接口
        POST
      • seatMap 机型图接口
        POST
      • ancillaryBooking 辅营生单接口
        POST
      • ancillaryPurchase 辅营支付接口
        POST
      • ancillaryOrderDetail 辅营订单详情
        POST
      • changeReshop 改期搜索接口
        POST
      • reissueRequest 改期申请接口
        POST
      • refundRequest 退票申请接口
        POST
      • refundConfirming 退票确认接口
        POST
      • voidRequest 废票提交接口
        POST
      • fileUpload 文件上传
        POST
      • selectBalance 余额查询接口
        POST
    • 关于我们
      • API 能力
      • 商务合作
      • 门户网站
  1. API 参考

shopping 航班搜索接口

POST
/api/new/shopping.do
通过Shopping接口,查询可用航班信息。支持单程、往返程、缺口程线路查询。

请求参数

Header 参数
Accept-Encoding
string 
必需
使用gzip压缩格式
默认值:
gzip, deflate, br
content-Type
string 
响应格式
必需
默认值:
application/json
appKey
string 
用户账户
必需
默认值:
{{appKey}}
Body 参数application/json
authentication
object 
用户认证信息
必需
sign
string 
签名
必需
appkey + appsecret + timestamp加密后的字符串,加密见附录
timestamp
string 
使用 unix 时间戳
必需
单位:秒
searchLegs
array[object (搜索航段信息) {5}] 
搜索航段信息
必需
最多支持6段行程查询
>= 1 items<= 6 items
origin
string 
起飞城市
必需
使用IATA城市标准三字代码
>= 3 字符<= 3 字符
typeO
enum<string> 
对于origin类型限制
可选
枚举值:
airportcodeairportgroup
destination
string 
到达城市
必需
使用IATA城市标准三字代码
>= 3 字符<= 3 字符
typeD
enum<string> 
对于destination类型限制
可选
枚举值:
airportcodeairportgroup
depDate
string <date>
起飞日期
必需
格式:YYYY-MM-DD
>= 10 字符<= 10 字符
正则匹配:
^\d{4}-\d{2}-\d{2}$
adultNum
integer 
成人乘客人数
必需
成人、儿童和婴儿人数总和不能超过9
>= 1<= 9
默认值:
0
childNum
integer 
儿童乘客人数
可选
一成人最多带两个儿童或婴儿
>= 0<= 9
默认值:
0
infantNum
integer 
婴儿乘客人数
可选
一成人最多带两个儿童或婴儿
>= 0<= 9
默认值:
0
preferences
object 
搜索偏好
必需
可以设置首选项以获得过滤后的结果
preferredCarrier
array[string]
航空公司偏好过滤条目,必填航空公司 IATA 2 字符代码
可选
支持多承运航司过滤
prohibitedCarrier
array[string]
航空公司偏好过滤条目,非必填航空公司 IATA 2 字符代码
可选
支持多承运航司过滤
stops
integer 
可选
0- 仅直飞航班,1- 最多 1 次转机,2- 最多 2 次转机,依此类推
>= 0
cabin
enum<string> 
舱位偏好
可选
如果您选择不设置,则默认为经济舱。
>= 0 字符<= 1 字符
枚举值:
FCPY
默认值:
Y
seriesTraceId
string 
上一个业务请求接口返回的traceId
可选
此字段为开发者选项,FR24通过此traceId追踪并分析合作商的上一个调用接口,方便双方在出现问题时能够快速追踪整条链路
seriesRsTime
number 
上一个业务请求接口,从请求该接口到获取结果的时长
可选
单位为ms;此字段为开发者选项,FR24通过该时长分析合作商的网络延迟情况,以提升双方的数据质量。
示例
{
    "authentication": {
        "sign": "{{sign}}",
        "timestamp": "{{timestamp}}"
    },
    "searchLegs": [
        {
            "typeO": "airportgroup",
            "origin": "SIN",
            "typeD": "airportcode",
            "destination": "HKG",
            "depDate": "2025-11-15"
        }
    ],
    "adultNum": 2,
    "childNum": 0,
    "infantNum": 0,
    "preferences": {
        "cabin": "Y",
        "preferredCarrier": [
            "AB"
        ],
        "prohibitedCarrier": [
            "CD"
        ],
        "stops": 0
    }
}

示例代码

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://flight-test.flightroutes24.com/api/new/shopping.do' \
--header 'Accept-Encoding;' \
--header 'appKey;' \
--header 'content-Type: application/json' \
--data-raw '{
    "authentication": {
        "sign": "",
        "timestamp": ""
    },
    "searchLegs": [
        {
            "typeO": "airportgroup",
            "origin": "SIN",
            "typeD": "airportcode",
            "destination": "HKG",
            "depDate": "2025-11-15"
        }
    ],
    "adultNum": 2,
    "childNum": 0,
    "infantNum": 0,
    "preferences": {
        "cabin": "Y",
        "preferredCarrier": [
            "AB"
        ],
        "prohibitedCarrier": [
            "CD"
        ],
        "stops": 0
    }
}'

返回响应

🟢200OK
application/json
Body
traceId
string 
追溯码
必需
code
string 
状态码
必需
000000 代表成功,其他代表失败
message
string 
状态说明
必需
processingTime
number 
处理时长
必需
单位:ms
>= 0
data
object 
返回的所有数据
必需
当code非000000时,内容为空
offers
array [object {16}] 
报价信息
必需
包含了直飞和中转所有的报价组合
legs
array[object (行程信息) {2}] 
行程信息
必需
包含了所有航班组合
segments
array [object {16}] 
航段信息
必需
包含了所有不重复的航班信息
示例
{
    "traceId": "queryFlight_NEWAPI250117113553863087",
    "code": "000000",
    "message": "成功",
    "processingTime": 1717,
    "data": {
        "offers": [
            {
                "offerId": "18599004604928000",
                "legId": "1ebb56358b1c617a18a597543feceb77",
                "currency": "CNY",
                "platingCarrier": "CX",
                "pricePerPax": [
                    {
                        "paxType": "ADT",
                        "baseFare": 581,
                        "totalTax": 493,
                        "taxBreakdown": [],
                        "serviceFee": 10000
                    }
                ],
                "cabin": [
                    "Y"
                ],
                "fareBasis": [
                    "QR21SGAO"
                ],
                "availability": [
                    "9"
                ],
                "extraInfo": {
                    "freeBaggageAllowance": [
                        {
                            "segmentId": "4453068fd343a3eb89b823fc48cc2cd9",
                            "cabinBagPc": "1-e-e",
                            "cabinBagSize": "e-e-e",
                            "cabinBagWeight": "7-e-e",
                            "checkedBagPc": "1-e-e",
                            "checkedBagSize": "e-e-e",
                            "checkedBagWeight": "e-e-e"
                        }
                    ]
                },
                "eligibilityFlag": false,
                "eligibilityDetail": null,
                "rules": {
                    "refund": [
                        {
                            "paxType": "ADT",
                            "couponStatus": 0,
                            "refundPolicy": "withCondition",
                            "applicableTime": [
                                null,
                                0
                            ],
                            "fullRefundAP": null,
                            "refundFee": 1539
                        },
                        {
                            "paxType": "ADT",
                            "couponStatus": 0,
                            "refundPolicy": "notAllowed",
                            "applicableTime": [
                                0,
                                null
                            ],
                            "fullRefundAP": null,
                            "refundFee": null
                        }
                    ],
                    "change": [
                        {
                            "paxType": "ADT",
                            "couponStatus": 0,
                            "changePolicy": "withCondition",
                            "applicableTime": [
                                null,
                                0
                            ],
                            "changeFee": 513
                        },
                        {
                            "paxType": "ADT",
                            "couponStatus": 0,
                            "changePolicy": "notAllowed",
                            "applicableTime": [
                                0,
                                null
                            ],
                            "changeFee": null
                        }
                    ]
                },
                "productType": null,
                "productTag": {
                    "ticketPromise": null,
                    "refuseDeadline": null,
                    "ticketingTime": null,
                    "reschedulePendingTime": null,
                    "voluntaryRefundTime": null,
                    "involuntaryRefundTime": null,
                    "refundCondition": null,
                    "reissueCondition": null,
                    "voidingCondition": false,
                    "voluntaryServiceStandard": null,
                    "involuntaryServiceStandard": null,
                    "rescheduleProcessingTime": null,
                    "productSupplier": null,
                    "RBDChangedRisk": false,
                    "fareBrand": [
                        ""
                    ],
                    "posArea": [
                        null
                    ]
                },
                "productSource": "OTH",
                "RBD": [
                    "Q"
                ]
            },
            {
                "offerId": "18599004604928001",
                "legId": "d983cf575abe2d3ffad742382ab681db",
                "currency": "CNY",
                "platingCarrier": "CX",
                "pricePerPax": [
                    {
                        "paxType": "ADT",
                        "baseFare": 581,
                        "totalTax": 493,
                        "taxBreakdown": [],
                        "serviceFee": 10000
                    }
                ],
                "cabin": [
  
修改于 2025-06-12 09:36:24
上一页
OrderChangeInforming 订单信息变更通知
下一页
pricing 校验接口
Built with