/v1/bulk/variables

Get all variables with data associated with a specific entity, for multiple entities.

Request

https://api.datacommons.org/v1/bulk/variables?entities={entity_dcid_1}&entities={entity_dcid_2}&key={your_api_key}
URL: https://api.datacommons.org/v1/bulk/variables Header: X-API-Key: {your_api_key} JSON Data: { "entities": [ "{entity_dcid_1}", "{entity_dcid_2}", ... ] }

Path Parameters

There are no path parameters for this endpoint.

Query Parameters

Name Type Description
key
Required
string Your API key. See the page on authentication for a demo key, as well as instructions on how to get your own key.
variables
Required
list List of variables associated with the entity queried.

Response

The response looks like:

{
  "data":
  [
    {
      "entity": "entity_dcid_1",
      "variables":
      [
        "variable_dcid_1",
        "variable_dcid_2",
        ...
      ]
    },
    {
      "entity": "entity_dcid_2",
      "variables":
      [
        "variable_dcid_1",
        "variable_dcid_2",
        ...
      ], ...
    }
  ]
}

Response fields

Name Type Description
entity string DCID of the entity queried.
variables list List of variables connected to the entity queried.

Examples

Example 1: Get variables associated with multiple entities.

Get variables for the cities of Tokyo, Japan (DCID: wikidataId/Q1490) and Seoul, South Korea (DCID: wikidataId/Q8684).

  • Request:

    $ curl --request GET --url \
    'https://api.datacommons.org/v1/bulk/variables?entities=wikidataId/Q1490&entities=wikidataId/Q8684&key=AIzaSyCTI4Xz-UW_G2Q2RfknhcfdAnTHq5X5XuI'
    
  • Request:

    $ curl --request POST \
    --url https://api.datacommons.org/v1/bulk/variables \
    --header 'X-API-Key: AIzaSyCTI4Xz-UW_G2Q2RfknhcfdAnTHq5X5XuI' \
    --data '{"entities":["wikidataId/Q1490", "wikidataId/Q8684"]}'
    

Response:

{
  "data":
  [
    {
      "entity": "wikidataId/Q1490",
      "variables":
      [
        "Count_CycloneEvent",
        "Count_CycloneEvent_TropicalStorm",
        "Count_Person",
        < ... output truncated for brevity ... >
        "Min_Rainfall",
        "Min_Snowfall",
        "Min_Temperature"
      ]
    },
    {
      "entity": "wikidataId/Q8684",
      "variables":
      [
        "Count_Death",
        "Count_Death_10To14Years_Female",
        "Count_Death_10To14Years_Male",
        < ... output truncated for brevity ...>
        "dc/sw43w4pbtgq4d",
        "dc/x73k9t2mzzcs2",
        "dc/xh9d9e2le1r41"
      ]
    }
  ]
}

Page last updated: December 17, 2024 • Send feedback about this page