Help

Re: update longitude and latitude

1172 0
cancel
Showing results for 
Search instead for 
Did you mean: 
Tarik_TALEB
4 - Data Explorer
4 - Data Explorer

hello everyone, sorry if my english is not very good, i will try to explain my problem to you.
I would like to retrieve the longitude and latitude through a script on airtable using an api but i dont know how to do it, can you help me please i am really stuck.
thank you

12 Replies 12
Tarik_TALEB
4 - Data Explorer
4 - Data Explorer

Hello, I have tried with another API.
here is the code:

fetch(“https://ip-geolocation-ipwhois-io.p.rapidapi.com/json/”, {

"method": "GET",

"headers": {

    "x-rapidapi-key": "c7bd31779emshe2f681be6a371a4p111f02jsn3cbcfa506bae",

    "x-rapidapi-host": "ip-geolocation-ipwhois-io.p.rapidapi.com"

}

})

.then(response => {

console.log(response);

})

.catch(err => {

console.error(err);

});

the problem is that airtable returns nothing to me

Works fine for me. The problem is not Airtable - it’s your code. You need to do something to show the response from the API call.

image

output.markdown('# Rapid API Example');

let host      = "ip-geolocation-ipwhois-io.p.rapidapi.com"; 
let accessKey = "c7bd31779emshe2f681be6a371a4p111f02jsn3cbcfa506bae";
let url       = "https://ip-geolocation-ipwhois-io.p.rapidapi.com/json/";

let options   = {
    "method": "GET",
    "headers": {
        "x-rapidapi-key": accessKey,
        "x-rapidapi-host":host
    }
}

await fetch(url, options)
    .then((resp) => resp.json())
    .then(function(data) {
        output.inspect(data);
    })
    .catch(function(e) {
        output.markdown(e.message);
    });
Tarik_TALEB
4 - Data Explorer
4 - Data Explorer

Thanks for your help