About extracting formation_energy_per_atom value

I am trying to get the formation_energy_per_atom value for number of materials. I am using the following code to that:
with MPRester(API_KEY) as mpr:
# Get the computed entry for the specified material ID
entry = mpr.get_entry_by_material_id(“mp-30594”)
# Access the formation energy per atom from the entry
formation_energy_per_atom = entry.formation_energy_per_atom
But the I failed to get that. It seems mpr.get_entry_by_material_id does not have have the required value. But when I print the entry I can see it inside other attributes. Any help will be appreciated.

Hello, @Chowdhury_Mohammad_A . Sorry, what 's the meaning of ‘But when I print the entry I can see it inside other attributes.’ In other word, what does ’inside other attributes‘ refer to ?

@Chowdhury_Mohammad_A you probably want to use mpr.summary.search(). See our docs and examples. Also, you can use the search function in this forum to find existing posts with similar questions.

mp-569794-R2SCAN ComputedStructureEntry - Ta30 (Ta)
Energy (Uncorrected) = -1457.7550 eV (-48.5918 eV/atom)
Correction = 0.0000 eV (0.0000 eV/atom)
Energy (Final) = -1457.7550 eV (-48.5918 eV/atom)
Energy Adjustments:
potcar_spec = [{‘titel’: ‘PAW_PBE Ta_pv 07Sep2000’, ‘hash’: ‘50b7a319a0d36d25f6cbf5b4ca27227c’}]
is_hubbard = False
hubbards = {}
run_type = R2SCAN
oxide_type = None
aspherical = True
last_updated = 2021-07-24 19:41:03.303000
task_id = mp-2739259
material_id = mp-569794
oxidation_states = {}
run_type = R2SCAN
formation_energy_per_atom = 0.0
Here, I have the formation_energy_per_atom but could not extract it using form=form_ene[0].formation_energy_per_atom. Though I could extract energy_per_atom. Later I used print(dir(form_ene[0])) to see whether it is inside but I could not find formation_energy_per_atom. Later I used the string search and could find that out. I didnot face any problem for energy_per_atom.

I actually want to batch download fromation_energy_per_atom for my project. I have a list of mp-ids. How can I do that using summary.search() ? I could not understand that watching the link you provided.