Materials API INCAR retrieval help

Hello,

I’m having trouble retrieving the INCAR. I’m getting an invalid property error.

here is my https request

https://www.materialsproject.org/rest/v2/materials/mp-7499/vasp/incar?API_KEY=MyAPIKey

here is the error

{“valid_response”: false, “error”: “Invalid property ‘incar’”, “version”: {“db”: “2019.05”, “pymatgen”: “2019.10.16”, “rest”: “2.0”}, “created_at”: “2019-12-05T18:07:32.065174”, “traceback”: “Traceback (most recent call last):\n File “/var/www/python/matgen_prod/materials_django/rest/rest.py”, line 94, in wrapped\n d = func(*args, **kwargs)\n File “/var/www/python/matgen_prod/materials_django/materials/rest.py”, line 133, in get_vasp_property\n raise RESTError(“Invalid property ‘{}’”.format(prop))\nrest.rest.RESTError: Invalid property ‘incar’\n”}

Hi @gzyl,

Welcome to the forum!

The INCAR is task-level information (i.e. for a specific calculation), not material-level information (which aggregates several calculations together).

To retrieve the INCAR in this case, request: https://www.materialsproject.org/rest/v2/tasks/mp-7499/incar?API_KEY=YOUR_API_KEY_HERE

This is for the mp-7499 task, but if you go to the footer of the https://materialsproject.org/materials/mp-7499/ page you can see there are several other task ids associated with this material: a density of states calculation (mp-708479), a bandstructure line calculation (mp-714736) and a static calculation (mp-689349).

Finally, this information is all available in the API Documentation. You may find it easier to query the API via pymatgen’s MPRester class rather than calling the API route directly, which has a lot of helpful methods pre-defined.

Thank you very much!

1 Like