對于個(gè)人項(xiàng)目,我嘗試通過 RapidAPI 在 GO 中使用 Sky Scanner API。這是我用來執(zhí)行 API 請求的 URL:https://skyscanner-skyscanner-flight-search-v1.p.rapidapi.com/apiservices/browsequotes/v1.0/UK/GBP/en-US/SFO-sky/JFK-sky/2019-12-01?inboundpartialdate=2019-12-10問題是,我只收到以下回復(fù):{"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}]}據(jù)我所知,這不包含回程航班。我想知道是否有人有使用這個(gè)的經(jīng)驗(yàn)/知道我哪里出錯(cuò)了。
2 回答

慕尼黑8549860
TA貢獻(xiàn)1818條經(jīng)驗(yàn) 獲得超11個(gè)贊
我稍微測試了一下這個(gè) API。您必須使用“獲取瀏覽入境報(bào)價(jià)”才能檢索最便宜的航班。響應(yīng)中的鍵Quotes
包含兩個(gè)數(shù)組,這些數(shù)組中的值已經(jīng)根據(jù)我認(rèn)為的價(jià)格排序。這意味著數(shù)組中的第一個(gè)值是最便宜的航班。
嘗試嘗試更多端點(diǎn)。您肯定會得到想要的結(jié)果。此外,該 API 完全免費(fèi),對調(diào)用沒有硬性限制,因此這不會成為問題。
- 2 回答
- 0 關(guān)注
- 238 瀏覽
添加回答
舉報(bào)
0/150
提交
取消