mp-api
API Client for the Materials Project
What it is and what it does
mp-api is the official Python client for the Materials Project, a large database of computed materials properties and crystal structures. It provides a programmatic interface to search, filter, and download materials data by composition, structure, or property, making it the standard tool for researchers and engineers working with computational materials datasets.
The package wraps the Materials Project REST API and handles authentication, data serialization (via orjson), and cloud storage access (via boto3 and deltalake). It depends on pymatgen for materials-specific data structures and emmet-core for common data models. Installation is straightforward, though it requires Python 3.11 and a free API key from the Materials Project.
Use it for:
- Search for materials by chemical formula or composition to retrieve computed band gaps, elastic constants, or thermodynamic properties.
- Download crystal structure files in bulk for machine learning training datasets or high-throughput screening workflows.
- Integrate materials data into simulation pipelines that depend on pymatgen structures and properties.
- Query phase diagrams or stability data for materials design and discovery applications.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
A Python client for querying and downloading materials science data from the Materials Project database, providing programmatic access to computed properties and structures.
Yes, if you work with materials science data. The package is actively maintained, has low install friction, carries no known vulnerabilities, and is the official client for a widely-used database. The permissive license poses no restriction. The main requirement is a Materials Project API key and Python 3.11+; the dependency stack is substantial but appropriate for materials research workflows.
Install
mp-api on PyPI
pip
pip install mp-apiuv
uv add mp-apipoetry
poetry add mp-apiInstalling mp-api
Before you install
Low friction installation with a pure-wheel distribution. Active maintenance with a release within the last 60 days. Requires Python 3.11 or later and depends on a substantial stack including pymatgen, boto3, and data processing libraries (pyarrow, deltalake).
License in practice
BSD-3-Clause-LBNL is a permissive license; you can use this package freely in commercial and private projects with minimal restrictions, provided you retain the license notice.
Quickstart
pip install mp-api
from mp_api.client import MPRester
with MPRester(api_key="YOUR_API_KEY") as mpr:
docs = mpr.materials.search(formula="Si")
Requires a Materials Project API key (free registration at materialsproject.org) and Python 3.11 or later.
Verify before relying
- Whether the package supports offline use or requires live API connectivity for all operations.
- Performance characteristics when querying large result sets or downloading bulk data.
- Whether pymatgen and emmet-core are required for all use cases or only for specific workflows.
Package facts
| License | BSD-3-Clause-LBNL (permissive) |
| Python support | supports the current Python release (>=3.11) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 9 — pymatgen, typing-extensions, requests, monty, emmet-core, boto3, orjson, pyarrow, deltalake |
| Maintenance | actively maintained — 60 days since the last release |
| First released | |
| Downloads | 297,750/month — #7,879 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: mp_api-0.46.4-py3-none-any.whl
Tags
More Scientific/Engineering packages
NumPy provides an N-dimensional array object…
permissive · top 100 on PyPI
pandaspandas provides fast, flexible data structures…
permissive · top 100 on PyPI
scipyscipy provides numerical algorithms for…
permissive · top 100 on PyPI
scikit-learnscikit-learn provides a comprehensive Python…
permissive · top 1,000 on PyPI
dilldill extends Python's pickle module to…
permissive · top 1,000 on PyPI
multiprocessMultiprocess is an enhanced fork of Python's…
permissive · top 1,000 on PyPI
pymatgen-corepymatgen-core provides core data structures and…
permissive · top 15,000 on PyPI
pymatgenPymatgen provides Python classes and analysis…
permissive · top 5,000 on PyPI
emmet-coreEmmet-core provides the core data models,…
permissive · top 15,000 on PyPI
fairchem-coreProvides pretrained machine learning models for…
permissive · top 15,000 on PyPI
moyopyMoyopy is a Python binding for Moyo, a crystal…
permissive · top 15,000 on PyPI
phonopyPhonopy calculates phonon properties and…
permissive · top 15,000 on PyPI
symfcSymfc computes force constants from atomic…
unclear · top 15,000 on PyPI
matscipyMatscipy provides domain-specific computational…
copyleft · top 15,000 on PyPI
pyocseAutomates simulation workflows for organic…
permissive · top 15,000 on PyPI