Argument | Value | Description |
api_key | ---' | DAHITI API-Key (Where can I get the API key?) |
dahiti_id | e.g. '8813' | DAHITI ID |
https://dahiti.dgfi.tum.de/api/v2/download-water-level-hypsometry/
{
'code': 200,
'message': 'Request successful!'
'target': {
'id': '8813',
'target_name': 'Tawakoni, Lake',
'location': None,
'country': 'United States of America',
'continent': 'North America',
'longitude': -95.9748,
'latitude': 32.8696,
'points': 259,
'software': '8.0',
'download': '2024-02-02 15:28:17',
},
'data': [
{
'date': '1982-11-15',
'height': 132.997,
'error': 0.104
},{
'date': '1982-12-17',
'height': 133.674,
'error': 0.125
}, ... ,{
'date': '2019-05-13',
'height': 133.614,
'error': 0.683
},{
'date': '2019-06-14',
'height': 133.391,
'error': 0.634
}
]
}
import requests
import json
import pprint
url = "https://dahiti.dgfi.tum.de/api/v2/download-water-level-hypsometry/"
args = {}
args['api_key'] = '### ADD HERE API_KEY ###'
args['dahiti_id'] = 8813
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/download-water-level-hypsometry/"
args = {}
args['api_key'] = '### ADD HERE API_KEY ###'
args['dahiti_id'] = 8813
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 ###&dahiti_id=8813" -X POST https://dahiti.dgfi.tum.de/api/v2/download-water-level-hypsometry/
curl -X GET "https://dahiti.dgfi.tum.de/api/v2/download-water-level-hypsometry/?api_key=### ADD HERE API_KEY ###&dahiti_id=8813"