The OPTIMADE API only allows you to get the data standardised JSON data, but no files. NOMAD has its own dedicated API, which includes endpoints to download files.
I am not in expert on ABINIT. You can download all the files that were uploaded. If this includes “ABINIT’s anharmonic phonon calculation”, I can’t tell. Each ABINIT calculation comes with multiple files. NOMAD only links the main output file to its entires. This is what we call the mainfile, e.g. run.abo
. But you can download all files in the same directory (e.g. run.log
or run.abi
). I hope what you are looking for is in the run.abi
? So every time you download raw files from a NOMAD entry, you’ll download all the files in the mainfile directory.
This is the endpoint you want to use. Click and see its documentation in our API dashboard. Notice the json_query
parameter. You can copy the JSON from NOMAD Search interface via the <>
button on top of the filters menu. Your query should look like this:
{
"results.material.n_elements": {
"gte": 2,
"lte": 2
},
"results.method.simulation.program_name:any": [
"ABINIT"
],
"authors.name:any": [
"AUTHOR NAME"
]
}
If you are only looking for calculations that have a particular file in their directories, you can add another criteria to your query: e.g. "files.path": "run.abi",
to only find entries that also have a file named run.abi
.
To make it easier on CURL you can use the GET endpoint. Downside, you have to encode the JSON in the json_query
query parameter (-G
, --data-urlencode
). Looks a bit ugly. With python and requests, I would recommend to use the corresponding POST endpoint.
curl -G https://nomad-lab.eu/prod/v1/api/v1/entries/raw --data-urlencode 'json_query={"results.material.n_elements": {"gte": 2, "lte": 2},"results.method.simulation.program_name:any": ["ABINIT"],"authors.name:any": ["AUTHOR NAME"]}' -o download.zip
This will give a .zip file with all the files that where uploaded in the same directories as the run.abo
files. The .zip is organized in the same folder structure that the uploader used. Only difference is the top-level dirs, which use the upload ids of the uploads that the files are in. There is also a manifest.json in the .zip with more details. For this query with a certain someone, it is ~790MB.
Feel free to explore the rest of the API as well. I hope this helps.