/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.
For a rich, graphical exploration of places available in the Data Commons knowledge graph, take a look at the Place Explorer.
To get information on a variable instead of a place, see /v1/bulk/info/variable.
For querying a single variable and a simpler output, see the simple version of this endpoint.
Request
https://api.datacommons.org/v1/bulk/info/place?nodes={place_dcid_1}&nodes={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:
{
"nodes": [
"{place_dcid_1}",
"{place_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 places to query information for. |
Response
The response looks like:
{
"data":
[
{
"node": "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"
}, ...
]
}
},
{
"node": "place_dcid_2",
"info": {...}
}, ...
]
}
Response fields
Name | Type | Description |
---|---|---|
node | 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?nodes=geoId/06&nodes=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 '{"nodes":["geoId/06", "geoId/02"]}'
Response:
{
"data":
[
{
"node": "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"
}
]
}
},
{
"node": "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"
}
]
}
}
]
}
Page last updated: December 17, 2024 • Send feedback about this page