OPTIMADE-TO-SQL API Documentation

Materials science data query interface — OPTIMADE v1.0.0 compliant

Overview

This server implements an OPTIMADE-compatible API for querying materials science data including crystal structures, phase diagrams, and physical properties. It translates OPTIMADE filter queries into SQL and returns structured JSON responses.

Base URL: /v1 — All data endpoints are relative to this path.

Endpoints

GET /versions
Discover supported major API versions (plain text CSV format).
GET /v1/info
Base info endpoint: server information, available endpoints, API version, provider, and license.
GET /v1/info/structures
Entry listing info for the structures entry type. structures
GET /v1/info/phasediagrams
Entry listing info for the phase diagrams entry type. phase diagrams
GET /v1/info/properties
Entry listing info for the physical properties entry type. properties
GET /v1/links
Links endpoint with one root link and child links to sub-databases (COD, MC3D, OQMD).
GET /v1/structures
Query crystal structure entries. Use the project query parameter to select a sub-database. structures
GET /v1/structures/{entry_id}
Fetch a single structure entry by ID (use project for non-default sub-databases). structures
GET /v1/phasediagrams
Query phase diagram entries. phase diagrams
GET /v1/properties
Query physical property entries. properties
GET /v1/extensions/ontology
Ontology index (report IDs, TTL/spec URLs). ontology
GET /v1/extensions/ontology/ttl
OWL Turtle (data/ontology/mpds-ontology.ttl). ontology
GET /v1/extensions/ontology/spec
JSON taxonomy (data/ontology/ontology-spec.json). ontology
Sub-databases: COD, MC3D, and OQMD structures are served through the same /v1/structures endpoint using the project query parameter, e.g. /v1/structures?project=cod. Per the OPTIMADE specification, entry type names must be valid identifiers (no slashes), so they are not exposed as separate top-level endpoints.

Query Parameters

Entry listing endpoints accept the following parameters:

ParameterTypeDefaultDescription
filterstring(empty)OPTIMADE filter expression
page_limitinteger100Maximum number of results
page_offsetinteger0Offset for pagination
response_fieldsstring(empty)Comma-delimited fields to include in the response (always includes id, type)
projectstringmpds-syntheticSelect structures sub-database: mpds-synthetic, cod, mc3d, oqmd (/v1/structures only)

Structures

Available filter fields for /v1/structures:

FieldTypeDescription
idstringEntry identifier
immutable_idstringImmutable identifier
nelementsintegerNumber of elements
elementsstringElement list (use with HAS operators)
chemical_formula_descriptivestringDescriptive chemical formula
chemical_formula_reducedstringReduced chemical formula
chemical_formula_anonymousstringAnonymous chemical formula
dimension_typesstringDimension types
lattice_vectorsstringLattice vectors
cartesian_site_positionsstringCartesian site positions
species_at_sitesstringSpecies at sites
speciesstringSpecies
assembliesstringAssemblies
structure_featuresstringStructure features
last_modifieddatetimeLast modification timestamp
elements_ratiosstringElement ratios (from attributes JSON)
_mcloud_mc3d_idstringMC3D identifier (use IS KNOWN to filter mc3d entries)

Set operators for elements

HAS ALL HAS ANY HAS ONLY

Example: elements HAS ALL "Si,O" — find structures containing both Si and O.

COD Structures cod

The Crystallography Open Database (COD) sub-database is a slave mirror of crystallography.net/cod. It replicates COD's MySQL data table with 534k+ crystal structures.

Query path: /v1/structures?project=cod — COD structures are served through the same structures endpoint using the project query parameter.

Available filter fields for /v1/structures?project=cod (selected fields):

FieldTypeDescription
idintegerCOD entry ID (file number)
_cod_a, _cod_b, _cod_cfloatLattice parameters (Å)
_cod_alpha, _cod_beta, _cod_gammafloatLattice angles (°)
_cod_volfloatUnit cell volume (ų)
_cod_sgstringSpace group symbol (Hermann-Mauguin)
_cod_sghallstringSpace group symbol (Hall)
_cod_sgnumberintegerSpace group number
_cod_formulastringSummary chemical formula
_cod_calcformulastringCalculated formula
_cod_yearintegerYear of publication
_cod_journalstringJournal name
_cod_authorsstringPublication authors
_cod_titlestringPublication title
_cod_doistringDOI of the publication
_cod_mineralstringMineral name
_cod_chemnamestringIUPAC chemical name
_cod_commonnamestringCommon compound name
_cod_smilesstringSMILES descriptor
_cod_methodstringStructure determination method
_cod_celltempfloatCell measurement temperature (K)
_cod_diffrtempfloatDiffraction temperature (K)
_cod_wavelengthfloatWavelength (Å)
_cod_rall, _cod_robsfloatR-factor values
_cod_zintegerNumber of formula units (Z)
_cod_statusstringEntry status: warnings, errors, retracted
_cod_flagsstringEntry flags (has coordinates, has disorder, has Fobs)
Full list: All 74 columns from COD's data table are available as _cod_* fields.

MC3D Structures mc3d

MC3D is a collection of DFT-calculated crystal structures from MPDS.

Query path: /v1/structures?project=mc3d — MC3D structures are served through the same structures endpoint using the project query parameter.

Available filter fields for /v1/structures?project=mc3d:

FieldTypeDescription
idintegerEntry identifier
immutable_idstringImmutable UUID identifier
nelementsintegerNumber of elements
elementslistElement list (use with HAS operators)
chemical_formula_descriptivestringDescriptive chemical formula
chemical_formula_reducedstringReduced chemical formula
chemical_formula_anonymousstringAnonymous chemical formula
nsitesintegerNumber of sites
nperiodic_dimensionsintegerNumber of periodic dimensions
last_modifieddatetimeLast modification timestamp
_mcloud_mc3d_idstringMC3D identifier (e.g. mc3d-38464)
_mcloud_source_dbstringSource database name
_mcloud_source_db_idstringSource database entry ID
_mcloud_total_energyfloatTotal DFT energy (eV)
_mcloud_cell_volumefloatUnit cell volume (ų)
_mcloud_total_magnetizationfloatTotal magnetization
_mcloud_absolute_magnetizationfloatAbsolute magnetization
_mcloud_ctimestringCreation timestamp
space_group_it_numberintegerSpace group IT number
space_group_symbol_hallstringSpace group Hall symbol
space_group_symbol_hermann_mauguinstringSpace group H-M symbol

OQMD Structures oqmd

The Open Quantum Materials Database (OQMD) is a database of DFT-calculated thermodynamic and structural properties of materials from Northwestern University.

Query path: /v1/structures?project=oqmd — OQMD structures are served through the same structures endpoint using the project query parameter.

Available filter fields for /v1/structures?project=oqmd:

FieldTypeDescription
idintegerStructure identifier
nsitesintegerNumber of sites
natomsintegerNumber of atoms
ntypesintegerNumber of element types
labelstringStructure label
measuredbooleanExperimentally measured?
entry_idintegerOQMD entry ID
volumefloatUnit cell volume (ų)
delta_efloatFormation energy (eV/atom)
stabilityfloatDistance from convex hull (eV/atom)
band_gapfloatBand gap (eV)
total_energyfloatTotal DFT energy (eV)
magnetic_momentfloatTotal magnetic moment (Μb)
spacegroupintegerSpace group ID
Joined fields (via oqmd_entries → oqmd_compositions)
chemical_formula_descriptivestringChemical formula (joined from compositions)
chemical_formula_anonymousstringAnonymous formula (joined from compositions)
nelementsintegerNumber of elements (joined from compositions)
labelstringPrototype/ICSD label (joined from entries)
Joins: OQMD structures are linked to entries via entry_id, and entries link to compositions via composition_id. Joined fields are automatically resolved with LEFT JOINs.

Phase Diagrams

Available filter fields for /v1/phasediagrams:

FieldTypeDescription
idstringEntry identifier
naxesintegerNumber of axes
arityintegerArity
diatypestringDiagram type
elementsstringChemical elements
versionstringEntry version
object_typestringObject type
title_astringTitle axis A
title_bstringTitle axis B

Physical Properties

Available filter fields for /v1/properties:

FieldTypeDescription
idintegerEntry identifier
structure_idintegerLinked structure ID
elementsstringElement list
nelementsintegerNumber of elements
chemical_formula_descriptivestringDescriptive chemical formula
chemical_formula_anonymousstringAnonymous chemical formula
property_namestringName of the physical property
property_valuefloatNumeric value of the property
property_unitstringUnit of the property
conditionsstringMeasurement conditions (temperature, pressure)
measurement_methodstringMeasurement method
densityfloatDensity value (kg/m³)
melting_pointfloatMelting point value (K)
lattice_parameterfloatLattice parameter (Å)
band_gapfloatBand gap value (eV)
bulk_modulusfloatBulk modulus value (GPa)
shear_modulusfloatShear modulus value (GPa)
youngs_modulusfloatYoung's modulus value (GPa)
poisson_ratiofloatPoisson ratio (dimensionless)
thermal_expansionfloatThermal expansion coefficient (1/K)
electrical_conductivityfloatElectrical conductivity (S/m)
thermal_conductivityfloatThermal conductivity (W/(m·K))
heat_capacityfloatHeat capacity (J/(mol·K))
magnetic_momentfloatMagnetic moment (Bohr magnetons)
cell_volumefloatUnit cell volume (ų)
categorystringProperty category: elastic, thermal, electrical, magnetic, structural
Joins: Physical properties are linked to structures via structure_id. Structure fields can be used in filters through this relationship.

Ontology OWL

The MPDS OPTIMADE ontology is auto-generated from mpds-synthetic (OPTIMADE_PROPERTIES + ELEMENTS_DB) via mpds-generate-ontology. This server serves /v1/extensions/ontology/ttl (data/ontology/mpds-ontology.ttl) and /v1/extensions/ontology/spec (taxonomy JSON). Regenerate with python scripts/sync_ontology.py.

Downloads

OWL Turtle

Full ontology (mpds-ontology.ttl)

Taxonomy JSON

category_map and property hierarchy

Property Taxonomy

CategoryProperties
structuraldensity, lattice_parameter, cell_volume
thermalmelting_point, thermal_expansion, thermal_conductivity, heat_capacity
elasticbulk_modulus, shear_modulus, youngs_modulus, poisson_ratio
electricalelectrical_conductivity, band_gap
magneticmagnetic_moment

Database mapping (API tables only)

The OPTIMADE API uses existing tables; ontology element individuals live in the TTL file, not separate SQL tables.

ColumnOWL conceptNotes
structures.elements:containsElementTEXT[] — filter with elements HAS Fe
physical_properties.elements:forCompositionTEXT[] composition
physical_properties.conditions:MeasurementConditionJSONB in-row (not a separate table)
physical_properties.categorysubclass taxonomyelastic, thermal, etc.

Filter Syntax

Filters follow the OPTIMADE filter format (v1.0.0). The basic syntax:

// Comparison operators
field < value
field <= value
field > value
field >= value
field = value
field != value

// String operators
field CONTAINS "substr"
field STARTS WITH "prefix"
field ENDS WITH "suffix"

// Set operators (for array/list fields)
elements HAS ALL "Si,O"
elements HAS ANY "Fe,Cu"
elements HAS ONLY "Si,O"

// Logical operators
condition1 AND condition2
condition1 OR  condition2
NOT condition

// Grouping
(nelements >= 2 AND nelements <= 5)

Value formats

Query Examples

Structuresstructures

Structures with exactly 3 elements
nelements=3
Structures containing both Si and O
elements HAS ALL "Si,O"
Structures with band gap greater than 2.0 eV
band_gap > 2.0
Binary oxides (2 elements, contains O)
nelements=2 AND elements HAS ANY "O"
Formula containing "Fe3O4"
chemical_formula_descriptive CONTAINS "Fe3O4"

COD Structurescod

Structures published in year 2000
_cod_year=2000
Structures with space group number 14
_cod_sgnumber=14
Structures with lattice parameter a > 10 Å
_cod_a > 10.0
Structures from Acta Crystallographica
_cod_journal CONTAINS "Acta Crystallographica"
Retracted structures
_cod_status="retracted"
Mineral quartz
_cod_mineral="quartz"

MC3D Structuresmc3d

Structures containing Zn
elements HAS "Zn"
Specific MC3D entry by ID
_mcloud_mc3d_id="mc3d-38464"
Total energy below -10000 eV
_mcloud_total_energy < -10000
Space group 225 (Fm-3m)
space_group_it_number=225

OQMD Structuresoqmd

Structures with formation energy below 0 (stable)
delta_e < 0
Structures near the convex hull
stability < 0.1
Structures with volume greater than 100 ų
volume > 100
Structures with band gap (semiconductors)
band_gap > 0
Magnetic structures
magnetic_moment > 0
By chemical formula (joined from compositions)
chemical_formula_descriptive CONTAINS "Fe"
By prototype name (joined from entries)
label CONTAINS "alpha"
Ternary compounds (3 elements, joined)
nelements=3

Phase Diagramsphasediagrams

Binary phase diagrams (2 axes)
naxes=2
Phase diagrams containing Fe and C
elements HAS ALL "Fe,C"
Phase diagrams of a specific type
diatype="binary"

Physical Propertiesproperties

All band gap measurements
property_name="band_gap"
Properties of compounds with 3 elements
nelements=3
Properties with value greater than 100
property_name="density" AND property_value > 100
Properties of compounds containing Si
elements HAS ANY "Si"
Young's modulus greater than 200 GPa
youngs_modulus > 200
Melting point between 500 K and 1500 K
melting_point >= 500 AND melting_point <= 1500
All elastic properties (ontology category filter) ontology
category="elastic"
← Back to query form