Closed matthiaszimmermann closed 1 month ago
curl respones for schedules call
curl -X GET https://api.flightstats.com/flex/schedules/rest/v1/json/flight/BA/285/departing/2024/10/14\?appId\=96875f77\&appKey\=
curl response for ratings call
curl -X GET https://api.flightstats.com/flex/ratings/rest/v1/json/flight/BA/285\?appId\=96875f77\&appKey\=
server log (1x BA 285 2024-10-15, 1x BA 285 2024-10-14):
{"level":"debug","message":"[PLnt8UsNTPS4DHWrAhHxp] fetching flight status for BA 285 2024-10-15","timestamp":"2024-10-16 08:01:30"} {"level":"debug","message":"proxy request ==> GET https://api.flightstats.com/flex/schedules/rest/v1/json/flight/BA/285/departing/2024/10/15?appId=96875f77&appKey=dc097f38175fd39620c72b94fc79be05","reqId":"PLnt8UsNTPS4DHWrAhHxp","timestamp":"2024-10-16 08:01:30"} {"level":"debug","message":"proxy response <== 200","proxyRequestDuration":420,"reqId":"PLnt8UsNTPS4DHWrAhHxp","timestamp":"2024-10-16 08:01:30"} GET /api/flightstats/schedule/BA/285/2024-10-15 200 in 453ms {"level":"debug","message":"[blme95zN-0TwA6yn4qDGU] fetching quote for BA 285","timestamp":"2024-10-16 08:01:31"} {"level":"debug","message":"proxy request ==> GET https://api.flightstats.com/flex/ratings/rest/v1/json/flight/BA/285?appId=96875f77&appKey=dc097f38175fd39620c72b94fc79be05","reqId":"blme95zN-0TwA6yn4qDGU","timestamp":"2024-10-16 08:01:31"} {"level":"debug","message":"proxy response <== 200","proxyRequestDuration":123,"reqId":"blme95zN-0TwA6yn4qDGU","timestamp":"2024-10-16 08:01:31"} {"level":"info","message":"[blme95zN-0TwA6yn4qDGU] Ratings:ontime 38, observations: 61, late15 8, late30 3, late45 9, cancelled 3, diverted 0 ontimepercent 0.623","timestamp":"2024-10-16 08:01:31"} {"level":"debug","message":"[blme95zN-0TwA6yn4qDGU] calling calculatePayoutAmounts 15000000","timestamp":"2024-10-16 08:01:31"} {"level":"info","message":"calculatePayoutAmounts => 89507, 0,0,50275397,83792329,83792329, 83792329","timestamp":"2024-10-16 08:01:31"} GET /api/quote/BA/285 200 in 356ms
{"level":"debug","message":"[Xd6P4JWwbPA8W5-MPRZ2x] fetching flight status for BA 285 2024-10-14","timestamp":"2024-10-16 08:01:42"} {"level":"debug","message":"proxy request ==> GET https://api.flightstats.com/flex/schedules/rest/v1/json/flight/BA/285/departing/2024/10/14?appId=96875f77&appKey=dc097f38175fd39620c72b94fc79be05","reqId":"Xd6P4JWwbPA8W5-MPRZ2x","timestamp":"2024-10-16 08:01:42"} {"level":"debug","message":"proxy response <== 200","proxyRequestDuration":372,"reqId":"Xd6P4JWwbPA8W5-MPRZ2x","timestamp":"2024-10-16 08:01:43"} GET /api/flightstats/schedule/BA/285/2024-10-14 200 in 463ms
potentially anoter such flight is KL843 on 2024-11-12
Flightstats provides no rating data for KL843 and therefor we cannot calculate a quote.
going to switch error text in this case to make it more clear.
What happened?
observation: no option to buy a policy for BA 285 2024-10-14 (BA 285 2024-10-15 works) expectation: should be possible to buy a policy
initial analysis: flightstats api seems to return schedule and ratings information (see curl commands below). somehow the webapp is not picking this up?
curl -X GET https://api.flightstats.com/flex/schedules/rest/v1/json/flight/BA/285/departing/2024/10/14\?appId\=96875f77\&appKey\=
curl -X GET https://api.flightstats.com/flex/ratings/rest/v1/json/flight/BA/285\?appId\=96875f77\&appKey\=
What operating system are you seeing the problem on?
Mac OS
What browsers are you seeing the problem on?
Brave
What wallet extension are you using?
Metamask
Rules