/v1/bulk/info/place

Get basic information about multiple places.

This API returns basic information on multiple places, given each of their DCIDs. The information provided is per place, and includes the place’s name, type (city, state, country, etc.), as well as information on all parent places that contain the place queried.

Request

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

Path Parameters

This endpoint has no path parameters.

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.
entities
Required
string DCIDs of the places to query information for.

Response

The response looks like:

{
  "data":
  [
    {
      "entity": "place_dcid_1",
      "info":
      {
        "self":
        {
          "dcid": "place_dcid_1",
          "name": "Place Name",
          "type": "City/State/Country/Etc"
        },
        "parents":
        [
          {
            "dcid": "Containing Place DCID",
            "name": "Containing Place Name",
            "type": "City/State/Country/Etc"
          }, ...
        ]
      }
    },
    {
      "entity": "place_dcid_2",
      "info": {...}
    }, ...
  ]
}

Response fields

Name Type Description
entity string DCID of the places queried.
info object Information about the place queried. Includes the name and type (city, state, country, etc.) of the place, as well as those of all “parent” places that contain the place queried (e.g. North America is a parent place of the United States).

Examples

Example 1: Get information for multiple places

Get information on the US states of California (DCID: geoId/06) and Alaska (DCID: geoId/02).

  • Request:

    $ curl --request GET --url \
    'https://api.datacommons.org/v1/bulk/info/place?entities=geoId/06&entities=geoId/06&key=AIzaSyCTI4Xz-UW_G2Q2RfknhcfdAnTHq5X5XuI'
    
  • Request:

    $ curl --request POST \
    --url https://api.datacommons.org/v1/bulk/info/place \
    --header 'X-API-Key: AIzaSyCTI4Xz-UW_G2Q2RfknhcfdAnTHq5X5XuI' \
    --data '{"entities":["geoId/06", "geoId/02"]}'
    

Response:

{
  "data":
  [
    {
      "entity": "geoId/06",
      "info":
      {
        "self":
        {
          "dcid": "geoId/06",
          "name": "California",
          "type": "State"
        },
        "parents":
        [
          {
            "dcid": "usc/PacificDivision",
            "name": "Pacific Division",
            "type": "CensusDivision"
          },
          {
            "dcid": "country/USA",
            "name": "United States",
            "type": "Country"
          },
          {
            "dcid": "usc/WestRegion",
            "name": "West Region"
          },
          {
            "dcid": "northamerica",
            "name": "North America",
            "type": "Continent"
          },
          {
            "dcid": "Earth",
            "name": "Earth",
            "type": "Place"
          }
        ]
      }
    },
    {
      "entity": "geoId/02",
      "info":
      {
        "self":
        {
          "dcid": "geoId/02",
          "name": "Alaska",
          "type": "State"
        },
        "parents":
        [
          {
            "dcid": "usc/PacificDivision",
            "name": "Pacific Division",
            "type": "CensusDivision"
          },
          {
            "dcid": "country/USA",
            "name": "United States",
            "type": "Country"
          },
          {
            "dcid": "usc/WestRegion",
            "name": "West Region"
          },
          {
            "dcid": "northamerica",
            "name": "North America",
            "type": "Continent"
          },
          {
            "dcid": "Earth",
            "name": "Earth",
            "type": "Place"
          }
        ]
      }
    }
  ]
}