> ## Documentation Index
> Fetch the complete documentation index at: https://docs.atomscale.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Get OES Data

> Retrieve optical emission spectroscopy data and analysis

Returns the most recent processed optical emission spectroscopy (OES) result for a data entry, including the measured spectrum, reference and dark spectra, and any detected emission peaks.

<ParamField path="data_id" type="string" required>
  The data entry UUID for the OES measurement
</ParamField>

## Response

<ResponseField name="data_id" type="string">
  Data entry UUID
</ResponseField>

<ResponseField name="id" type="string">
  OES results identifier
</ResponseField>

<ResponseField name="wavelengths" type="array">
  Wavelength values for the spectrum
</ResponseField>

<ResponseField name="wavelength_unit" type="string">
  Unit for the `wavelengths` values (e.g., `nm`)
</ResponseField>

<ResponseField name="sample" type="array">
  Measured sample spectrum intensities
</ResponseField>

<ResponseField name="reference" type="array">
  Reference spectrum intensities (if captured)
</ResponseField>

<ResponseField name="dark" type="array">
  Dark spectrum intensities used for background correction (if captured)
</ResponseField>

<ResponseField name="scope_corrected" type="array">
  Background-corrected spectrum intensities
</ResponseField>

<ResponseField name="spectrum_type" type="string">
  The type of spectrum represented by this result
</ResponseField>

<ResponseField name="detected_peaks" type="array">
  Detected emission peaks in the spectrum
</ResponseField>

<ResponseField name="constraint_mode" type="string">
  Element constraint mode applied during peak assignment: `auto`, `include`, or `exclude`
</ResponseField>

<ResponseField name="constrained_elements" type="array">
  Elements constrained during peak assignment (when `constraint_mode` is `include` or `exclude`)
</ResponseField>

<ResponseField name="spectral_metadata" type="object">
  Additional metadata about the measurement
</ResponseField>

<ResponseField name="last_updated" type="string">
  ISO 8601 timestamp of last update
</ResponseField>

<RequestExample>
  ```python SDK theme={null}
  from atomscale import Client

  client = Client(api_key="YOUR_API_KEY")
  results = client.get(data_ids="d290f1ee-6c54-4b01-90e6-d701748f0851")
  oes = results[0]  # OESResult
  print(oes.wavelengths)
  print(oes.detected_peaks)
  ```

  ```python Python theme={null}
  import requests

  response = requests.get(
      "https://api.atomscale.ai/oes/d290f1ee-6c54-4b01-90e6-d701748f0851",
      headers={"X-API-KEY": "YOUR_API_KEY"}
  )
  oes_data = response.json()
  ```

  ```bash cURL theme={null}
  curl "https://api.atomscale.ai/oes/d290f1ee-6c54-4b01-90e6-d701748f0851" \
    -H "X-API-KEY: YOUR_API_KEY"
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "data_id": "d290f1ee-6c54-4b01-90e6-d701748f0851",
    "id": "oes_001",
    "wavelengths": [400.0, 400.5, 401.0, 401.5],
    "wavelength_unit": "nm",
    "sample": [1200, 1350, 4100, 1280],
    "reference": [1100, 1150, 1180, 1120],
    "dark": [50, 52, 51, 49],
    "scope_corrected": [1150, 1298, 4049, 1231],
    "spectrum_type": "sample",
    "detected_peaks": [
      {"peak_id": "p1", "wavelength_nm": 401.0, "element": "Ga"}
    ],
    "constraint_mode": "auto",
    "constrained_elements": null,
    "spectral_metadata": {},
    "last_updated": "2024-01-15T10:35:00Z"
  }
  ```
</ResponseExample>
