Data Commons Python API

The Data Commons Python API is a Python library that enables developers to programmatically access nodes in the Data Commons knowledge graph. This package allows users to explore the structure of the graph, integrate statistics from the graph into data analysis workflows and much more. Please see the Data Commons API Overview for more details on the design and structure of the API.

Before proceeding, make sure you have followed the setup instructions below.

Getting Started

To get started using the Python API:

  • Install the API using pip.
  • Begin developing with the Python API

Installing the Python API

First, install the datacommons package through pip.

$ pip install datacommons

For more information about installing pip and setting up other parts of your Python development environment, please refer to the Python Development Environment Setup Guide for Google Cloud Platform.

Using the Python API

You are ready to go! From here you can view our tutorials on how to use the API to perform certain tasks, or see a full list of functions, classes and methods available for use in the sidebar.