Infrared Spectra Data Access API (Visits)

The Infrared Spectrum View Visits page, which plots the flux and displays information about visit spectrum, can be accessed directly with the PLATE, MJD, and FIBERID of the spectrum of interest:

https://dr16.sdss.org/infrared/spectrum/view/visits?plate=PLATE&mjd=MJD&fiberid=FIBERID
e.g., https://dr16.sdss.org/infrared/spectrum/view/visits?plate=5511&mjd=55848&fiberid=18

To download an apVisit spectrum directly using the API, use:

https://dr16.sdss.org/infrared/spectrum/view/visits/data/format=FORMAT?plateid=PLATE&mjd=MJD&fiberid=FIBERID
e.g., https://dr16.sdss.org/infrared/spectrum/view/data/visits/format=fits?plateid=5511&mjd=55848&fiberid=18

where 'FORMAT' should be replaced by either fits or csv.

Alternatively (faster), you may download the apVisit spectrum directly by using the URL of the flat file on the SAS:

https://dr16.sdss.org/sas/dr16/apogee/spectro/redux/APRED_VERS/TELESCOPE/PLATE4/MJD5/apVisit-APRED_VERS-PLATE4-MJD-FIBERID3.fits
e.g., https://dr16.sdss.org/sas/dr16/apogee/spectro/redux/r12/apo25m/5511/apVisit-r12-5511-55848-018.fits

The details of the file format are in the apVisit data model. More information on accessing these files can be found on the SDSS bulk data access pages.

Infrared Spectra Data Access API (Stars)

The Infrared Spectrum View Stars page, which plots the flux and displays information about combined, or ASPCAP spectra, can be accessed directly with the APOGEE_ID, LOCATION_ID, and COMMISS of the spectrum of interest:

https://dr16.sdss.org/infrared/spectrum/view/stars[=combined,=aspcap]?apogee_id=APOGEE_ID&location_id=LOCATION_ID&commiss=COMMISS
e.g. for combined stars, https://dr16.sdss.org/infrared/spectrum/view/stars=combined?apogee_id=2M05580827+1345138&location_id=4258&commiss=0
e.g. for ASPCAP stars, https://dr16.sdss.org/infrared/spectrum/view/stars=aspcap?apogee_id=2M05580827+1345138&location_id=4258&commiss=0

Alternate access is provided through the REDUCTION_ID, FIELD, and COMMISS of the spectrum of interest:

https://dr16.sdss.org/infrared/spectrum/view/stars[=combined,=aspcap]?reduction_id=REDUCTION_ID&field=FIELD&commiss=COMMISS
e.g. for combined stars, https://dr16.sdss.org/infrared/spectrum/view/stars=combined?reduction_id=2M05580827+1345138&field=195-04&commiss=0
e.g. for ASPCAP stars, https://dr16.sdss.org/infrared/spectrum/view/stars=aspcap?reduction_id=2M05580827+1345138&field=195-04&commiss=0

To download an apStar, or aspcapStar spectrum, directly using the API, use:

https://dr16.sdss.org/infrared/spectrum/view/stars[=combined,=aspcap]/data/format=FORMAT?apogee_id=APOGEE_ID&location_id=LOCATION_ID
e.g. for combined stars, https://dr16.sdss.org/infrared/spectrum/view/data/stars=combined/format=fits?apogee_id=2M05580827+1345138&location_id=4258
e.g. for ASPCAP stars, https://dr16.sdss.org/infrared/spectrum/view/data/stars=aspcap/format=fits?apogee_id=2M05580827+1345138&location_id=4258

where 'FORMAT' should be replaced by either fits or csv.

Alternatively (faster), you may download the apStar, or aspcapStar spectrum directly by using the URL of the flat file on the SAS:

https://dr16.sdss.org/sas/dr16/apogee/spectro/redux/APRED_VERS/APSTAR_VERS/TELESCOPE/LOCATION_ID/apStar-APRED_VERS-APOGEE_ID.fits

https://dr16.sdss.org/sas/dr16/apogee/spectro/redux/APRED_VERS/APSTAR_VERS/ASPCAP_VERS/RESULTS_VERS/LOCATION_ID/aspcapStar-APRED_VERS-RESULTS_VER-APOGEE_ID.fits
e.g. for combined stars, https://dr16.sdss.org/sas/dr16/apogee/spectro/redux/r12/stars/apo25m/4258/apStar-r12-2M05580827+1345138.fits
e.g. for ASPCAP stars, https://dr16.sdss.org/sas/dr16/apogee/spectro/redux/r12/stars/l33/l33/4258/aspcapStar-r12-l33-2M05580827+1345138.fits

The details of the file format are in the apStar data model, or aspcapStar data model. More information on accessing these files can be found on the SDSS bulk data access pages.