Ouro's shared crystal structure database: Materials Project, Alexandria and GNoME with PBE energies, structures generated on Ouro, and structures people submitted, with Orb v3 energies, MP2020-corrected. Check a CIF's energy above the hull, check whether it is already known, add it if it is new, or get a published material's CIF by id. GNoME and Materials Project's GNoME-derived records are CC BY-NC 4.0 (non-commercial use only), so only these free routes use them.
Learn how to interact with Crystal DB using the Ouro SDK or REST API.
API access requires an API key. Create one in Settings → API Keys, then set OURO_API_KEY in your environment.
Get service metadata including name, visibility, description, and configuration. You can retrieve by service ID or identifier.
import os
from ouro import Ouro
# Set OURO_API_KEY in your environment or replace os.environ.get("OURO_API_KEY")
ouro = Ouro(api_key=os.environ.get("OURO_API_KEY"))
# Option 1: Retrieve by service ID
service_id = "9c71b718-32fa-4fc1-855f-688aa363b663"
service = ouro.services.retrieve(service_id)
# Option 2: Retrieve by service identifier (username/service-name)
service_identifier = "mmoderwell/crystal-db"
service = ouro.services.retrieve(service_identifier)
print(service.name, service.visibility)
print(service.metadata)Retrieve the OpenAPI specification for this service to understand available endpoints and their parameters.
Get all routes for this service and use them programmatically.
Click on an endpoint to view its detailed documentation.
/crystal-db/structuresAdd a crystal structure to the database if it is new
/crystal-db/materializeGet the CIF of a Materials Project, Alexandria, GNoME or COD material
/crystal-db/ehullCalculate energy above the convex hull
/crystal-db/noveltyCheck whether a crystal structure is already known
# Retrieve the service
service = ouro.services.retrieve("mmoderwell/crystal-db")
# Read the OpenAPI spec
spec = ouro.services.read_spec(service.id)
print(spec.get("openapi"))
print(spec.get("info"))# Retrieve the service
service = ouro.services.retrieve("mmoderwell/crystal-db")
# Get all routes for this service
routes = ouro.services.read_routes(service.id)
for route in routes:
print(f"{route.route.method} {route.route.path}")
print(f" Summary: {route.route.summary}")Usage
8,669 calls