Using the API to obtain the lattice parameter of entries from a query

How would I use the API to submit a query that obtains the lattice parameters of entries from said query and input them into a dataframe?

Hi @J0chin, while the API does not have the capability to filter on individual lattice parameters, what I recommend is to pull all of the structures, filter, and construct the DataFrame locally. You can pull all of the structure data with MPRester.materials.search passing fields=["structure"].

– Jason

1 Like

Yes, but when I just pull the structure as a column in the df, I get a column with a lot of characters that looks like:

(‘structure’, Structure Summary
Lattice
abc : 3.44648958 5.91809299 11.43413371
angles : 90.0 90.0 90.0
volume : 233.21797558148117
A : 3.44648958 0.0 0.0
B : 0.0 5.91809299 0.0
C : 0.0 -0.0 11.43413371
PeriodicSite: Y (0.0000, 2.2193, 7.4375) [0.0000, 0.3750, 0.6505]
PeriodicSite: Y (0.0000, 3.6988, 3.9966) [-0.0000, 0.6250, 0.3495]
PeriodicSite: Y (0.0000, 5.1783, 9.7137) [0.0000, 0.8750, 0.8495]
PeriodicSite: Y (0.0000, 0.7398, 1.7205) [-0.0000, 0.1250, 0.1505]
PeriodicSite: Cr (0.0000, 2.2441, 10.5351) [-0.0000, 0.3792, 0.9214]
PeriodicSite: Cr (0.0000, 3.6740, 0.8991) [0.0000, 0.6208, 0.0786]
PeriodicSite: Cr (0.0000, 5.2031, 6.6161) [0.0000, 0.8792, 0.5786]
PeriodicSite: Cr (0.0000, 0.7150, 4.8180) [0.0000, 0.1208, 0.4214]
PeriodicSite: B (1.7232, 0.1461, 7.9047) [0.5000, 0.0247, 0.6913]
PeriodicSite: B (1.7232, 5.7720, 3.5294) [0.5000, 0.9753, 0.3087]
PeriodicSite: B (1.7232, 3.1051, 9.2465) [0.5000, 0.5247, 0.8087]
PeriodicSite: B (1.7232, 2.8130, 2.1876) [0.5000, 0.4753, 0.1913]
PeriodicSite: B (1.7232, 0.6689, 6.2512) [0.5000, 0.1130, 0.5467]
PeriodicSite: B (1.7232, 5.2492, 5.1829) [0.5000, 0.8870, 0.4533]
PeriodicSite: B (1.7232, 3.6280, 10.9000) [0.5000, 0.6130, 0.9533]
PeriodicSite: B (1.7232, 2.2901, 0.5342) [0.5000, 0.3870, 0.0467]
PeriodicSite: B (1.7232, 1.6549, 3.6187) [0.5000, 0.2796, 0.3165]
PeriodicSite: B (1.7232, 4.2632, 7.8154) [0.5000, 0.7204, 0.6835]
PeriodicSite: B (1.7232, 4.6139, 2.0984) [0.5000, 0.7796, 0.1835]
PeriodicSite: B (1.7232, 1.3041, 9.3358) [0.5000, 0.2204, 0.8165]
PeriodicSite: B (1.7232, 2.1437, 5.3450) [0.5000, 0.3622, 0.4675]
PeriodicSite: B (1.7232, 3.7743, 6.0891) [0.5000, 0.6378, 0.5325]
PeriodicSite: B (1.7232, 5.1028, 0.3721) [0.5000, 0.8622, 0.0325]
PeriodicSite: B (1.7232, 0.8153, 11.0621) [0.5000, 0.1378, 0.9675])

where what I really want is highlighted “abc : 3.44648958 5.91809299 11.43413371”, do you have any ideas on how to easily filter that out as separate columns?