/v1/variables
Get all variables with data associated with a specific entity.
Request
GET Request
http://api.datacommons.org/v1/variables/{ENTITY_DCID}?key={your_api_key}
Path Parameters
Name | Description |
---|---|
ENTITY_DCID |
DCID of the entity to query. |
Query Parameters
Name | Type | Description |
---|---|---|
key |
string | Your API key. See the page on authentication for a demo key, as well as instructions on how to get your own key. |
Response
The response looks like:
{
"entity": "Entity DCID",
"variables": [
"variable_dcid_1",
"variable_dcid_2",
...
]
}
Response fields
Name | Type | Description |
---|---|---|
entity | string | DCID of the entity queried. |
variables | list | List of variables associated with the entity queried. |
Examples
Example 1: Get variables for an entity
Get all properties that describe the city of Hagåtña, the capital of Guam. (DCID: wikidataId/Q30988
).
Request:
$ curl --request GET --url \
'https://api.datacommons.org/v1/variables/wikidataId/Q30988'
Response:
{
"entity": "wikidataId/Q30988",
"variables": [
"Count_Person",
"Max_Rainfall",
"Max_Snowfall",
"Max_Temperature",
"Mean_BarometricPressure",
"Mean_Rainfall",
"Mean_Snowfall",
"Mean_Temperature",
"Mean_Visibility",
"Min_Rainfall",
"Min_Snowfall",
"Min_Temperature"
]
}