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

# Classify Waste

> Classify a waste description into EWC codes using AI

# Classify Waste

Classifies a plain-English waste description into the correct European Waste Catalogue (EWC) code(s) using AI. The EWC comprises approximately 650 six-digit codes across 20 chapters. Codes marked with an asterisk are hazardous.

<Note>
  Requires authentication via `Authorization` header. See [Authentication](/authentication).
</Note>

## Request

**Method:** `POST`
**Path:** `/v1/classify-waste`

### Headers

<ParamField header="Authorization" type="string" required>
  Bearer token with your API key, e.g. `Bearer wc_live_your_key`
</ParamField>

<ParamField header="Content-Type" type="string" required>
  Must be `application/json`
</ParamField>

### Body Parameters

<ParamField body="description" type="string" required>
  Plain-English description of the waste
</ParamField>

<ParamField body="source_industry" type="string">
  Industry or activity that produced the waste (improves accuracy)
</ParamField>

<ParamField body="additional_context" type="string">
  Extra detail about contamination, composition, etc.
</ParamField>

<ParamField body="max_results" type="integer">
  Number of classifications to return (default 3, max 5)
</ParamField>

## Response

### Success Response (200)

```json theme={null}
{
  "classifications": [
    {
      "ewc_code": "17 08 02",
      "description": "Gypsum-based construction materials",
      "chapter": "17 - Construction and demolition wastes",
      "is_hazardous": false,
      "confidence": 0.94,
      "reasoning": "Plasterboard is gypsum-based. Non-contaminated material from construction falls under chapter 17."
    }
  ],
  "compliance": {
    "hazardous_waste": false,
    "flags": [],
    "disposal_notes": "Standard non-hazardous waste. Suitable for licensed waste transfer station or recycling.",
    "requires_consignment_note": false
  },
  "metadata": {
    "classified_at": "2026-03-25T14:31:00Z",
    "model_version": "1.0",
    "cached": false
  }
}
```

<ResponseField name="classifications" type="array">
  Ranked list of matching EWC codes with confidence scores
</ResponseField>

<ResponseField name="classifications[].ewc_code" type="string">
  Six-digit EWC code (e.g. `17 08 02`)
</ResponseField>

<ResponseField name="classifications[].confidence" type="number">
  Confidence score from 0 to 1. Below 0.7 suggests manual review
</ResponseField>

<ResponseField name="classifications[].reasoning" type="string">
  Explanation of why this code was selected (for audit trails)
</ResponseField>

<ResponseField name="classifications[].is_hazardous" type="boolean">
  Whether this EWC code is classified as hazardous
</ResponseField>

<ResponseField name="compliance.hazardous_waste" type="boolean">
  True if any returned code is hazardous
</ResponseField>

<ResponseField name="compliance.requires_consignment_note" type="boolean">
  True if hazardous waste requires a consignment note
</ResponseField>

<ResponseField name="compliance.disposal_notes" type="string">
  Guidance on appropriate disposal or recycling
</ResponseField>

### Confidence Scores

| Score      | Interpretation      | Recommended Action                                             |
| ---------- | ------------------- | -------------------------------------------------------------- |
| 0.9 - 1.0  | High confidence     | Safe to use directly                                           |
| 0.7 - 0.89 | Moderate confidence | Acceptable, but review if waste is unusual                     |
| Below 0.7  | Low confidence      | Manual review recommended. A `LOW_CONFIDENCE` flag is returned |

### Caching

Classifications are cached for 7 days based on the exact combination of `description` and `source_industry`. EWC codes don't change, so cached results remain accurate. The `metadata.cached` field indicates cache status.

### Error Responses

| Code                    | HTTP | When                                        |
| ----------------------- | ---- | ------------------------------------------- |
| `INVALID_REQUEST`       | 400  | Missing `description` field                 |
| `CLASSIFICATION_FAILED` | 500  | Waste classification could not be completed |

## Example

<CodeGroup>
  ```bash curl theme={null}
  curl -X POST https://api.wastecheck.co.uk/v1/classify-waste \
    -H "Authorization: Bearer wc_live_your_api_key_here" \
    -H "Content-Type: application/json" \
    -d '{
      "description": "Broken plasterboard from office refurbishment",
      "source_industry": "construction",
      "additional_context": "Non-contaminated, from internal walls"
    }'
  ```

  ```javascript Node.js theme={null}
  const response = await fetch(
    "https://api.wastecheck.co.uk/v1/classify-waste",
    {
      method: "POST",
      headers: {
        "Authorization": "Bearer wc_live_your_api_key_here",
        "Content-Type": "application/json",
      },
      body: JSON.stringify({
        description: "Broken plasterboard from office refurbishment",
        source_industry: "construction",
        additional_context: "Non-contaminated, from internal walls",
      }),
    }
  );
  const data = await response.json();
  console.log(data.classifications[0].ewc_code); // "17 08 02"
  ```

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

  response = requests.post(
      "https://api.wastecheck.co.uk/v1/classify-waste",
      headers={
          "Authorization": "Bearer wc_live_your_api_key_here",
      },
      json={
          "description": "Broken plasterboard from office refurbishment",
          "source_industry": "construction",
          "additional_context": "Non-contaminated, from internal walls",
      },
  )
  data = response.json()
  print(data["classifications"][0]["ewc_code"])  # "17 08 02"
  ```
</CodeGroup>
