Retrieve places contained within another place
Given a list of parent
Country, etc.), return a list of child places
contained within the specified DCIDs. Only returns children whose place type matches
General information about this endpoint
dcids: A list of (parent)
Placenodes, identified by their DCIDs.
placeType: The type of the contained (child)
Placenodes to filter by. For example,
Countyare contained within
State. For a full list of available types, see the Data Commons graph browser entry for
Assembling the information you will need to use this formula
This endpoint requires the argument
dcids. DCIDs are unique node identifiers defined by Data Commons. Your query will need to specify the DCIDs for the parent places of interest.
This endpoint also requires the argument
placeType, specifying the type of the child places you desire in the response.
Before trying this method out, make sure to follow the setup directions in the main section for Sheets docs.
Example 1: Retrieve a list of the counties in Delaware.
Example 2: Retrieve a list of congressional districts in Alaska and Hawaii.
If you pass a bad DCID value, you will see a reference error appear:
Likewise, if you pass a nonexistent place type, you will also see a reference error appear:
If you pass an empty DCID, an error will appear: