layout | title | nav_order |
---|---|---|
default |
How to use Data Commons |
1 |
Data Commons offers many different ways to consume its data:
- Interact with the website, datacommons.org
- Learn about the data sources
- Query the base data directly, interactively and programmatically
- Embed data visualizations in your own site
- Download data in CSV format, for offline analysis
There are also several options for providing new data to Data Commons:
- Contribute data to the base Data Commons
- Host your own data site using Data Commons' web framework
For quick analysis, use the search query bar on the home page or use any of the visualization tools, such as the Timeline, Scatter, and Map explorers.
To find out what data is available in Data Commons, see the Data sources pages, and check out the Statistical Variable Explorer.
There are several options for directly querying the data, without accessing the datacommons.org website, both interactive and programmatic:
-
APIs: Data Commons publishes REST, Python, Pandas, and SPARQL APIs. These APIs support both low-level exploration of the knowledge graph as well as higher-level statistical analysis of data. You can call them from any application that supports REST protocols.
The Python/ and Pandas APIs provide convenient wrappers, that you can call programatically or interactively, for example, from a Python virtual environment shell or from Google Colab. We have developed a set of Google Colab tutorials to help you get started with analysis.
Data Commons also provides ideal training data for developing machine learning models and other data science applications. We have developed a Data science curriculum featuring the Python APIs and data, currently in use at MIT.
-
Google Sheets Add-on: You can load Data Commons data into Google Sheets for analysis and charting, using a familiar spreadsheet interface. Install and run the Data Commons Google Sheets add-on.
-
BigQuery: If you want to issue SQL queries, and you have a Google Cloud Platform account, you can use BigQuery Studio on Data Commons data in Analytics Hub. See the Data Commons in BigQuery page for more details.
Data Commons provides a Web components API that makes it a snap to embed various chart elements in your own site, such as scatter plots, maps, pie charts, and many more, using the base Data Commons data.
Data Commons provides tools for downloading its data in CSV format. To preview and download for selected places and statistical variables:
- Use the standalone Data Download Tool
- Click the Download link in any of the results pages of the visualization tools.
We are always looking to expand the data available from the base Data Commons site, datacommons.org. If you are interested in contributing data, please fill out this form.
If you would like to leverage Data Commons' analytical and visualization tools, and natural-language query interface for your own data and website, we provide a reference website implementation you can customize to meet your needs. See Build your own Data Commons for details.
We also welcome code, documentation, and educational contributions to the Data Commons open-source project. See Contribute to Data Commons for the myriad ways you can help improve Data Commons!