How to download spectrum?

from mp_api.client import MPRester
from emmet.core.xas import Edge, XASDoc, Type

with MPRester(“your_api_key_here”) as mpr:
xas = mpr.materials.xas.search(formula = “TiO2”,
absorbing_element = ‘Ti’,
edge = Edge.K)
which is used solely for retreival, but how to download spectrum?

I got it.
To access the spectrum for the first entry in the list, use xas[0].spectrum.x and xas[0].spectrum.y .