Documentation of DAHITI-API (Version 2) - "get-target-info"
DAHITI-API arguments
Argument Value Description
api_key ---' DAHITI API-Key
(Where can I get the API key?)
dahiti_id e.g. '8814' DAHITI ID
API-Request URL
https://dahiti.dgfi.tum.de/api/v2/get-target-info/
JSON response from DAHITI server
{
	'code': 200,
	'message': 'Request successful!',
	'data': {
		'id': 8814,
		'target_name': 'Richland Chambers, Reservoir',
		'location': None,
		'country': 'us',
		'continent': 'North America',
		'longitude': -96.181,
		'latitude': 31.9766,
		'type': 'Reservoir'
	},
 
}
API-Request Examples:

Python request using POST method:

import requests
import json
import pprint

url = "https://dahiti.dgfi.tum.de/api/v2/get-target-info/"

args = {}
args['api_key'] = '### ADD HERE API_KEY ###'
args['dahiti_id'] = 8814

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/get-target-info/"

args = {}
args['api_key'] = '### ADD HERE API_KEY ###'
args['dahiti_id'] = 8814

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=8814" -X POST https://dahiti.dgfi.tum.de/api/v2/get-target-info/
			

CURL request using GET method:

curl -X GET "https://dahiti.dgfi.tum.de/api/v2/get-target-info/?api_key=### ADD HERE API_KEY ###&dahiti_id=8814"