Argument | Value | Description |
api_key | ---' | DAHITI API-Key (Where can I get the API key?) |
basin | e.g. 'Amazon' | Name of basin (optional) |
country | e.g. 'de' | Name of country (optional) |
continent | e.g. 'Asia' | Name of Continent (optional) |
min_lon | e.g. '-100.0' | Minimum longitude (optional) |
max_lon | e.g. '-90.0' | Maximum longitude (optional) |
min_lat | e.g. '30.0' | Minimum latitude (optional) |
max_lat | e.g. '40.0' | Maximum latitude (optional) |
https://dahiti.dgfi.tum.de/api/v2/list-targets/
{
'code': 200,
'message': 'Request successful!'
'data': [
{
'dahiti_id': 13152,
'target_name': 'Aquilla, Lake',
'location': None,
'continent': 'North America',
'country': 'United States of America',
'longitude': -97.2015,
'latitude': 31.909,
'type': 'Reservoir',
'data_access': {
'bathymetry': None,
'discharge': None,
'hypsometry': None,
'land_water_mask': 'public',
'surface_area': 'public',
'volume_variation': None,
'water_level_altimetry': None,
'water_level_hypsometry': None,
'water_occurrence_mask': 'public'
},
}, ... , {
'dahiti_id': 35920,
'target_name': 'Yocona, River',
'location': None,
'longitude': -90.0675,
'continent': 'North America',
'country': 'United States of America',
'latitude': 34.1714,
'type': 'River',
'data_access': {
'bathymetry': None,
'discharge': None,
'hypsometry': None,
'land_water_mask': None,
'surface_area': None,
'volume_variation': None,
'water_level_altimetry': 'public',
'water_level_hypsometry': None,
'water_occurrence_mask': None
}.
},
]
}
import requests
import json
import pprint
url = "https://dahiti.dgfi.tum.de/api/v2/list-targets/"
args = {}
args['api_key'] = '### ADD HERE API_KEY ###'
args['format'] = 'json'
#~ args['basin'] = 'Amazon'
#~ args['country'] = 'de'
#~ args['continent'] = 'Ocean'
args['min_lon'] = -100.0
args['max_lon'] = -90.0
args['min_lat'] = 30.0
args['max_lat'] = 40.0
response = requests.post(url, json=args)
if response.status_code == 200:
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/download-water-level/"
args = {}
args['api_key'] = '### ADD HERE API_KEY ###'
#~ args['basin'] = 'Amazon'
#~ args['country'] = 'de'
#~ args['continent'] = 'Asia'
#~ args['continent'] = 'Ocean'
args['min_lon'] = -100.0
args['max_lon'] = -90.0
args['min_lat'] = 30.0
args['max_lat'] = 40.0
response = requests.get(url,params=args)
if response.status_code == 200:
data = json.loads(response.text)
pprint.pprint(data)
else:
print (response.text)
print (response.status_code)
curl --data "api_key=### ADD HERE API_KEY ###&min_lon=-100.0&max_lon=-90.0&min_lat=30.0&max_lat=40.0" -X POST https://dahiti.dgfi.tum.de/api/v2/download-water-level/
curl -X GET "https://dahiti.dgfi.tum.de/api/v2/download-water-level/?api_key=### ADD HERE API_KEY ###&min_lon=-100.0&max_lon=-90.0&min_lat=30.0&max_lat=40.0"