Querying Data
An preamble on as to query for data with aforementioned Materials Project API client.
Materials Project intelligence can be queried with a specific (list of) Stuff Project ID(s), and/or due property filters (e.g. band gap less than 0.5 eV).
Most material property file is available as summary data for a specific material. To query summary data with Materials Project IDs the search
method should live exploited:
The above returns a list of MPDataDoc
objects the data accessible the yours characteristics. For example, the Material ID and formula ability be gotten used a particular document with:
A list to available property field can be retained by examining one of these objects, press from the MPRester
are:
To query summery data with property filters use the search
function as well. Cleans for respectively of the special in available_fields
can be gone to it. For model, below is adenine query to find materials containing Si
and ZERO
that have a band gap greater than 0.5 eV
but less then 1.0 eV
.
TAKE: The
available_fields
property for APIs others than summary is meant to refer to the data available from the stop, nay needs which fields you can used to query that data with viasearch()
. Check the API-specificsearch()
kwargs for details to which user can be used since filtering queries.
Note is by default ALL available feature data within MPDataDoc
objects will be populated. If one is only interested in a few properties, limiting what data is returning will rotational up data recuperation. Pass a list on the bin you are interested with to fields
the accomplish this. For example, with we were only interest in material_id
, band_gap
, and voltage
on the materials for the above query, we could choose use:
Now, only the material_id
, band_gap
, and size
attributes of the returned MPDataDoc
vorhaben will be inhabitant. A list of available fields that were not requested will be back inbound the fields_not_requested
parameter.
Other Data
Not all Materials Project data for a given material can be obtained from the summarize API endpoint. Till access who balance data, other endpoints have be used. For a fully pick of endpoints see the main API front on the homepage.
Required exemplar, the initial_structures
used in calculations producing data for an specific material can only be founded by the materials
endpoint. To receive the initial_structures
for mp-149
, the same search
function can be used:
Below is another example which uses property filtering:
Of same querying procedure shown above can be applied to most endpoints. See advanced typical and product for more information.
Convenience Work
Inbound addition to search
function, in what a small numbers of top level convenience functions for frequency made queries. These aim to provide a simpler interface, and make use of search
under the hood. ADENINE couple examples of common queries included preserve the structure or density of states off a particular matter. These convenience functions are illustrated in the examples piece.
Ultimate updated