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

# Get farm health

> Composite 0–100 farm health score plus per-category breakdowns.

```
GET https://www.wiseyield.co/api/v1/farms/{id}/health-score
```

Computes a composite farm health score (0–100) and per-category breakdowns covering crops, financials, tasks, and alerts over the last 30 and 90 day windows.

### Authentication

Requires a key with the `analytics:read` scope. See [Authentication](/authentication).

### Path parameters

<ParamField path="id" type="string" required>Farm UUID.</ParamField>

### Response

<ResponseField name="data" type="object">
  <Expandable title="Farm health breakdown">
    <ResponseField name="overallScore" type="integer">Composite score 0–100.</ResponseField>
    <ResponseField name="overallLabel" type="string">`Excellent` (≥90) · `Good` (≥70) · `Fair` (≥50) · `Needs Attention` (\<50).</ResponseField>

    <ResponseField name="categories" type="array">
      Per-category breakdowns (crops, financials, tasks, alerts).

      <Expandable title="Category">
        <ResponseField name="name" type="string">Category name.</ResponseField>
        <ResponseField name="score" type="integer">0–100.</ResponseField>
        <ResponseField name="label" type="string">Same scale as overallLabel.</ResponseField>
        <ResponseField name="signals" type="array">Underlying metrics that contributed to the score.</ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="computedAt" type="string">ISO 8601 timestamp.</ResponseField>
  </Expandable>
</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl 'https://www.wiseyield.co/api/v1/farms/11111111-2222-3333-4444-555555555555/health-score' \
    -H "Authorization: Bearer $WISEYIELD_API_KEY"
  ```

  ```javascript JavaScript theme={null}
  const res = await fetch(
    `https://www.wiseyield.co/api/v1/farms/${farmId}/health-score`,
    { headers: { Authorization: `Bearer ${process.env.WISEYIELD_API_KEY}` } }
  );
  const { data: health } = await res.json();
  console.log('Overall score:', health.overallScore);
  ```

  ```python Python theme={null}
  import os, requests
  res = requests.get(
      f'https://www.wiseyield.co/api/v1/farms/{farm_id}/health-score',
      headers={'Authorization': f"Bearer {os.environ['WISEYIELD_API_KEY']}"},
  )
  health = res.json()['data']
  ```
</RequestExample>

## Errors

| Status                    | When                                                            |
| ------------------------- | --------------------------------------------------------------- |
| `400 INVALID_ID`          | `{id}` is not a valid UUID                                      |
| `401`                     | Missing, malformed, expired, or revoked API key                 |
| `403 INSUFFICIENT_SCOPE`  | Key lacks `analytics:read` scope                                |
| `404 NOT_FOUND`           | Farm doesn't exist, is soft-deleted, or belongs to another user |
| `429 RATE_LIMIT_EXCEEDED` | Per-user rate limit reached                                     |
| `5xx`                     | Server error                                                    |
