Argument | Value | Description |
api_key | ---' | DAHITI API-Key (Where can I get the API key?) |
longitude | e.g. '11.1352717' | Longitude |
lattude | e.g. '49.6355231' | Latitude |
https://dahiti.dgfi.tum.de/api/v2/get-nearest-target/
{
'code': 200,
'message': 'Request successful!',
'data': {
'id': 1446,
'target_name': 'Main-Danube Canal'
'location': 'Bamberg',
'continent': 'Europe',
'country': 'Germany',
'longitude': 10.8978,
'latitude': 49.8839,
'distance': 32.4612,
},
}
import requests
import json
import pprint
url = "https://dahiti.dgfi.tum.de/api/v2/get-nearest-target/"
args = {}
args['api_key'] = '### ADD HERE API_KEY ###'
args['longitude'] = 11.1352717
args['latitude'] = 49.6355231
response = requests.post(url, json=args)
if response.status_code == 200:
''' convert json string in python list '''
data = json.loads(response.text)
pprint.pprint(data)
else:
print (response.text)
print (response.status_code)
import requests
import json
import pprint
url = "https://dahiti.dgfi.tum.de/api/v2/get-nearest-target/"
args = {}
args['api_key'] = '### ADD HERE API_KEY ###'
args['longitude'] = 11.1352717
args['latitude'] = 49.6355231
response = requests.get(url,params=args)
if response.status_code == 200:
''' convert json string in python list '''
data = json.loads(response.text)
pprint.pprint(data)
else:
print (response.text)
print (response.status_code)
curl --data "api_key=### ADD HERE API_KEY ###&longitude=11.1352717&latitude=49.6355231" -X POST https://dahiti.dgfi.tum.de/api/v2/get-nearest-target/
curl -X GET "https://dahiti.dgfi.tum.de/api/v2/get-nearest-target/?api_key=### ADD HERE API_KEY ###&longitude=11.1352717&latitude=49.6355231"