Scores Data
This API endpoint allows you to get the Climate Variable Scores of a Assets.
API Endpoint
[POST] https://api.intensel.net/apiv2/project_scores_data/
Request Arguments
Argument | Type | Description |
---|---|---|
project_name | string | The name of the project. |
analysis_type | string | The type of the analysis. RCP or SSP. |
variables | list | The list of variables. |
scenarios | list | The list of scenarios. |
years | list | The list of years. |
Available Scenarios and Years
Analysis Type | Scenarios | Years |
---|---|---|
RCP | 0.0, 2.6, 4.5, 8.5 | 2020, 2030, 2050 |
SSP | 0.0, 2.6, 4.5, 8.5 | 2020, 2030, 2050, 2100 |
Request Example
- Python
- JavaScript
- cURL
import requests
URL = "https://api.intensel.net/apiv2/project_scores_data/"
headers = {
'X-Intensel-Api-Key': 'YOUR_API_KEY',
}
payload = {"project_name": "My Awesome Project", "analysis_type": "RCP", "variables": ["rainfall_flood", "river_flood"],
"scenarios": ["0.0", "2.6", "4.5", "8.5"], "years": ["2020", "2030", "2050"]}
response = requests.post(URL, json=payload, headers=headers)
data = response.json()
print(data)
const axios = require('axios');
const URL = "https://api.intensel.net/apiv2/project_scores_data/";
const headers = {
'X-Intensel-Api-Key': 'YOUR_API_KEY',
};
const payload = {"project_name": "My Awesome Project", "analysis_type": "RCP", "variables": ["rainfall_flood", "river_flood"],
"scenarios": ["0.0", "2.6", "4.5", "8.5"], "years": ["2020", "2030", "2050"]};
axios.post(URL, payload, {headers: headers}).then((response) => {
console.log(response.data);
});
curl -X POST "https://api.intensel.net/apiv2/project_scores_data/" -H "accept: application/json" -H "X-Intensel-Api-Key: YOUR_API_KEY" -H "Content-Type: application/json" -d "{\"project_name\":\"My Awesome Project\",\"analysis_type\":\"RCP\",\"variables\":[\"rainfall_flood\",\"river_flood\"] ,\"scenarios\":[\"0.0\", \"2.6\", \"4.5\", \"8.5\"],\"years\":[\"2020\", \"2030\", \"2050\"]}"
Response Schema
{
"requested_variables" : string[],
"analysis_type": string,
"asset_names": string[],
"data": [
{
"name": string,
"latitude": float,
"longitude": float,
"score_data": {
"$hazard_variable": {
"meta_data": {
"units": string
},
"results": {
"$return_period_year": float,
...
}
},
...
}
},
...
]
}
Response Schema Description
$
prefix to key means that the key is a dynamic value.
string[]
means an array of strings.
float
means a floating point number.
string
means a string.
$hazard_variable
is the name of the hazard variable.
$return_period_year
is the return period year of the hazard variable.
...
means that the object can contain more data.
Output in Specific Format
The output of the API can be in a specific format. The format can be specified by the output
argument in the request payload.
Example API URL
[POST] https://api.intensel.net/apiv2/project_scores_data/?output=csv
Available formats:
json
(default)csv
(comma separated values)excel
(xlsx)html
(html table)
Example Response
Scores Data Response JSON -> view response