(API help) Retrieve electrical conductivities from Carrier Transport MPContrib

Hello,

I am trying to retrieve mp-ids with electrical conductivities that fall within some range from the Carrier Transport MPContrib. I have tried following the instructions in documentation here, but when I run the following:

sigma_min = 0
sigma_max = 10

with MPRester(MP_API_KEY) as mpr:

client = Client(apikey=MP_API_KEY, project="carrier_transport")       
query = {"data__σ__n__value__gte": sigma_min, "data__σ__n__value__lte": sigma_max}
fields = ["identifier", "formula", "data__σ__n__value"]

client.query_contributions(
    query=query, fields=fields, sort="data__σ__n__value", paginate=True
)

I get the following output:

which doesn’t actually show me the values of the electrical conductivity or the mp-id (the “identifier”).

Any help is appreciated! Thanks,
Carla

Hi Carla,

good question! As opposed to the filters in query, the paths of field names used in the fields and sort arguments are separated by a . (dot). This should work:

query = {"data__σ__n__value__gte": sigma_min, "data__σ__n__value__lte": sigma_max}
fields = ["identifier", "formula", "data.σ.n.value"]

client.query_contributions(
    query=query, fields=fields, sort="data.σ.n.value", paginate=True
)