/v1/properties

Get all properties associated with a specific node.

More specifically, this endpoint returns the labels of the edges connected to a specific node in the Data Commons Knowledge Graph. Edges in the graph are directed, so properties can either be labels for edges towards or away from the node. Outgoing edges correspond to properties of the node. Incoming edges denote that the node is the value of this property for some other node.

Request

GET Request

http://api.datacommons.org/v1/properties/{EDGE_DIRECTION}/{NODE_DCID}?key={your_api_key}

Path Parameters

Name Description
EDGE_DIRECTION
Required
One of in or out.

If in, returns properties for which the queried node is a value. If out, returns properties that describe the queried node.
NODE_DCID
Required
DCID of the node to query.

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.

Response

The response looks like:

{
  "node": "Node DCID",
  "properties": [
    "property_name_1",
    "property_name_2",
    ...
  ]
}

Response fields

Name Type Description
node string DCID of the node queried.
properties list List of properties connected to the node queried, for the direction specified in the request.

Examples

Example 1: Get properties describing a node

Get all properties that describe the city of Chicago, IL, USA (DCID: geoId/1714000).

Request:

  $ curl --request GET --url \
  'https://api.datacommons.org/v1/properties/out/geoId/1714000'

Response:

{
  "node": "geoId/1714000",
  "properties": [
    "alternateName",
    "ansiCode",
    "archinformLocationId",
    "babelnetId",
    "brockhausEncylcopediaOnlineId",
    "censusAreaDescriptionCode",
    "censusFunctionalStatusCode",
    "containedInPlace",
    "czechNkcrAutId",
    "encyclopediaBritannicaOnlineId",
    "encyclopediaUniversalisId",
    "facebookPlacesId",
    "finlandYsoId",
    "fips553",
    "franceNationalLibraryId",
    "geoId",
    "geoJsonCoordinates",
    "geoOverlaps",
    "gettyThesaurusOfGeographicNamesId",
    "gndId",
    "gnisId",
    "granEnciclopediaCatalanaId",
    "iataAirportCode",
    "israelNationalLibraryId",
    "kmlCoordinates",
    "landArea",
    "latitude",
    "libraryOfCongressAuthorityId",
    "longitude",
    "musicbrainzAreaId",
    "name",
    "nameWithLanguage",
    "nationalDietLibraryId",
    "nearbyPlaces",
    "osmRelationId",
    "postalCode",
    "provenance",
    "quoraTopicId",
    "swedishNationalEncyclopediaId",
    "typeOf",
    "unitedKingdomParliamentThesaurusId",
    "unitedNationsLocode",
    "unitedStatesNationalArchivesIdentifier",
    "uppsalaUniversityAlvinId",
    "viafId",
    "waterArea",
    "whereOnEarthId",
    "whosOnFirstId",
    "wikidataId",
    "worldcatIdentitiesId"
  ]
}

Example 2: Get properties that have the queried node as a value

Find all properties that have carbon dioxide (DCID: CarbonDioxide) as a value.

Request:

  $ curl --request GET --url \
  'https://api.datacommons.org/v1/properties/in/CarbonDioxide?key=AIzaSyCTI4Xz-UW_G2Q2RfknhcfdAnTHq5X5XuI'

Response:

{
  "node": "CarbonDioxide",
  "properties": ["emittedThing"]
}

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