Issue Accessing "Melting Points using GNN model" Project via MPContribs API

Hello,

I’m trying to access the “Melting Points using GNN model” project data using the MPContribs API. I’ve initialized the client with my API key and project name as it is and also by melting_points_using_gnn_model but get error every time like that:

MPContribsClientError: Failed to load projects for query {‘name’: ‘Melting Points using GNN model’, ‘_fields’: [‘name’]}

I’ve also tried listing projects but encountered the same issue. Could anyone help me troubleshoot this? Is there a specific setup or permission required to access this project?

The project name should be melting_points. Make sure you’ve got the right API key from your dashboard. You can double check that your API key is set via

from mpcontribs.client import Client
client = Client(apikey="your-key", project="melting_points")
client.apikey

the key is correct i have checked it various times. the project name is not melting_points though. can’t get any data

finally resolved. used this piece of code:

from mpcontribs.client import Client
import pandas as pd

df_input = pd.read_csv("myfile.csv")

mp_ids = df_input["material_id"].dropna().unique().tolist()  

client = Client(apikey="my-key", project="melting_points")

query = {"identifier__in": mp_ids}
fields = ["identifier", "formula", "data.MeltingPoint.value"]

results = client.query_contributions(query=query, fields=fields, paginate=True)

records = []
for item in results["data"]:
    records.append({
        "material_id": item.get("identifier"),
        "formula": item.get("formula"),
        "melting_point_K": item.get("data", {}).get("MeltingPoint", {}).get("value")
    })

df_output = pd.DataFrame(records)
df_output.to_csv("meltingpoints.csv", index=False)

print(df_output)
1 Like