Synthesis API usage

Hi all!
I am trying to gather synthesis reactions from the MP API, but I’m struggling a bit to understand how the data are organized, and how to retrieve them.

For instance, let’s say I’m interested in gathering all the reactions (plus synthesis procedures and synth type) whose precursors contain Nb.

  • How should I phrase my query?
  • How to add other filtering criteria, like one can do on Materials Project - Synthesis Explorer ?
  • How can I navigate the retrieved docs?
  • Is there any structural information on the materials involved in each reaction?
  • Is there some kind of tutorial or documentation beyond Synthesis Explorer - Materials Project Documentation ? It seems not to contain much info on how to use the synthesis API, but this might just be my limited Python literacy.
with MPRester(api_key=key) as mpr:
    docs = mpr.synthesis. ?

Thank you!

Hi @acarnevali,

You should be able to pull what you need with the search method. Any criteria you can provide to the synthesis explorer app, you can also provide to the method. For example, recipes with a precursor of Nb:

with MPRester(api_key=key) as mpr:
    docs = mpr.synthesis.search(precursor_formula="Nb")

Below is an example document from the above query to show what is available:

MPDataDoc<SynthesisSearchResultModel>(
doi='10.1016/j.scriptamat.2007.07.038',
paragraph_string='Commercial powders of niobium (99%, -200 mesh), aluminum (99%, -300 mesh) and graphite (99%, -200 ...',
synthesis_type=<SynthesisTypeEnum.solid_state: 'solid-state'>,
reaction_string='1 Al + 1 C + 2 Nb == 1 Nb2AlC',
reaction=ReactionFormula(left_side=[FormulaPart(amount='1', material='Al'), FormulaPart(amount='1', material='C'), FormulaPart(amount='2', material='Nb')], right_side=[FormulaPart(amount='1', material='Nb2AlC')], element_substitution=None),
target=ExtractedMaterial(material_string='Nb2AlC', material_formula='Nb2AlC', material_name='', phase=None, is_acronym=False, composition=[Component(formula='Nb2AlC', amount='1', elements={'Nb': '2', 'Al': '1', 'C': '1'})], amounts_vars={}, elements_vars={}, additives=[], oxygen_deficiency='None'),
targets_formula=['Nb2 Al1 C1'],
targets_formula_s=['Nb2AlC'],
precursors_formula_s=['Al', 'C', 'Nb'],
precursors=[ExtractedMaterial(material_string='Al', material_formula='Al', material_name='', phase=None, is_acronym=False, composition=[Component(formula='Al', amount='1', elements={'Al': '1'})], amounts_vars={}, elements_vars={}, additives=[], oxygen_deficiency='None'), ExtractedMaterial(material_string='C', material_formula='C', material_name='', phase=None, is_acronym=False, composition=[Component(formula='C', amount='1', elements={'C': '1'})], amounts_vars={}, elements_vars={}, additives=[], oxygen_deficiency='None'), ExtractedMaterial(material_string='Nb', material_formula='Nb', material_name='', phase=None, is_acronym=False, composition=[Component(formula='Nb', amount='1', elements={'Nb': '1'})], amounts_vars={}, elements_vars={}, additives=[], oxygen_deficiency='None')],
operations=[Operation(type=<OperationTypeEnum.mixing: 'MixingOperation'>, token='mixed', conditions=Conditions(heating_temperature=[], heating_time=[], heating_atmosphere=[], mixing_device=None, mixing_media='resin')), Operation(type=<OperationTypeEnum.mixing: 'MixingOperation'>, token='milled', conditions=Conditions(heating_temperature=[], heating_time=[Value(min_value=24.0, max_value=24.0, values=[24.0], units='h')], heating_atmosphere=[], mixing_device=None, mixing_media=None)), Operation(type=<OperationTypeEnum.shaping: 'ShapingOperation'>, token='pressed', conditions=Conditions(heating_temperature=[], heating_time=[], heating_atmosphere=[], mixing_device=None, mixing_media=None)), Operation(type=<OperationTypeEnum.heating: 'HeatingOperation'>, token='heated', conditions=Conditions(heating_temperature=[Value(min_value=1600.0, max_value=1600.0, values=[1600.0], units='°C')], heating_time=[], heating_atmosphere=['Ar', 'Ar'], mixing_device=None, mixing_media=None)), Operation(type=<OperationTypeEnum.heating: 'HeatingOperation'>, token='held', conditions=Conditions(heating_temperature=[Value(min_value=1600.0, max_value=1600.0, values=[1600.0], units='°C')], heating_time=[Value(min_value=60.0, max_value=60.0, values=[60.0], units='min')], heating_atmosphere=[], mixing_device=None, mixing_media=None))],
fields_not_requested=['precursors_formula', 'search_score', 'highlights']
)

– Jason