Navigation

HEAS Data Platform · Materials Science Database

API Endpoints

RESTful API v1 · all data is programmatically accessible

Overview

The HEAS Data Platform provides a RESTful API for programmatic access to all platform material data. All endpoints return JSON; these public API endpoints require no API KEY or authentication. When requests are made and processed, the system logs API requests; these logs help us with error troubleshooting, security monitoring and service operations. Related data will also be shared, within a reasonable scope, with all partner institutions of this project.

Rate limit: the same IP may make at most 200 requests within a sliding window of any 60 seconds ; beyond that, requests from that IP are not executed for 300 seconds (the Retry-After response header gives the remaining seconds). Web pages and the API share one set of rate-limit rules.

Two searchable datasets are available, selected with the db parameter (list / search endpoints) or inferred from the material ID prefix (detail / CIF / XRD endpoints): mp-* for Materials Project (HEA / TRA / ELA source collections, deduplicated by mp_id) and agm* for Alexandria. Both share the same response envelope; field differences are listed in the Property Reference.

Protocol
HTTPS
Response Format
application/json
Authentication
Public

Endpoint Overview

Endpoint Description
GET /api/v1/materialsMaterial list: pagination / filtering / sorting
GET /api/v1/materials/:idMaterial detail (mp-\* → MP, agm\* → Alexandria)
GET /api/v1/materials/:id/cifCIF crystal structure (JSON / plain text)
GET /api/v1/materials/:id/xrdDiffraction pattern (MP only; 404 for Alexandria)
GET /api/v1/xrdUnified endpoint: peak matching / pattern / catalog browse
GET /api/v1/searchLightweight keyword search (autocomplete-friendly)
GET /api/v1/statsPlatform statistics
GET /api/v1/materials

Fetch the material list, with pagination, filtering and sorting support.

Query Parameters

Parameter Type Default Description
pageint1Page number (from 1, max 100000)
per_pageint20Records per page (1-100)
dbstringmpDataset: mp (Materials Project) or alex (Alexandria). Invalid values fall back to mp
typestring-Type filter (MP dataset only): HEA, TRA or ELA
qstring-Keyword search (chemical formula or MP-ID). Only letters, digits, parentheses (), - . , and spaces are supported; special characters such as Chinese are ignored
crystal_systemstring-Crystal system (case-insensitive): Cubic / Tetragonal / Orthorhombic / Hexagonal / Trigonal / Monoclinic / Triclinic
is_stablebool-Stability: true/false (also accepts 1/0/yes/no; applies to the MP dataset)
has_xrdbool-Return only materials with a precomputed XRD pattern (1; applies to the MP dataset)
min_energyfloat-Minimum formation energy (eV/atom, -1000 ~ 1000)
max_energyfloat-Maximum formation energy (eV/atom, -1000 ~ 1000)
elementsstring-Element filter, exact match on the element composition (comma-separated standard element symbols, e.g. Fe,Cr; case-insensitive, at most 10). Matched against the elements actually present in the chemical formula, so Si does not match CsI
sortstring-Sort field, with the - prefix for descending order. Allowed: mp_id / type / formula / crystal_system / space_group / formation_energy_per_atom / is_stable / density / nelements; defaults to mp_id ascending, NULLs last

Element Filter Notes

Rule Description
Match mode Exact match on the real element set parsed from the chemical formula, not substring matching: Si only matches silicon-containing materials and will not mistakenly match CsI; C also will not match NaCl
Separators Supports ,, spaces, ;, 、; case-insensitive (fe,cr is equivalent to Fe,Cr)
Fault tolerance Non-element symbols are ignored; at most 10 elements
Recommended usage The query page provides a periodic-table picker; using it to build conditions is recommended
Materials Project
Request example
curl "https://heas.labs.gt.ac.cn/api/v1/materials?type=HEA&per_page=5&sort=-formation_energy_per_atom"
Response example
{
  "success": true,
  "data": {
    "items": [
      {
        "mp_id": "mp-1",
        "type": "TRA",
        "formula": "Cs",
        "crystal_system": "Cubic",
        "space_group": "Im-3m",
        "space_group_num": 229,
        "formation_energy_per_atom": 0.01934,
        "is_stable": false,
        "density": 1.80193,
        "nelements": 1
      },
      {
        "mp_id": "mp-10",
        "type": "TRA",
        "formula": "As",
        "crystal_system": "Cubic",
        "space_group": "Pm-3m",
        "space_group_num": 221,
        "formation_energy_per_atom": 0.1124,
        "is_stable": false,
        "density": 6.29491,
        "nelements": 1
      }
    ],
    "pagination": {
      "current_page": 1,
      "per_page": 2,
      "total_items": 170157,
      "total_pages": 85079
    }
  },
  "meta": {
    "query_time_ms": 173.48,
    "cached": false,
    "source": "sqlite_index"
  }
}

Without a type filter the list is deduplicated by mp_id across datasets (a material recorded in HEA / TRA / ELA is returned once, highest priority first: HEA → TRA → ELA), and pagination.total_items counts the deduplicated rows.

Alexandria

Alexandria list items carry the fields mp_id / formula / crystal_system / space_group / space_group_num / formation_energy_per_atom / nelements (the mp_id column is the Alex-ID). Each Alex-ID occupies a single index row, so no cross-dataset deduplication applies:

Request example
curl "https://heas.labs.gt.ac.cn/api/v1/materials?db=alex&crystal_system=Triclinic&per_page=5"
Response Example
{
  "success": true,
  "data": {
    "items": [
      {
        "mp_id": "agm000999956",
        "formula": "Cs(BC)3",
        "crystal_system": "Cubic",
        "space_group": "Pm-3n",
        "space_group_num": 223,
        "formation_energy_per_atom": -5.91264449,
        "nelements": 3
      },
      {
        "mp_id": "agm000999957",
        "formula": "Rb(BC)3",
        "crystal_system": "Cubic",
        "space_group": "Pm-3n",
        "space_group_num": 223,
        "formation_energy_per_atom": -6.229015762142857,
        "nelements": 3
      }
    ],
    "pagination": {
      "current_page": 1,
      "per_page": 2,
      "total_items": 5777914,
      "total_pages": 2888957
    }
  },
  "meta": {
    "query_time_ms": 41.98,
    "cached": false,
    "source": "sqlite_index"
  }
}
GET /api/v1/materials/:id

Fetch the full details of a single material, including basic information, elasticity, electronic and magnetic properties, and references.

Path Parameters

Parameter Type Description
idstringMaterial ID: mp- prefix + digits (Materials Project, e.g. mp-2866) or agm + digits (Alexandria, e.g. agm000999965)
Materials Project
Request example
curl "https://heas.labs.gt.ac.cn/api/v1/materials/mp-2866"
Response example
{
  "success": true,
  "data": {
    "mp_id": "mp-2866",
    "type": "HEA",
    "datasets": ["HEA", "TRA", "ELA"],
    "summary": {
      "formula": "Yb(FeSi)2",
      "mp_id": "mp-2866",
      "nelements": 3,
      "is_stable": false,
      "nsites": 5,
      "density": 7.92825,
      "volume": 71.40033,
      "a": 5.41767,
      "b": 5.41767,
      "c": 5.41767,
      "alpha": 137.62961,
      "beta": 137.62961,
      "gamma": 61.47074,
      "space_group": "I4/mmm",
      "space_group_num": 139,
      "crystal_system": "Tetragonal",
      "formation_energy_per_atom": -0.50214,
      "energy_per_atom": -17.08288,
      "energy_above_hull": 0.00216,
      "point_group": "4/mmm",
      "Bravais_Lattice": "Tetragonal I",
      "packing_fraction": 0.74,
      "uncorrected_energy_per_atom": -17.08288,
      "volume_per_atom": 14.280066,
      "c_over_a": 1,
      "b_over_a": null,
      "poisson_ratio": 0.25211,
      "Is_FCC": 0,
      "Is_BCC": 0,
      "Is_HCP": 0
    },
    "elasticity": {
      "k_vrh": 119.518,
      "g_vrh": 70.986,
      "E_Calc(GPa)": 177.764,
      "homogeneous_poisson": 0.252,
      "Vickers_Hard_Est(GPa)": 10.16,
      "universal_anisotropy": 0.058,
      "Lame_Lambda(GPa)": 72.194,
      "Pugh_Ratio(K/G)": 1.6836841067252697,
      "Ductility": "Ductile",
      "bulk_modulus": 119.518,
      "shear_modulus": 70.986,
      "debye_temperature": 516.2,
      "sound_velocity": 3322.8,
      "homogeneity": 0.252
    },
    "electronic": {
      "is_metal": true,
      "band_gap": 0,
      "is_gap_direct": false,
      "cbm": null
    },
    "magnetic": {
      "is_magnetic": false,
      "total_magnetization": 0.0019,
      "ordering": "NM",
      "num_magnetic_sites": 0,
      "total_mag_norm_vol": 3.0e-5
    },
    "refs": {
      "mp_url": "https://materialsproject.org/materials/mp-2866",
      "mp_task_ids": ["aaadmivi", "aaaeukef", "aaafawbu", "aaafbyfu", "aaahbakp"]
    },
    "xrd": {
      "by_target": {
        "AgKa": {"radiation": "AgKa", "wavelength": 0.5608, "n_peaks": 97, "three_strong": [13.5346, 13.2397, 8.9119]},
        "CoKa": {"radiation": "CoKa", "wavelength": 1.7903, "n_peaks": 16, "three_strong": [44.187, 28.7163, 43.1799]},
        "CrKa": {"radiation": "CrKa", "wavelength": 2.2897, "n_peaks": 10, "three_strong": [57.5433, 37.0047, 56.183]},
        "CuKa": {"radiation": "CuKa", "wavelength": 1.5406, "n_peaks": 23, "three_strong": [37.8013, 24.6635, 36.9514]},
        "MoKa": {"radiation": "MoKa", "wavelength": 0.7093, "n_peaks": 94, "three_strong": [17.1749, 16.7997, 11.2997]}
      }
    }
  }
}

datasets lists the datasets this mp_id actually exists in (priority order HEA → TRA → ELA); type is the highest-priority one. The detail endpoint embeds the material's XRD three-strongest peak values in the xrd field, organized by target (radiation) as a by_target structure (each entry carries radiation, wavelength, n_peaks and three_strong; every precomputed target is returned). For the full diffraction peak list and raw xy data, use the pattern endpoint in the XRD Diffraction Matching documentation.

The detail endpoint publishes only a public-field whitelist; the platform's self-developed feature data (features) is not exposed. The elasticity block of the ELA dataset additionally returns bulk_modulus, shear_modulus, debye_temperature, sound_velocity, homogeneity and other elasticity-specific fields (null in HEA / TRA).

Alexandria

Alexandria details use the field set mat_id / formula / summary / energy / electronic / magnetic / structure / meta / composition, in the same envelope as MP details (success + data). Field meanings are listed in the Property Reference.

Field Type Description
mat_idstringAlexandria entry ID (agm + digits)
formulastringReduced standard formula
summaryobjectStructure summary: formula / spg (space-group number) / spg_symbol / crystal_system (lowercase) / point_group / nsites / n_elements / elements
energyobjectEnergy: e_above_hull (eV/atom) / e_form (formation energy, eV/atom) / energy_corrected / energy_total
electronicobjectElectronic structure: band_gap_ind (indirect gap, eV) / band_gap_dir (direct gap, eV) / dos_ef (DOS at the Fermi level)
magneticobjectMagnetism: total_mag (total magnetic moment, µB)
structureobjectUnit cell: a / b / c (Å), alpha / beta / gamma (°), volume (ų), n_sites
metaobjectSource metadata: prototype_id / decomposition / run_timestamp
compositionobjectElement → atom-count composition map
Response example
{
  "success": true,
  "data": {
    "mat_id": "agm005737469",
    "formula": "Sr(Cd5Rh)2",
    "summary": {
      "formula": "Sr(Cd5Rh)2",
      "spg": 69,
      "spg_symbol": "Fmmm",
      "crystal_system": "orthorhombic",
      "point_group": "mmm",
      "nsites": 13,
      "n_elements": 3,
      "elements": ["Sr", "Cd", "Rh"]
    },
    "energy": {
      "e_above_hull": 0.048583876,
      "e_form": -0.14619106,
      "energy_corrected": -27.528517,
      "energy_total": -27.52851763
    },
    "electronic": {"band_gap_ind": 0, "band_gap_dir": 0.0354, "dos_ef": 6.4979},
    "magnetic": {"total_mag": 1.0e-7},
    "structure": {
      "a": 5.816792152520879,
      "b": 7.682452622621729,
      "c": 7.5348373597126574,
      "alpha": 81.59739539125536,
      "beta": 67.29457994421465,
      "gamma": 67.75446032577233,
      "volume": 287.4972511054037,
      "n_sites": 13
    },
    "meta": {
      "prototype_id": "AB2C10_0_spg69",
      "decomposition": " Cd41Rh8  Sr3Cd11  SrCd3Rh2 ",
      "run_timestamp": "2023-07-01 14:25:20.425723"
    },
    "composition": {"Sr": 1, "Cd": 10, "Rh": 2}
  }
}
GET /api/v1/materials/:id/cif

Fetch the material's CIF (Crystallographic Information File) crystal-structure data. Two ID families are supported: mp-* returns the structure file stored by Materials Project; agm* returns the CIF generated from the Alexandria entry's structure data (the first line names the source entry). The format values behave identically for both ID families.

Parameter Type Default Description
id (path)string-Material ID: mp-2866 (MP) or agm005737469 (Alexandria)
format (query)stringjsonjson or raw

The JSON format returns a unified envelope (identical fields for both ID families); format=raw returns the CIF as plain text (Content-Type: text/plain). Response structure example:

{
  "success": true,
  "data": {
    "mp_id": "<material ID>",
    "cif_content": "# generated using pymatgen\n..."
  }
}
Materials Project
MP · JSON format
curl "https://heas.labs.gt.ac.cn/api/v1/materials/mp-2866/cif"
MP · Raw format
curl "https://heas.labs.gt.ac.cn/api/v1/materials/mp-2866/cif?format=raw"
Alexandria
Alexandria · JSON format
curl "https://heas.labs.gt.ac.cn/api/v1/materials/agm005737469/cif"
Alexandria · Raw format
curl "https://heas.labs.gt.ac.cn/api/v1/materials/agm005737469/cif?format=raw"
GET /api/v1/materials/:id/xrd

Fetch the full diffraction pattern of one material (every peak's 2θ / intensity / hkl / d-spacing). Applies to MP materials (mp-*); Alexandria entries (agm*) return 404 with the message XRD data is not available for the Alexandria dataset.

Parameter Type Default Description
id (path)string-Material ID (mp-*; agm* returns 404)
targetstringCuKaTarget (radiation); the parameter name type is also accepted (compatibility alias). Unknown targets fall back to CuKa
formatstringjsonjson or raw (plain text xy: 2θ intensity hkl, with radiation info and the # generated using pymatgen comment)
Materials Project
Request example
curl "https://heas.labs.gt.ac.cn/api/v1/materials/mp-2866/xrd?target=CuKa"
Raw data
curl "https://heas.labs.gt.ac.cn/api/v1/materials/mp-2866/xrd?format=raw"
Alexandria

XRD diffraction patterns are provided by Materials Project only; Alexandria has no such endpoint (returns 404).

GET /api/v1/stats

Fetch platform statistics, including the total material count, per-type counts and index build time.

Materials Project
Request example
curl "https://heas.labs.gt.ac.cn/api/v1/stats"
Response example
{
  "success": true,
  "data": {
    "generated_at": "2026-10-23T15:22:25+00:00",
    "built_at": "2026-10-23T15:22:25+00:00",
    "total": 170157,
    "counts": {"HEA": 150100, "TRA": 16712, "ELA": 3345},
    "meta": {
      "pagination": {"current_page": 1, "per_page": 20, "total_items": 170157, "total_pages": 8508}
    }
  }
}

Error Handling

The API uses standard HTTP status codes to express request results; error responses return a JSON body for programmatic judgment and user display:

Error Response Structure

Field Type Description
successboolAlways false. Note: 405 / 429 responses produced by the routing layer are plain {"error": "..."} without success — rely on the HTTP status code
errorstringHuman-readable error description

HTTP Status Codes

Status Code Meaning
200Request succeeded
400Invalid request parameters (e.g. malformed material ID)
404Resource not found (material / CIF / XRD pattern does not exist; the XRD pattern endpoint returns 404 for Alexandria entries)
405Request method not allowed (this platform's API supports GET only)
429Too many requests; the Retry-After header gives the remaining seconds before retrying, and the response carries Cache-Control: no-store
457Region restriction; the current IP's region is outside the allowed access range
503Service temporarily unavailable (e.g. the index is being rebuilt); please retry later

Example Error Responses

400 Invalid MP-ID format
{
  "success": false,
  "error": "Invalid material ID format"
}
404 Material not found
{
  "success": false,
  "error": "Material not found"
}
405 Method not allowed
{
  "error": "Method not allowed"
}
429 Request failed due to too many requests
{
  "error": "Rate limit exceeded; please retry after 300s. See /document/api for the rate-limit policy."
}
457 Region restriction: IP not in the allowed region
{
  "success": false,
  "error": "In mainland China, only Guizhou Province is permitted to request the service",
  "region": {
    "country": "中国",
    "province": "江苏省",
    "city": "南京市",
    "isp": "移动",
    "code": "CN"
  }
}
503 Service temporarily unavailable
{
  "success": false,
  "error": "Service temporarily unavailable"
}
Contents