> ## 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 XRD Data

> Retrieve X-ray diffraction data and analysis

Returns processed X-ray diffraction (XRD) data, including the diffraction pattern (intensity versus 2θ) and any detected peaks.

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

## Response

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

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

<ResponseField name="two_theta" type="array">
  Diffraction angle (2θ) values
</ResponseField>

<ResponseField name="two_theta_unit" type="string">
  Unit for the `two_theta` values (e.g., `degrees`)
</ResponseField>

<ResponseField name="intensities" type="array">
  Intensity/count values corresponding to each `two_theta` value
</ResponseField>

<ResponseField name="wavelength_angstrom" type="number">
  X-ray source wavelength in angstroms
</ResponseField>

<ResponseField name="detected_peaks" type="array">
  Detected peaks in the diffraction pattern
</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")
  xrd = results[0]  # XRDResult
  print(xrd.two_theta)
  print(xrd.detected_peaks)
  ```

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

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

  ```bash cURL theme={null}
  curl "https://api.atomscale.ai/xrd/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": "xrd_001",
    "two_theta": [20.0, 20.1, 20.2, 20.3, 20.4],
    "two_theta_unit": "degrees",
    "intensities": [120, 340, 1580, 410, 150],
    "wavelength_angstrom": 1.5406,
    "detected_peaks": [
      {"position": 20.2, "intensity": 1580}
    ],
    "spectral_metadata": {},
    "last_updated": "2024-01-15T10:35:00Z"
  }
  ```
</ResponseExample>
