Documentation of DAHITI-API (Version 2) - "download-surface-area"
DAHITI-API arguments
Argument Value Description
api_key ---' DAHITI API-Key
(Where can I get the API key?)
dahiti_id e.g. '8813' DAHITI ID
API-Request URL
https://dahiti.dgfi.tum.de/api/v2/download-surface-area/
JSON response from DAHITI server
{
	'code': 200,
	'message': 'Request successful!'
	'target' : {
		'id': '8814',
		'target_name': 'Richland Chambers, Reservoir',
		'location': None,
		'country': 'United States of America',	
		'continent': 'North America',
		'longitude': -96.181,
		'latitude': 31.9766,	
		'points': 449,
		'software': '1.20',
		'download': '2024-02-02 14:40:14',
	},
	'data': [
		{
			'date': '1989-06-03',
			'area': 131.31,			
			'error': 8.74
		},{
			'date': '1989-06-19'
			'area': 138.67,
			'error': 20.68
		},{
			'date': '1989-07-05',
			'area': 146.56,
			'error': 2.92
		}, ... , {
			'date': '2019-05-05',
			'area': 170.3,
			'error': 4.54
		},{
			'date': '2019-05-13',
			'area': 170.89,
			'error': 5.24
		},{
			'date': '2019-06-06', 
			'area': 169.72,
			'error': 2.35
		}
	]
}
API-Request Examples:

Python request using POST method:

import requests
import json
import pprint

url = "https://dahiti.dgfi.tum.de/api/v2/download-surface-area/"

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)				
				

Python request using GET method:

import requests
import json
import pprint

url = "https://dahiti.dgfi.tum.de/api/v2/download-surface-area/"

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 request using POST method:

curl --data "api_key=### ADD HERE API_KEY ###&dahiti_id=8813" -X POST https://dahiti.dgfi.tum.de/api/v2/download-surface-area/
			

CURL request using GET method:

curl -X GET "https://dahiti.dgfi.tum.de/api/v2/download-surface-area/?api_key=### ADD HERE API_KEY ###&dahiti_id=8813"