XRD database from materials project?

I am interested in the XRD data from the materials project, I notice it’s provided on the website, but can that be downloaded through API?

This snippet might help with creating the XRD from the structures in MP. Just make sure to replace mpr.get_structure_by_material_id() with mpr.materials.search() to retrieve all materials/structures in on go, as explained in our docs. Retrieving materials one-by-one is inefficient and might result in a temporary ban from using our API.

Thank you so much for your response. Unfortunately, I think I cannot access the link to [This snippet]…

My bad. Below the snippet.

from mp_api.client import MPRester
from pymatgen.analysis.diffraction.xrd import XRDCalculator
from pymatgen.symmetry.analyzer import SpacegroupAnalyzer

with MPRester(api_key="$api_key") as mpr:
    # retrieve structures - add a query to reduce results
    docs = mpr.summary.search(fields=["material_id", "structure"])

for doc in docs:
    structure = doc.structure
    # important to use the conventional structure to ensure
    # that peaks are labelled with the conventional Miller indices
    sga = SpacegroupAnalyzer(structure)
    conventional_structure = sga.get_conventional_standard_structure()
    # this example shows how to obtain an XRD diffraction pattern
    # these patterns are calculated on-the-fly from the structure
    calculator = XRDCalculator(wavelength="CuKa")
    pattern = calculator.get_pattern(conventional_structure)
    # do something with the pattern ....

Thank you so much!!!