Data Commons REST API
Overview
The Data Commons REST API is a REST library that enables developers to programmatically access data in the Data Commons knowledge graph, using HTTP. This allows you to explore the structure of the graph, integrate statistics from the graph into data analysis applications and much more.
You can use the REST API with any tool or language that supports HTTP. You can make queries on the command line (e.g. using cURL), by scripting HTTP requests in another language like Javascript, or even by entering an endpoint into your web browser!
What’s new in V2
The V2 API collapses functionality from V1 API into a smaller number of endpoints, by introducing a syntax for relation expressions, described here. Each API endpoint can also handle both single and bulk requests.
Get API keys
All access to base Data Commons using the REST APIs must be authenticated and authorized with an API key. (To send API requests to custom Data Commons instances, no API key is required.)
We provide a trial API key for general public use. This key will let you try the API and make single requests.
AIzaSyCTI4Xz-UW_G2Q2RfknhcfdAnTHq5X5XuI
The trial key is capped with a limited quota for requests. If you are planning on using our APIs more rigorously (e.g. for personal or school projects, developing applications, etc.) please request an official key without any quota limits by filling out this form. Typical turnaround times are 24-48 hours.
To use the key in requests, see the Authentication section.
Find available entities, variables, and their DCIDs
Many requests require the DCID of the entity or variable you wish to query. For tips on how to find relevant DCIDs, entities and variables, please see the Key concepts document, specifically the following sections: