Query and Download Contributed Data
How to download contributed data from the Materials Project (MP) website/database.
Last updated
Was this helpful?
How to download contributed data from the Materials Project (MP) website/database.
Last updated
Was this helpful?
Under Construction. We are working on enabling CSV/JSON download buttons for entire projects or specific queries. The downloads will also function as versioned snapshots for each project.
Querying MPContribs data programmatically involves the following steps:
Install the python package .
Initialize the client with your API key and a project
Check client.available_query_params()
for available query parameters
Build up a query dictionary
Decide which fields to retrieve
Run client.query_contributions()
Here's an example for the carrier_transport
dataset:
By default, paginate
is False
which will only retrieve the first page of results and should be used to test the query
, fields
and sort
parameters before paginating through all results.
If entire projects or large subsets of contributed data are downloaded for later use, it is often more efficient to use the client.download_contributions()
function. It also takes a query
as argument and downloads all results as json.gz
files behind the scenes. Only locally missing data is downloaded when download_contributions
is run and contributions are loaded from disk. This function always retrieves all fields included in the data
component, so the fields
argument is not available/needed. Additional components (i.e. structures
, tables
, and attachments
) can be included in the downloads through the include
argument: