Skip to main content
GET
https://api.dcycle.io
/
api
/
v1
/
wastes
/
*
Waste Classification Codes
const options = {
  method: 'GET',
  headers: {
    'x-api-key': '<x-api-key>',
    'x-organization-id': '<x-organization-id>',
    'x-user-id': '<x-user-id>'
  }
};

fetch('https://api.dcycle.io/api/v1/wastes/*', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
{
  "[]": [
    {
      "low_id": "<string>",
      "low_code": "<string>",
      "low_name": "<string>"
    }
  ]
}

Waste Classification Codes

Retrieve waste classification codes used in the Dcycle system for waste management and emissions calculations. These codes are based on European waste regulations and help classify waste types and disposal methods.
Waste codes are reference data maintained by Dcycle. You cannot create or modify codes through the API - these endpoints are read-only.

Overview

Dcycle uses three types of waste codes:
  • LER (Lista Europea de Residuos / European Waste List) - Waste type classification
  • RD (Royal Decree) - Disposal method classification
  • LOW (List of Waste) - Regional waste codes

GET /api/v1/wastes/rd_ler_list

Get all waste disposal methods (RD codes) with their associated waste types (LER codes). This endpoint returns a complete mapping of which waste types can be processed with which disposal methods.

Request

Headers

x-api-key
string
required
Your API key for authenticationExample: sk_live_1234567890abcdef
x-organization-id
string
required
Your organization UUIDExample: ff4adcc7-8172-45fe-9cf1-e90a6de53aa9
x-user-id
string
required
Your user UUIDExample: a1b2c3d4-e5f6-7890-abcd-ef1234567890
No query parameters required.

Response

[]
array
Array of RD-LER mapping objects
rd_code
string
Royal Decree disposal method codeExamples: "D1", "D5", "R1", "R3"
rd_name
string
Disposal method descriptionExamples: "Landfill", "Incineration", "Energy recovery", "Recycling"
ler_list
array
Array of LER (waste type) objects applicable to this disposal methodEach LER object contains:
  • ler_code (string) - European waste code (6-digit format: XX XX XX)
  • ler_name (string) - Waste type description

Example

curl -X GET "https://api.dcycle.io/api/v1/wastes/rd_ler_list" \
  -H "Authorization: Bearer ${DCYCLE_API_KEY}" \
  -H "x-organization-id: ${DCYCLE_ORG_ID}" \
  -H "x-user-id: ${DCYCLE_USER_ID}"

Successful Response

[
  {
    "rd_code": "D1",
    "rd_name": "Deposit into or onto land (e.g. landfill)",
    "ler_list": [
      {
        "ler_code": "01 01 01",
        "ler_name": "Wastes from mineral metalliferous excavation"
      },
      {
        "ler_code": "01 01 02",
        "ler_name": "Wastes from mineral non-metalliferous excavation"
      },
      {
        "ler_code": "02 01 01",
        "ler_name": "Sludges from washing and cleaning"
      }
    ]
  },
  {
    "rd_code": "D5",
    "rd_name": "Specially engineered landfill",
    "ler_list": [
      {
        "ler_code": "17 05 03*",
        "ler_name": "Soil and stones containing dangerous substances"
      },
      {
        "ler_code": "17 05 05*",
        "ler_name": "Dredging spoil containing dangerous substances"
      }
    ]
  },
  {
    "rd_code": "R1",
    "rd_name": "Use principally as a fuel or other means to generate energy",
    "ler_list": [
      {
        "ler_code": "19 12 10",
        "ler_name": "Combustible waste (refuse derived fuel)"
      },
      {
        "ler_code": "03 01 01",
        "ler_name": "Waste bark and cork"
      }
    ]
  },
  {
    "rd_code": "R3",
    "rd_name": "Recycling/reclamation of organic substances",
    "ler_list": [
      {
        "ler_code": "02 01 06",
        "ler_name": "Animal faeces, urine and manure"
      },
      {
        "ler_code": "02 03 01",
        "ler_name": "Sludges from washing, cleaning, peeling, centrifuging and separation"
      }
    ]
  }
]

GET /api/v1/wastes/low_codes

Get waste type codes (LOW codes) for a specific region. These codes are used when creating waste records to classify the type of waste being disposed.

Request

Headers

x-api-key
string
required
Your API key for authenticationExample: sk_live_1234567890abcdef
x-organization-id
string
required
Your organization UUIDExample: ff4adcc7-8172-45fe-9cf1-e90a6de53aa9
x-user-id
string
required
Your user UUIDExample: a1b2c3d4-e5f6-7890-abcd-ef1234567890

Query Parameters

waste_region
string
required
Region code for waste classificationCommon values:
  • ES - Spain
  • EU - European Union (generic)
  • UK - United Kingdom
  • Other ISO 3166-1 alpha-2 codes
Example: "ES"

Response

[]
array
Array of LOW (waste type) code objects
low_id
string
Unique waste type identifier (UUID)
low_code
string
Waste type code (6-digit format: XX XX XX)Examples: "01 01 01", "15 01 01", "20 01 01"
low_name
string
Waste type descriptionExamples: "Paper and cardboard", "Plastic packaging", "Mixed municipal waste"

Example

curl -X GET "https://api.dcycle.io/api/v1/wastes/low_codes?waste_region=ES" \
  -H "Authorization: Bearer ${DCYCLE_API_KEY}" \
  -H "x-organization-id: ${DCYCLE_ORG_ID}" \
  -H "x-user-id: ${DCYCLE_USER_ID}"

Successful Response

[
  {
    "low_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    "low_code": "15 01 01",
    "low_name": "Paper and cardboard packaging"
  },
  {
    "low_id": "b2c3d4e5-f6g7-8901-bcde-fg2345678901",
    "low_code": "15 01 02",
    "low_name": "Plastic packaging"
  },
  {
    "low_id": "c3d4e5f6-g7h8-9012-cdef-gh3456789012",
    "low_code": "15 01 03",
    "low_name": "Wooden packaging"
  },
  {
    "low_id": "d4e5f6g7-h8i9-0123-defg-hi4567890123",
    "low_code": "15 01 04",
    "low_name": "Metallic packaging"
  },
  {
    "low_id": "e5f6g7h8-i9j0-1234-efgh-ij5678901234",
    "low_code": "15 01 05",
    "low_name": "Composite packaging"
  },
  {
    "low_id": "f6g7h8i9-j0k1-2345-fghi-jk6789012345",
    "low_code": "20 01 01",
    "low_name": "Paper and cardboard (municipal waste)"
  },
  {
    "low_id": "g7h8i9j0-k1l2-3456-ghij-kl7890123456",
    "low_code": "20 01 39",
    "low_name": "Plastics (municipal waste)"
  }
]

Common Errors

400 Bad Request - Missing waste_region

For /api/v1/wastes/low_codes:
{
  "detail": "Field required",
  "field": "waste_region"
}
Solution: Include the waste_region query parameter.

400 Bad Request - Invalid Region

{
  "detail": "Invalid region code",
  "code": "VALIDATION_ERROR"
}
Solution: Use a valid ISO 3166-1 alpha-2 country code.

403 Forbidden

Cause: Organization ID doesn’t match your API key or user doesn’t belong to organization
{
  "detail": "Not authorized",
  "code": "FORBIDDEN"
}
Solution: Verify that x-organization-id matches your API key’s organization.

Use Cases

Build Waste Type Selector

Create a dropdown selector for waste types:
def get_waste_types_for_selector(region="ES"):
    """Get waste types organized by category"""

    response = requests.get(
        "https://api.dcycle.io/api/v1/wastes/low_codes",
        headers=headers,
        params={"waste_region": region}
    )

    waste_codes = response.json()

    # Organize by category (first 2 digits)
    categories = {}
    for waste in waste_codes:
        category_code = waste['low_code'][:2]
        category_name = get_category_name(category_code)

        if category_name not in categories:
            categories[category_name] = []

        categories[category_name].append({
            'id': waste['low_id'],
            'code': waste['low_code'],
            'name': waste['low_name']
        })

    return categories

def get_category_name(code):
    """Map category codes to names"""
    categories = {
        '01': 'Mining and quarrying wastes',
        '02': 'Agricultural wastes',
        '15': 'Packaging wastes',
        '16': 'Wastes not otherwise specified',
        '17': 'Construction and demolition wastes',
        '19': 'Waste treatment wastes',
        '20': 'Municipal wastes'
    }
    return categories.get(code, f'Category {code}')

# Usage
waste_types = get_waste_types_for_selector("ES")
print("Packaging Wastes:")
for waste in waste_types.get('Packaging wastes', []):
    print(f"  {waste['code']}: {waste['name']}")

Find Applicable Disposal Methods

Find which disposal methods can be used for a specific waste type:
def get_disposal_methods_for_waste(waste_ler_code):
    """Find applicable disposal methods for a waste type"""

    response = requests.get(
        "https://api.dcycle.io/api/v1/wastes/rd_ler_list",
        headers=headers
    )

    rd_ler_mapping = response.json()

    # Find disposal methods that accept this waste type
    applicable_methods = []
    for disposal in rd_ler_mapping:
        for ler in disposal['ler_list']:
            if ler['ler_code'] == waste_ler_code:
                applicable_methods.append({
                    'rd_code': disposal['rd_code'],
                    'rd_name': disposal['rd_name']
                })
                break

    if applicable_methods:
        print(f"Disposal methods for {waste_ler_code}:")
        for method in applicable_methods:
            print(f"  - {method['rd_code']}: {method['rd_name']}")
    else:
        print(f"No disposal methods found for {waste_ler_code}")

    return applicable_methods

# Example: Find disposal methods for plastic packaging
methods = get_disposal_methods_for_waste("15 01 02")

Cache Waste Codes

Since waste codes don’t change frequently, cache them:
from datetime import datetime, timedelta

class WasteCodesCache:
    def __init__(self, api_key, org_id, user_id):
        self.headers = {
            "Authorization": f"Bearer {api_key}",
            "x-organization-id": org_id,
            "x-user-id": user_id
        }
        self._low_codes_cache = {}
        self._rd_ler_cache = None
        self._cache_time = {}
        self.cache_duration = timedelta(days=7)  # Waste codes rarely change

    def get_low_codes(self, region):
        """Get LOW codes with caching"""

        if (region not in self._cache_time or
            datetime.now() - self._cache_time[region] > self.cache_duration):
            self._refresh_low_codes(region)

        return self._low_codes_cache.get(region, [])

    def _refresh_low_codes(self, region):
        """Refresh LOW codes cache"""

        response = requests.get(
            "https://api.dcycle.io/api/v1/wastes/low_codes",
            headers=self.headers,
            params={"waste_region": region}
        )

        codes = response.json()
        self._low_codes_cache[region] = codes
        self._cache_time[region] = datetime.now()

        print(f"✅ LOW codes cache refreshed for {region}: {len(codes)} codes")

    def get_rd_ler_mapping(self):
        """Get RD-LER mapping with caching"""

        if (self._rd_ler_cache is None or
            datetime.now() - self._cache_time.get('rd_ler', datetime.min) > self.cache_duration):
            self._refresh_rd_ler_mapping()

        return self._rd_ler_cache

    def _refresh_rd_ler_mapping(self):
        """Refresh RD-LER mapping cache"""

        response = requests.get(
            "https://api.dcycle.io/api/v1/wastes/rd_ler_list",
            headers=self.headers
        )

        self._rd_ler_cache = response.json()
        self._cache_time['rd_ler'] = datetime.now()

        print(f"✅ RD-LER mapping cache refreshed: {len(self._rd_ler_cache)} methods")

    def get_low_code_by_id(self, low_id, region):
        """Get specific LOW code by ID"""

        codes = self.get_low_codes(region)
        for code in codes:
            if code['low_id'] == low_id:
                return code
        return None

    def search_low_codes(self, query, region):
        """Search LOW codes by name or code"""

        codes = self.get_low_codes(region)
        query_lower = query.lower()

        results = []
        for code in codes:
            if (query_lower in code['low_code'].lower() or
                query_lower in code['low_name'].lower()):
                results.append(code)

        return results

# Usage
cache = WasteCodesCache(
    api_key=os.getenv("DCYCLE_API_KEY"),
    org_id=os.getenv("DCYCLE_ORG_ID"),
    user_id=os.getenv("DCYCLE_USER_ID")
)

# Search for plastic-related waste codes
plastic_wastes = cache.search_low_codes("plastic", "ES")
print(f"Found {len(plastic_wastes)} plastic waste codes")

Validate Waste Code Before Creating Waste

Ensure the waste code exists before creating a waste record:
def validate_waste_code(low_code, region):
    """Validate that a waste code exists in the region"""

    response = requests.get(
        "https://api.dcycle.io/api/v1/wastes/low_codes",
        headers=headers,
        params={"waste_region": region}
    )

    waste_codes = response.json()

    # Check if code exists
    for waste in waste_codes:
        if waste['low_code'] == low_code:
            return waste['low_id']

    raise ValueError(f"Waste code '{low_code}' not found in region '{region}'")

# Usage
try:
    low_id = validate_waste_code("15 01 02", "ES")
    print(f"✅ Valid waste code, LOW ID: {low_id}")
except ValueError as e:
    print(f"❌ {e}")

Waste Code Categories

LER Code Structure

LER codes follow a 6-digit hierarchical structure: XX XX XX
  • First 2 digits: Waste source/activity
  • Middle 2 digits: Process within activity
  • Last 2 digits: Specific waste type
Example: 15 01 02
  • 15 - Waste packaging materials
  • 01 - Packaging
  • 02 - Plastic packaging

Common LER Categories

Code RangeCategoryExamples
01 XX XXMining and quarryingTailings, excavation waste
02 XX XXAgriculture, forestryOrganic waste, packaging
15 XX XXPackagingPaper, plastic, metal, glass
16 XX XXNot otherwise specifiedBatteries, electronics
17 XX XXConstruction & demolitionConcrete, wood, metal
19 XX XXWaste treatment facilitiesResidues, sludges
20 XX XXMunicipal wasteHousehold waste, garden waste

Hazardous Waste Codes

Codes ending with an asterisk (*) indicate hazardous waste:
  • 17 05 03* - Soil containing dangerous substances
  • 16 06 01* - Lead batteries
  • 15 01 10* - Packaging containing hazardous residues
Hazardous waste requires special handling, disposal methods, and documentation. Check your local regulations.

Disposal Method Codes (RD)

D Codes (Disposal Operations)

CodeDescription
D1Landfill deposit
D5Specially engineered landfill
D10Incineration on land
D13Blending before disposal
D15Storage pending disposal

R Codes (Recovery Operations)

CodeDescription
R1Energy recovery / fuel use
R3Organic substance recycling
R4Metal recycling
R5Inorganic material recycling
R12Pre-treatment before recovery
R13Storage pending recovery

Best Practices

1. Cache Reference Data

Waste codes rarely change, so cache them for extended periods:
# Good - Cache for 7 days
cache = WasteCodesCache()
codes = cache.get_low_codes("ES")

# Bad - Fetch every time
codes = requests.get("https://api.dcycle.io/api/v1/wastes/low_codes?waste_region=ES")

2. Use Region-Specific Codes

Always filter by the correct region:
# Good - Use facility's region
facility_region = "ES"
codes = get_low_codes(waste_region=facility_region)

# Bad - Use wrong region
codes = get_low_codes(waste_region="US")  # Wrong region for Spanish facility

3. Store LOW IDs, Not Codes

When creating waste records, use the low_id, not the low_code:
# Good - Use UUID
waste_data = {
    "low_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    # ... other fields
}

# Bad - Use code string (won't work)
waste_data = {
    "low_code": "15 01 02",  # API expects low_id
    # ... other fields
}

4. Validate Before Creating Waste

Always validate that the waste code exists before submitting:
def create_waste_safely(low_code, region, quantity, **kwargs):
    # 1. Validate code exists
    low_id = validate_waste_code(low_code, region)

    # 2. Create waste with validated ID
    waste_data = {
        "low_id": low_id,
        "quantity": quantity,
        **kwargs
    }

    response = requests.post(
        "https://api.dcycle.io/api/v1/wastes",
        headers=headers,
        json=waste_data
    )

    return response.json()