对于一个个人项目,我正在尝试使用Sky Scanner API,在GO中,通过RapidAPI。下面是我用来执行API请求的URL:
问题是,我只收到以下响应:
{"Quotes":[{"QuoteId":1,"MinPrice":403.0,"Direct":true,"OutboundLeg":{"CarrierIds":[851],"OriginId":81727,"DestinationId":60987,"DepartureDate":"2019-12-01T00:00:00"},"QuoteDateTime":"2019-11-29T14:24:00"}],"Places":[{"PlaceId":60987,"IataCode":"JFK","Name":"New York John F. Kennedy","Type":"Station","SkyscannerCode":"JFK","CityName":"New York","CityId":"NYCA","CountryName":"United States"},{"PlaceId":81727,"IataCode":"SFO","Name":"San Francisco International","Type":"Station","SkyscannerCode":"SFO","CityName":"San Francisco","CityId":"SFOA","CountryName":"United States"}],"Carriers":[{"CarrierId":851,"Name":"Alaska Airlines"},{"CarrierId":870,"Name":"jetBlue"},{"CarrierId":1065,"Name":"Frontier Airlines"},{"CarrierId":1721,"Name":"Sun Country Airlines"}],"Currencies":[{"Code":"GBP","Symbol":"£","ThousandsSeparator":",","DecimalSeparator":".","SymbolOnLeft":true,"SpaceBetweenAmountAndSymbol":false,"RoundingCoefficient":0,"DecimalDigits":2}]}据我所知,这不包括返程航班。
我想知道是否有人有使用这个的经验/知道我哪里错了。
谢谢!
发布于 2020-02-04 20:28:25
您需要使用RapidApi的浏览报价入站终结点。
发布于 2021-09-08 09:39:30
我稍微测试了一下这个API。您必须使用GET Browse Quotes Inbound才能检索最便宜的航班。响应中的Quotes键包含两个数组,数组中的值已经根据我相信的价格进行了排序。这意味着数组中的第一个值是最便宜的。
尝试使用更多的端点。你一定会得到想要的结果。此外,这个API是完全免费的,没有对调用的硬限制,所以这不是问题。
https://stackoverflow.com/questions/59107714
复制相似问题