export async function call ( latitude, longitude, authKey ) {
const baseUrl = "https://api.pro6pp.nl" ;
const encodedUrl = new URL( ` ${baseUrl} /v2/reverse/global` );
const queryParams = { latitude : latitude, longitude : longitude, authKey : authKey }
encodedUrl.search = new URLSearchParams(queryParams)
return await fetch(encodedUrl).catch( ( error ) => {
throw new Error (error);
});
}
call( "52.37175" , "4.89826" , "YOUR_API_KEY" )
.then( ( response ) => {
console .log(response.status);
return response.json();
})
.then( ( res ) => {
console .log(res);
});
import requests
def call ( latitude, longitude, auth_key ):
url = f"https://api.pro6pp.nl/v2/reverse/global?latitude= {latitude} &longitude= {longitude} &authKey= {auth_key} "
try :
response = requests.get(url)
return response
except requests.exceptions.RequestException as e:
raise e
response = call( "52.37175" , "4.89826" , "YOUR_API_KEY" )
print (response.status_code)
print (response.json())