🗂️ API Documentation

Wiltshire Council Waste Collection API

📋 NAV
📋 NAV

📖 Overview

This documentation covers the Wiltshire Council Waste Collection API, which provides both property lookup and waste collection data in a single, integrated system:

🗑️ Wiltshire Council Waste Collection API

Purpose: Complete solution for UK property lookup and waste collection schedules

Features: Address lookup by postcode + waste collection dates in one API

Use Case: Get property addresses and their waste collection schedules for any Wiltshire postcode

Authentication: No API key required, but requires proper headers

� Simplified Workflow: Just provide a postcode to the Wiltshire Council API and get back both property addresses and waste collection schedules - no need for multiple API calls!

📋 What happened to external APIs?

Good news! The Wiltshire Council API now provides everything you need:

  • ✅ Property address lookup by postcode
  • ✅ Property reference data
  • ✅ Waste collection schedules
  • ✅ All from a single, reliable source

This means faster responses, fewer dependencies, and more reliable data since everything comes directly from the council.

🗑️ Wiltshire Council Waste Collection API

⚠️ Important: This API requires specific headers to mimic AJAX requests. Missing headers will result in errors or unexpected responses.

📡 Endpoints

POST https://ilforms.wiltshire.gov.uk/wastecollectiondays/addresslist

Address List Parameters

Parameter Type Required Description Example
Postcode string Required UK postcode with spaces BA14 7RS

Required Headers

X-Requested-With: XMLHttpRequest
Content-Type: application/x-www-form-urlencoded
Referer: https://ilforms.wiltshire.gov.uk/wastecollectiondays
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36
POST https://ilforms.wiltshire.gov.uk/wastecollectiondays/wastecollectioncalendar

Collection Calendar Parameters

Parameter Type Required Description Example
Postcode string Required UK postcode with spaces BA14 7RS
PropertyRef string Required 12-digit property reference (zero-padded) 100121089508
Month integer Required Month number (1-12) 7
Year integer Required 4-digit year 2025

Response Format

✅ Address List Response:
{
  "Model": {
    "PostcodeAddresses": [
      {
        "PropertyRef": "100121089508",
        "Address": "1 EXAMPLE ROAD, TROWBRIDGE, BA14 7RS"
      }
    ]
  }
}
✅ Collection Calendar Response (HTML with embedded JSON):
modelData = {
  "MonthCollectionDates": [
    {
      "Date": "/Date(1753459200000)/",
      "DateString": "25/7/2025 12:00:00 AM",
      "RoundTypeName": "Household waste",
      "RoundTypeCode": "HW",
      "IsInTheFuture": true
    }
  ]
};

🚀 Basic API Examples

Simple examples showing how to call the Wiltshire Council API endpoints directly:

cURL Commands

# Test address lookup
curl -X POST \
     -H "X-Requested-With: XMLHttpRequest" \
     -H "Content-Type: application/x-www-form-urlencoded" \
     -d "Postcode=BA14 7RS" \
     "https://ilforms.wiltshire.gov.uk/wastecollectiondays/addresslist"

# Test collection lookup
curl -X POST \
     -H "X-Requested-With: XMLHttpRequest" \
     -H "Content-Type: application/x-www-form-urlencoded" \
     -d "Postcode=BA14 7RS&PropertyRef=100121089508&Month=7&Year=2025" \
     "https://ilforms.wiltshire.gov.uk/wastecollectiondays/wastecollectioncalendar"
✨ Quick Test: Use these cURL commands to verify the API is working before implementing in your chosen language.

💻 Code Examples

Here are comprehensive examples in multiple programming languages for integrating with the Wiltshire Council API:

🐘 PHP Examples

Address Lookup

// Get addresses for a postcode from Wiltshire Council
function getWiltshireAddresses($postcode) {
    $url    = 'https://ilforms.wiltshire.gov.uk/wastecollectiondays/addresslist';
    $params = [
        'Postcode' => $postcode
    ];
    
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL,            $url);
    curl_setopt($ch, CURLOPT_POST,           true);
    curl_setopt($ch, CURLOPT_POSTFIELDS,     http_build_query($params));
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($ch, CURLOPT_TIMEOUT,        10);
    curl_setopt($ch, CURLOPT_HTTPHEADER, [
        'X-Requested-With: XMLHttpRequest',
        'Content-Type: application/x-www-form-urlencoded',
        'Referer: https://ilforms.wiltshire.gov.uk/wastecollectiondays'
    ]);
    
    $response = curl_exec($ch);
    $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
    curl_close($ch);
    
    if ($httpCode === 200) {
        $data = json_decode($response, true);
        return $data['Model']['PostcodeAddresses'] ?? [];
    }
    
    throw new Exception("Failed to fetch addresses");
}

Collection Lookup

// Get waste collection data for a specific property
function getWasteCollections($propertyRef, $postcode, $month, $year) {
    $url    = 'https://ilforms.wiltshire.gov.uk/wastecollectiondays/wastecollectioncalendar';
    $params = [
        'Postcode'    => $postcode,
        'PropertyRef' => str_pad($propertyRef, 12, '0', STR_PAD_LEFT),
        'Month'       => $month,
        'Year'        => $year
    ];
    
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL,            $url);
    curl_setopt($ch, CURLOPT_POST,           true);
    curl_setopt($ch, CURLOPT_POSTFIELDS,     http_build_query($params));
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($ch, CURLOPT_TIMEOUT,        10);
    curl_setopt($ch, CURLOPT_HTTPHEADER, [
        'X-Requested-With: XMLHttpRequest',
        'Content-Type: application/x-www-form-urlencoded',
        'Referer: https://ilforms.wiltshire.gov.uk/wastecollectiondays'
    ]);
    
    $response = curl_exec($ch);
    curl_close($ch);
    
    // Extract JSON data from HTML response
    if (preg_match('/modelData\s*=\s*({.*?});/', $response, $matches)) {
        $jsonData = json_decode($matches[1], true);
        return $jsonData['MonthCollectionDates'] ?? [];
    }
    
    return [];
}

🟢 Node.js Examples

Using fetch (Node.js 18+)

// Get addresses for a postcode using Node.js fetch
async function getWiltshireAddresses(postcode) {
    const url = 'https://ilforms.wiltshire.gov.uk/wastecollectiondays/addresslist';
    const params = new URLSearchParams({
        'Postcode': postcode
    });

    try {
        const response = await fetch(url, {
            method: 'POST',
            headers: {
                'X-Requested-With': 'XMLHttpRequest',
                'Content-Type': 'application/x-www-form-urlencoded',
                'Referer': 'https://ilforms.wiltshire.gov.uk/wastecollectiondays',
                'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36'
            },
            body: params
        });

        if (!response.ok) {
            throw new Error(`HTTP error! status: ${response.status}`);
        }

        const data = await response.json();
        return data.Model?.PostcodeAddresses || [];
    } catch (error) {
        console.error('Error fetching addresses:', error);
        throw error;
    }
}

Using axios

// npm install axios
const axios = require('axios');

async function getWasteCollections(propertyRef, postcode, month, year) {
    const url = 'https://ilforms.wiltshire.gov.uk/wastecollectiondays/wastecollectioncalendar';
    
    // Pad property reference to 12 digits
    const paddedRef = propertyRef.toString().padStart(12, '0');
    
    const params = new URLSearchParams({
        'Postcode': postcode,
        'PropertyRef': paddedRef,
        'Month': month.toString(),
        'Year': year.toString()
    });

    try {
        const response = await axios.post(url, params, {
            headers: {
                'X-Requested-With': 'XMLHttpRequest',
                'Content-Type': 'application/x-www-form-urlencoded',
                'Referer': 'https://ilforms.wiltshire.gov.uk/wastecollectiondays'
            },
            timeout: 10000
        });

        // Extract JSON from HTML response
        const match = response.data.match(/modelData\s*=\s*({.*?});/);
        if (match) {
            const jsonData = JSON.parse(match[1]);
            return jsonData.MonthCollectionDates || [];
        }
        
        return [];
    } catch (error) {
        console.error('Error fetching collections:', error);
        throw error;
    }
}

Complete Express.js API Example

// npm install express cors
const express = require('express');
const cors = require('cors');
const app = express();

app.use(cors());
app.use(express.json());

// API endpoint to get addresses by postcode
app.get('/api/addresses/:postcode', async (req, res) => {
    try {
        const addresses = await getWiltshireAddresses(req.params.postcode);
        res.json({ success: true, addresses });
    } catch (error) {
        res.status(500).json({ success: false, error: error.message });
    }
});

// API endpoint to get waste collections
app.get('/api/collections/:propertyRef/:postcode/:month/:year', async (req, res) => {
    try {
        const { propertyRef, postcode, month, year } = req.params;
        const collections = await getWasteCollections(propertyRef, postcode, 
            parseInt(month), parseInt(year));
        res.json({ success: true, collections });
    } catch (error) {
        res.status(500).json({ success: false, error: error.message });
    }
});

app.listen(3000, () => {
    console.log('API server running on port 3000');
});

🟨 JavaScript (Browser) Examples

Modern Fetch API

// Get addresses using modern JavaScript fetch
async function getAddressesForPostcode(postcode) {
    const url = 'https://ilforms.wiltshire.gov.uk/wastecollectiondays/addresslist';
    
    const formData = new FormData();
    formData.append('Postcode', postcode);

    try {
        const response = await fetch(url, {
            method: 'POST',
            headers: {
                'X-Requested-With': 'XMLHttpRequest',
                'Referer': 'https://ilforms.wiltshire.gov.uk/wastecollectiondays'
            },
            body: formData
        });

        if (!response.ok) {
            throw new Error(`HTTP error! status: ${response.status}`);
        }

        const data = await response.json();
        return data.Model?.PostcodeAddresses || [];
    } catch (error) {
        console.error('Error:', error);
        throw error;
    }
}

// Usage example
getAddressesForPostcode('BA14 7RS')
    .then(addresses => {
        console.log('Found addresses:', addresses);
        // Update DOM with results
        displayAddresses(addresses);
    })
    .catch(error => {
        console.error('Failed to get addresses:', error);
    });

jQuery AJAX (Legacy Support)

// Using jQuery for older browser support
function getWasteCollectionsJQuery(propertyRef, postcode, month, year) {
    const paddedRef = propertyRef.toString().padStart(12, '0');
    
    return $.ajax({
        url: 'https://ilforms.wiltshire.gov.uk/wastecollectiondays/wastecollectioncalendar',
        type: 'POST',
        data: {
            'Postcode': postcode,
            'PropertyRef': paddedRef,
            'Month': month,
            'Year': year
        },
        headers: {
            'X-Requested-With': 'XMLHttpRequest',
            'Referer': 'https://ilforms.wiltshire.gov.uk/wastecollectiondays'
        },
        timeout: 10000
    }).then(function(response) {
        // Extract JSON from HTML response
        const match = response.match(/modelData\s*=\s*({.*?});/);
        if (match) {
            const jsonData = JSON.parse(match[1]);
            return jsonData.MonthCollectionDates || [];
        }
        return [];
    });
}

// Usage with promises
getWasteCollectionsJQuery('100121089508', 'BA14 7RS', 7, 2025)
    .done(function(collections) {
        console.log('Collections:', collections);
        displayCollections(collections);
    })
    .fail(function(error) {
        console.error('Error:', error);
    });

Complete Frontend Example

// Complete waste collection lookup widget
class WasteCollectionLookup {
    constructor(containerId) {
        this.container = document.getElementById(containerId);
        this.init();
    }

    init() {
        this.container.innerHTML = `
            <div class="waste-lookup">
                <input type="text" id="postcode-input" placeholder="Enter postcode (e.g. BA14 7RS)">
                <button id="lookup-btn">Find Addresses</button>
                <div id="addresses-list"></div>
                <div id="collections-result"></div>
            </div>
        `;

        document.getElementById('lookup-btn').addEventListener('click', () => {
            this.lookupAddresses();
        });
    }

    async lookupAddresses() {
        const postcode = document.getElementById('postcode-input').value.trim();
        if (!postcode) return;

        try {
            const addresses = await getAddressesForPostcode(postcode);
            this.displayAddresses(addresses, postcode);
        } catch (error) {
            document.getElementById('addresses-list').innerHTML = 
                `<p style="color: red;">Error: ${error.message}</p>`;
        }
    }

    displayAddresses(addresses, postcode) {
        const container = document.getElementById('addresses-list');
        
        if (addresses.length === 0) {
            container.innerHTML = '<p>No addresses found for this postcode.</p>';
            return;
        }

        const html = addresses.map(addr => `
            <div class="address-item" onclick="wasteWidget.getCollections('${addr.PropertyRef}', '${postcode}')">
                <strong>${addr.Address}</strong>
                <small>Ref: ${addr.PropertyRef}</small>
            </div>
        `).join('');

        container.innerHTML = `<h3>Select an address:</h3>${html}`;
    }

    async getCollections(propertyRef, postcode) {
        // Get current month collections
        const now = new Date();
        try {
            const collections = await getWasteCollections(
                propertyRef, postcode, now.getMonth() + 1, now.getFullYear()
            );
            this.displayCollections(collections);
        } catch (error) {
            document.getElementById('collections-result').innerHTML = 
                `<p style="color: red;">Error fetching collections: ${error.message}</p>`;
        }
    }

    displayCollections(collections) {
        const container = document.getElementById('collections-result');
        
        if (collections.length === 0) {
            container.innerHTML = '<p>No collections found for this month.</p>';
            return;
        }

        const html = collections.map(col => `
            <div class="collection-item">
                <strong>${col.RoundTypeName}</strong>
                <span>${col.DateString}</span>
            </div>
        `).join('');

        container.innerHTML = `<h3>Upcoming Collections:</h3>${html}`;
    }
}

// Initialize the widget
const wasteWidget = new WasteCollectionLookup('waste-container');

🐍 Python Examples

Using requests library

# pip install requests
import requests
import json
import re
from datetime import datetime

def get_wiltshire_addresses(postcode):
    """Get addresses for a postcode from Wiltshire Council API"""
    url = 'https://ilforms.wiltshire.gov.uk/wastecollectiondays/addresslist'
    
    headers = {
        'X-Requested-With': 'XMLHttpRequest',
        'Content-Type': 'application/x-www-form-urlencoded',
        'Referer': 'https://ilforms.wiltshire.gov.uk/wastecollectiondays',
        'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36'
    }
    
    data = {'Postcode': postcode}
    
    try:
        response = requests.post(url, data=data, headers=headers, timeout=10)
        response.raise_for_status()
        
        json_data = response.json()
        return json_data.get('Model', {}).get('PostcodeAddresses', [])
        
    except requests.RequestException as e:
        raise Exception(f"Failed to fetch addresses: {e}")

def get_waste_collections(property_ref, postcode, month, year):
    """Get waste collection data for a specific property"""
    url = 'https://ilforms.wiltshire.gov.uk/wastecollectiondays/wastecollectioncalendar'
    
    # Pad property reference to 12 digits
    padded_ref = str(property_ref).zfill(12)
    
    headers = {
        'X-Requested-With': 'XMLHttpRequest',
        'Content-Type': 'application/x-www-form-urlencoded',
        'Referer': 'https://ilforms.wiltshire.gov.uk/wastecollectiondays'
    }
    
    data = {
        'Postcode': postcode,
        'PropertyRef': padded_ref,
        'Month': month,
        'Year': year
    }
    
    try:
        response = requests.post(url, data=data, headers=headers, timeout=10)
        response.raise_for_status()
        
        # Extract JSON data from HTML response
        match = re.search(r'modelData\s*=\s*({.*?});', response.text)
        if match:
            json_data = json.loads(match.group(1))
            return json_data.get('MonthCollectionDates', [])
        
        return []
        
    except requests.RequestException as e:
        raise Exception(f"Failed to fetch collections: {e}")

Flask API Example

# pip install flask flask-cors
from flask import Flask, jsonify, request
from flask_cors import CORS
from datetime import datetime

app = Flask(__name__)
CORS(app)

@app.route('/api/addresses/<postcode>', methods=['GET'])
def get_addresses_api(postcode):
    """API endpoint to get addresses by postcode"""
    try:
        addresses = get_wiltshire_addresses(postcode)
        return jsonify({
            'success': True,
            'postcode': postcode,
            'addresses': addresses,
            'count': len(addresses)
        })
    except Exception as e:
        return jsonify({
            'success': False,
            'error': str(e)
        }), 500

@app.route('/api/collections', methods=['GET'])
def get_collections_api():
    """API endpoint to get waste collections"""
    property_ref = request.args.get('property_ref')
    postcode = request.args.get('postcode')
    month = request.args.get('month', datetime.now().month)
    year = request.args.get('year', datetime.now().year)
    
    if not property_ref or not postcode:
        return jsonify({
            'success': False,
            'error': 'property_ref and postcode are required'
        }), 400
    
    try:
        collections = get_waste_collections(property_ref, postcode, 
                                          int(month), int(year))
        return jsonify({
            'success': True,
            'property_ref': property_ref,
            'postcode': postcode,
            'month': int(month),
            'year': int(year),
            'collections': collections,
            'count': len(collections)
        })
    except Exception as e:
        return jsonify({
            'success': False,
            'error': str(e)
        }), 500

if __name__ == '__main__':
    app.run(debug=True, port=5000)

Complete Command Line Tool

#!/usr/bin/env python3
"""
Wiltshire Waste Collection CLI Tool
Usage: python waste_lookup.py BA14 7RS
"""

import sys
import argparse
from datetime import datetime
from typing import List, Dict, Any

def parse_dotnet_date(date_string: str) -> str:
    """Parse .NET date format /Date(timestamp)/"""
    import re
    match = re.search(r'/Date\((\d+)\)/', date_string)
    if match:
        timestamp = int(match.group(1)) / 1000  # Convert to seconds
        return datetime.fromtimestamp(timestamp).strftime('%Y-%m-%d')
    return date_string

def main():
    parser = argparse.ArgumentParser(
        description='Lookup waste collection dates for Wiltshire properties'
    )
    parser.add_argument('postcode', help='Postcode to lookup (e.g., "BA14 7RS")')
    parser.add_argument('--property-index', type=int, default=0,
                      help='Property index if multiple addresses found (default: 0)')
    parser.add_argument('--month', type=int, default=datetime.now().month,
                      help='Month to lookup (1-12, default: current month)')
    parser.add_argument('--year', type=int, default=datetime.now().year,
                      help='Year to lookup (default: current year)')
    
    args = parser.parse_args()
    
    try:
        # Get addresses
        print(f"Looking up addresses for postcode: {args.postcode}")
        addresses = get_wiltshire_addresses(args.postcode)
        
        if not addresses:
            print("No addresses found for this postcode.")
            sys.exit(1)
        
        print(f"Found {len(addresses)} address(es):")
        for i, addr in enumerate(addresses):
            print(f"  {i}: {addr['Address']} (Ref: {addr['PropertyRef']})")
        
        # Select property
        if args.property_index >= len(addresses):
            print(f"Property index {args.property_index} out of range.")
            sys.exit(1)
        
        selected_address = addresses[args.property_index]
        print(f"\nSelected: {selected_address['Address']}")
        
        # Get collections
        print(f"Getting collections for {args.month}/{args.year}...")
        collections = get_waste_collections(
            selected_address['PropertyRef'], 
            args.postcode, 
            args.month, 
            args.year
        )
        
        if not collections:
            print("No collections found for this period.")
        else:
            print(f"\nWaste Collections for {args.month}/{args.year}:")
            for collection in collections:
                date_parsed = parse_dotnet_date(collection.get('Date', ''))
                print(f"  {collection['RoundTypeName']}: {date_parsed}")
    
    except Exception as e:
        print(f"Error: {e}")
        sys.exit(1)

if __name__ == '__main__':
    main()

🌐 cURL Examples

Address Lookup

# Get addresses for a postcode
curl -X POST \
     -H "X-Requested-With: XMLHttpRequest" \
     -H "Content-Type: application/x-www-form-urlencoded" \
     -H "Referer: https://ilforms.wiltshire.gov.uk/wastecollectiondays" \
     -d "Postcode=BA14 7RS" \
     "https://ilforms.wiltshire.gov.uk/wastecollectiondays/addresslist"

Collection Calendar

# Get waste collection calendar for a property
curl -X POST \
     -H "X-Requested-With: XMLHttpRequest" \
     -H "Content-Type: application/x-www-form-urlencoded" \
     -H "Referer: https://ilforms.wiltshire.gov.uk/wastecollectiondays" \
     -d "Postcode=BA14 7RS&PropertyRef=100121089508&Month=7&Year=2025" \
     "https://ilforms.wiltshire.gov.uk/wastecollectiondays/wastecollectioncalendar"

PowerShell Examples (Windows)

# PowerShell address lookup
$headers = @{
    'X-Requested-With' = 'XMLHttpRequest'
    'Content-Type' = 'application/x-www-form-urlencoded'
    'Referer' = 'https://ilforms.wiltshire.gov.uk/wastecollectiondays'
}

$body = @{
    'Postcode' = 'BA14 7RS'
}

$response = Invoke-RestMethod -Uri 'https://ilforms.wiltshire.gov.uk/wastecollectiondays/addresslist' `
                              -Method Post `
                              -Headers $headers `
                              -Body $body

$response.Model.PostcodeAddresses | Format-Table Address, PropertyRef

Bash Script Example

#!/bin/bash
# Wiltshire Waste Collection Lookup Script

if [ $# -eq 0 ]; then
    echo "Usage: $0 'POSTCODE'"
    echo "Example: $0 'BA14 7RS'"
    exit 1
fi

POSTCODE="$1"
TEMP_FILE="/tmp/addresses_$$.json"

echo "Looking up addresses for postcode: $POSTCODE"

# Get addresses
curl -s -X POST \
     -H "X-Requested-With: XMLHttpRequest" \
     -H "Content-Type: application/x-www-form-urlencoded" \
     -H "Referer: https://ilforms.wiltshire.gov.uk/wastecollectiondays" \
     -d "Postcode=$POSTCODE" \
     "https://ilforms.wiltshire.gov.uk/wastecollectiondays/addresslist" > "$TEMP_FILE"

# Check if jq is available for JSON parsing
if command -v jq &> /dev/null; then
    echo "Addresses found:"
    jq -r '.Model.PostcodeAddresses[] | "\(.Address) (Ref: \(.PropertyRef))"' "$TEMP_FILE"
else
    echo "Raw response (install jq for better formatting):"
    cat "$TEMP_FILE"
fi

rm "$TEMP_FILE"
💡 Language Selection Tips:

🔧 Complete Integration Examples

Complete Workflow Example

This example shows how to use the Wiltshire Council API to get both property addresses and waste collection data from just a postcode:

<?php
// Simplified workflow: Postcode → Addresses & Collections (single API)

function getCompleteWasteData($postcode) {
    try {
        // Get addresses directly from Wiltshire Council API
        $addresses = getWiltshireAddressesForPostcode($postcode);
        
        if (empty($addresses)) {
            throw new Exception("No addresses found for postcode");
        }
        
        // Use first property reference to get waste collection data from the same API
        $firstAddress = $addresses[0];
        $propertyRef  = $firstAddress['property_ref'];
        
        // Get collections for current and next month (same API call)
        $collections = getWiltshireWasteCollections($propertyRef, $postcode);
        
        return [
            'address'       => $firstAddress['address'],
            'property_ref'  => $propertyRef,
            'collections'   => $collections['next_collections'] ?? [],
            'all_addresses' => $addresses,
            'last_updated'  => $collections['last_updated'] ?? date('Y-m-d H:i:s')
        ];
        
    } catch (Exception $e) {
        return ['error' => $e->getMessage()];
    }
}

// Usage example
$wasteData = getCompleteWasteData('BA14 7RS');

if (isset($wasteData['error'])) {
    echo "Error: " . $wasteData['error'];
} else {
    echo "Address: "          . $wasteData['address'] . "\n";
    echo "Property Ref: "     . $wasteData['property_ref'] . "\n";
    echo "Collections found: " . count($wasteData['collections']) . "\n";
}
?>
💡 Pro Tip: The Wiltshire Council API handles everything in one place! Always handle multiple addresses per postcode since some postcodes can have dozens of properties. Consider showing a selection interface to users for better UX.

🔧 Troubleshooting

Common Issues

Wiltshire Council API

❌ Problem: 400 Bad Request or empty response
✅ Solution: Ensure all required headers are included, especially "X-Requested-With: XMLHttpRequest"
❌ Problem: Collection data not parsing
✅ Solution: Check that property reference is padded to 12 digits with leading zeros
❌ Problem: Date parsing issues
✅ Solution: .NET dates come as "/Date(timestamp)/" - extract number and divide by 1000

Testing Endpoints

Use the cURL commands from the Basic API Examples section to verify Wiltshire Council API connectivity. For more comprehensive testing, check out the examples in multiple programming languages in the Code Examples section.

🔍 Debugging Tips:
  • Always test with cURL first before implementing in code
  • Check HTTP response codes and headers
  • Validate that property references are exactly 12 digits
  • Use browser developer tools to inspect the original council website
⚠️ Rate Limiting: The Wiltshire Council API should be used respectfully. Implement caching and avoid excessive requests to prevent being blocked.