DAHITI-API Documentation

This is the new BETA version of the DAHITI-API which is still in testing phase.
If you have any problems or questions using the DAHITI-API do not hesitate to contact the DAHITI-Team.

The DAHITI-API allows users to access the data holding of DAHITI directly from user-defined scripts. Users can access the DAHITI-API using their favorite programming language. The principle is based on sending POST/GET requests to the DAHITI server. The server response will be in JSON format which is language independent. In the following, the implemented functions of the DAHITI-API are explained in detail with additional code examples (e.g. Python).

List Targets

List selected targets from the DAHITI data holding

DAHITI-API arguments

Argument Value Description
username¹ e.g. 'username' Username to login on the DAHITI website
password¹ e.g. 'password' Password to login on the DAHITI website
action¹ 'list-targets' Action of the request
continent e.g. 'Asia' Name of continent
country e.g. 'de' Name of country using TLD
basin e.g. 'Amazon' Name of basin
min_lon e.g. '50.0' Minimum longitude of location
max_lon e.g. '60.0' Maximum longitude of location
min_lat e.g. '10.0' Minimum latitude of location
max_lat e.g. '20.0' Maximum latitude of location

¹ required


Code examples


JSON response from DAHITI server

[
	{
		"id": "254",
		"target_name": "Aberdeen, Lake",
		"location": null,
		"longitude": "-98.8248",
		"latitude": "64.5122"
	},
	{
		"id": "85",
		"target_name": "Albert, Lake",
		"location": null,
		"longitude": "30.9210",
		"latitude": "1.6807"
	}, 
	... ,
	{
		"id": "77",
		"target_name": "lonZaysan, Lake",
		"location": null,
		"longitude": "83.8751",
		"latitude": "48.0230",
	},
	{
		"id": "1452",
		"target_name": "Ziway, Lake",
		"location": null,
		"longitude": "38.9314",
		"latitude": "8.0183",
	}
]

Target Info

Get information of selected DAHITI target

DAHITI-API arguments

Argument Value Description
username¹ e.g. 'username' Username to login on the DAHITI website
password¹ e.g. 'password' Password to login on the DAHITI website
action¹ 'target-info' Action of the request
dahiti_id¹ e.g. '85' DAHITI ID

¹ required


Code examples


JSON response from DAHITI server

{
	"id": "85",
	"target_name": "Albert, Lake",
	"location": null,
	"continent": "Africa",	
	"country": "cd"
}

Download

Download of a DAHITI water level time series

DAHITI-API arguments

Argument Value Description
username¹ e.g. 'username' Username to login on the DAHITI website
password¹ e.g. 'password' Password to login on the DAHITI website
action¹ 'download' Action of the request
dahiti_id¹ e.g. '85' DAHITI ID

¹ required


Code examples


JSON response from DAHITI server

[
	{
		"date": "2002-07-10", 
		"height": "621.865805356",
		"error": "0.00852911370459"
	}, {
		"date": "2002-07-12",
		"height": "621.759336127",
		"error": "0.00658466206974"
	},
	...,
	{
		"date": "2012-02-14",
		"height": "621.775600198",
		"error": "0.00847845033871"
	}, {
		"date": "2012-03-01",
		"height": "621.635141686",
		"error": "0.00797208380305"
	}
]