skillfed

mp-api

API Client for the Materials Project

mp-api v0.46.4 297.8K downloads/30d#7,879 on PyPI
Permissive license BSD-3-Clause-LBNL Active released

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-api

uv

uv add mp-api

poetry

poetry add mp-api

Installing 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

Development Status :: 4 - BetaIntended Audience :: Information TechnologyIntended Audience :: Science/ResearchOperating System :: OS IndependentProgramming Language :: Python :: 3Topic :: Scientific/Engineering

Tags

materials project api clientmaterials science data downloadcrystal structure database pythoncomputed materials propertiesmaterials project database access
materials-scienceapi-clientdatabase-access

More Scientific/Engineering packages