/v1/bulk/info/variable-group
Get basic information about multiple variable groups.
This API returns basic information on muliple variable groups, given the variable groups’ DCIDs. The information is provided per variable group, and includes the display name, a list of child variables with their information, a list of child variable groups with their information and the number of descendent variables. If variable groups DCIDs are not provided, then all the variable group information will be retrieved.
Variable group is used in the statistical variable hierarchy UI widget as shown in Statistical Variable Explorer.
For querying a single variable group and a simpler output, see the simple version of this endpoint.
Request
https://api.datacommons.org/v1/bulk/info/variable-group?nodes={variable_group_dcid_1}&nodes={variable_group_dcid_2}&key={your_api_key}
URL:
https://api.datacommons.org/v1/bulk/info/variable-group
Header:
X-API-Key: {your_api_key}
JSON Data:
```json
{
"nodes":
[
"{variable_group_dcid_1}",
"{variable_group_dcid_2}",
...
]
}
```
Path Parameters
This endpoint has no path parameters.
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. |
nodes |
string | DCIDs of the variable groups to query information for. |
constrained_entities |
Repeated string | DCIDs of entities to filter by. If provided, the results will be filtered to only include the queried variable group’s descendent variables that have data for the queried entities. |
Response
The response looks like:
{
"data":
[
{
"node": "dcid1",
"info": {
"absoluteName": "variable group name",
"childStatVars": [
{
"id": "variable_id",
"displayName": "variable_name",
"searchNames": [
"search name"
],
"definition": "variable_definition",
"hasData": true
},
...
],
"childStatVarGroups": [
{
"id": "child_variable_group_id",
"specializedEntity": "property name",
"displayName": "variable_name",
"descendentStatVarCount": 20
},
...
],
"descendentStatVarCount": 100,
"parentStatVarGroups": [
"parent_group_id"
]
}
},
{
"node": "dcid2",
"info": {...}
},
...
]
}
Response fields
Name | Type | Description |
---|---|---|
node | string | DCID of the variable group queried. |
info | object | Information about the variable group queried. Includes child variables and variable group information, number of descendent variables and all the parent variable groups. |
Examples
Example 1: Get information for all variable groups in Data Commons
Request:
$ curl --request GET --url \
'https://api.datacommons.org/v1/bulk/info/variable-group?key=AIzaSyCTI4Xz-UW_G2Q2RfknhcfdAnTHq5X5XuI'
Response:
{
"data": [
{
"node": "dc/g/Person_Gender-Female",
"info": {
"absoluteName": "Person With Gender = Female",
"childStatVars": [
{
"id": "LifeExpectancy_Person_Female",
"displayName": "Life expectancy at birth, female (years)",
"searchNames": [
"Life Expectancy of Person With Gender is Female"
],
"definition": "mp=lifeExpectancy,pt=Person,gender=Female",
"hasData": true
},
...
],
"childStatVarGroups": [
{
"id": "dc/g/Person_ActivityDuration_Gender-Female",
"specializedEntity": "Activity Duration",
"displayName": "Person With Activity Duration, Gender = Female",
"descendentStatVarCount": 101
},
...
],
"descendentStatVarCount": 8949,
"parentStatVarGroups": [
"dc/g/Person_Gender"
]
}
}
...
]
}
Page last updated: December 17, 2024 • Send feedback about this page