parsing json from 3rd API not working

The function supposed to change a text value in a text using a 3rd service API for flights.
The problem is… nothing happanss and it seem like the json not working…
Anyone knows why?
My final goal is to put the results in texts in another page but I try to test it first to my page.
export function searchButton_click(event, $w) {

fetch(‘https://api.skypicker.com/flights?v=3&sort=price&locale=en&partner=picky&flyFrom=IST&to=AYT&dateFrom=03/02/2018&dateTo=03/02/2018&typeFlight=oneway&adults=1&curr=EUR’, {method: ‘get’})
.then(response => response.json())
.then(json => $w(“#text21”).text = json.search_results_json.data[0].mapIdFrom.toString());

The website: www.flilu.com

Eilon,

please try to use console.log() to log anything you are not sure with its value, just during your testing.
then please also try in your click function to simply do:
$w(“#text21”).text = ‘hello’
does it work? it will give you the direction of how to proceed

Shlomi

Have you tried to use json.data[0].mapIdFrom and alwa yspast ein any returning json here, it is way easier to see.

Thanks its working!

Thanks for sharing, and good luck wix-coding!