PHPackages                             lanos/laravel-property-data - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. lanos/laravel-property-data

ActiveLibrary

lanos/laravel-property-data
===========================

A Laravel package for handling UK property data

v1.0.2(9mo ago)20MITPHPPHP ^8.1CI passing

Since Aug 9Pushed 9mo agoCompare

[ Source](https://github.com/l4nos/Laravel-PropertyData-UK)[ Packagist](https://packagist.org/packages/lanos/laravel-property-data)[ Docs](https://github.com/l4nos/laravel-property-data)[ RSS](/packages/lanos-laravel-property-data/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (13)Versions (4)Used By (0)

Laravel Property Data
=====================

[](#laravel-property-data)

[![Latest Version on Packagist](https://camo.githubusercontent.com/0b9f6167e0759c2b9d1964365408f8a47a8e43c08d2425178d29b0f951f26cdc/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6c616e6f732f6c61726176656c2d70726f70657274792d646174612e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/lanos/laravel-property-data)[![Total Downloads](https://camo.githubusercontent.com/b4ab6023bd5bef9cb053adb7bda2d1b0b76b19df6a95e203b233421e3bc80a21/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6c616e6f732f6c61726176656c2d70726f70657274792d646174612e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/lanos/laravel-property-data)[![PHP Version](https://camo.githubusercontent.com/8ae35dee3dff8baa23e068047616f882e470aad0c6d8f491cbcb55db61314272/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f6c616e6f732f6c61726176656c2d70726f70657274792d646174612e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/lanos/laravel-property-data)[![Laravel Version](https://camo.githubusercontent.com/3d953ac8e0d58687c735e8d41b1c0326b816027906d199834b12d3feb3310f44/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c61726176656c2d31302e7825323025374325323031312e782d6f72616e67652e7376673f7374796c653d666c61742d737175617265)](https://laravel.com)[![Tests](https://github.com/l4nos/Laravel-PropertyData-UK/actions/workflows/tests.yml/badge.svg)](https://github.com/l4nos/Laravel-PropertyData-UK/actions/workflows/tests.yml)

A comprehensive Laravel package for integrating with the PropertyData UK property data API. This package provides a clean, intuitive interface for accessing UK property market data, valuations, planning information, and area analytics.

📋 Table of Contents
-------------------

[](#-table-of-contents)

- [About PropertyData API](#about-propertydata-api)
- [Features](#features)
- [Requirements](#requirements)
- [Installation](#installation)
- [Configuration](#configuration)
- [Quick Start](#quick-start)
- [Available Methods](#available-methods)
- [Usage Examples](#usage-examples)
- [Error Handling](#error-handling)
- [Testing](#testing)
- [Changelog](#changelog)
- [Contributing](#contributing)
- [Security](#security)
- [Credits](#credits)
- [License](#license)
- [Disclaimer](#disclaimer)

About PropertyData API
----------------------

[](#about-propertydata-api)

This package integrates with the **PropertyData API** - a comprehensive UK property data service.

⚠️ **Important**: You need an API key to use this package.

👉 **Get your API key at: **

📚 **API Documentation: **

PropertyData provides access to:

- Property valuations and market analytics
- Planning applications and building regulations
- Area demographics and statistics
- Crime data and school information
- Development feasibility calculations
- And much more...

Features
--------

[](#features)

✨ **Key Features:**

- 🏠 **Comprehensive Property Data**: Access sold prices, valuations, rental yields, and market trends
- 📍 **Location Intelligence**: Area demographics, crime statistics, school ratings, and amenities
- 🏗️ **Development Tools**: Development calculators, GDV estimates, build costs, and feasibility analysis
- 📋 **Planning Data**: Planning applications, conservation areas, green belt checks, and listed buildings
- 🔍 **Property Search**: UPRN lookups, address matching, and title searches
- 💰 **Financial Calculators**: Mortgage calculators, stamp duty, and rebuild cost estimates
- 🔄 **Automatic Retry Logic**: Built-in retry mechanism for transient failures
- ✅ **Input Validation**: Comprehensive validation for all API parameters
- 🎯 **Type Safety**: PHP 8.1+ enums for constrained values
- 📝 **Full Laravel Integration**: Service provider, facade, and configuration publishing

Requirements
------------

[](#requirements)

- PHP 8.1 or higher
- Laravel 10.x or 11.x
- Composer
- PropertyData API key (get one at [propertydata.co.uk](https://propertydata.co.uk))

Installation
------------

[](#installation)

### Step 1: Install via Composer

[](#step-1-install-via-composer)

```
composer require lanos/laravel-property-data
```

### Step 2: Publish Configuration (Optional)

[](#step-2-publish-configuration-optional)

The package will auto-register its service provider through Laravel's package discovery. To publish the configuration file:

```
php artisan vendor:publish --tag=property-data-config
```

This will create a `config/property-data.php` configuration file.

### Step 3: Add API Key to Environment

[](#step-3-add-api-key-to-environment)

Add your PropertyData API key to your `.env` file:

```
PROPERTY_DATA_API_KEY=your-api-key-here
```

You can also configure optional settings:

```
# API Configuration
PROPERTY_DATA_API_URL=https://api.propertydata.co.uk
PROPERTY_DATA_API_TIMEOUT=30

# Logging
PROPERTY_DATA_LOGGING_ENABLED=true
PROPERTY_DATA_LOG_CHANNEL=stack

# Retry Configuration
PROPERTY_DATA_RETRY_ENABLED=true
PROPERTY_DATA_RETRY_ATTEMPTS=3
PROPERTY_DATA_RETRY_DELAY=1000
```

Configuration
-------------

[](#configuration)

The configuration file (`config/property-data.php`) contains:

```
return [
    'api' => [
        'base_url' => env('PROPERTY_DATA_API_URL', 'https://api.propertydata.co.uk'),
        'key' => env('PROPERTY_DATA_API_KEY', ''),
        'timeout' => env('PROPERTY_DATA_API_TIMEOUT', 30),

        'retry' => [
            'enabled' => env('PROPERTY_DATA_RETRY_ENABLED', true),
            'max_attempts' => env('PROPERTY_DATA_RETRY_ATTEMPTS', 3),
            'delay' => env('PROPERTY_DATA_RETRY_DELAY', 1000), // milliseconds
        ],
    ],

    'logging' => [
        'enabled' => env('PROPERTY_DATA_LOGGING_ENABLED', true),
        'channel' => env('PROPERTY_DATA_LOG_CHANNEL', config('logging.default')),
    ],
];
```

Quick Start
-----------

[](#quick-start)

### Using the Facade

[](#using-the-facade)

```
use PropertyData;

// Get property valuation
$valuation = PropertyData::valuationSale('SW1A 1AA', beds: 3, sqft: 1200);

// Get area demographics
$demographics = PropertyData::demographics(postcode: 'SW1A 1AA');

// Check planning applications
$planning = PropertyData::planningApplications(postcode: 'SW1A 1AA');
```

### Using Dependency Injection

[](#using-dependency-injection)

```
use Lanos\LaravelPropertyData\LaravelPropertyData;

class PropertyController extends Controller
{
    public function __construct(
        private LaravelPropertyData $propertyData
    ) {}

    public function show(string $postcode)
    {
        $data = $this->propertyData->prices($postcode);

        return view('property.show', compact('data'));
    }
}
```

Available Methods
-----------------

[](#available-methods)

### 📍 Address &amp; UPRN Methods

[](#-address--uprn-methods)

```
// Match address to UPRN
$uprns = PropertyData::addressMatchUprn('123 Example Street, London, SW1A 1AA');

// Lookup property by UPRN
$property = PropertyData::uprn('123456789012');

// Lookup multiple UPRNs
$properties = PropertyData::uprns(['123456789012', '123456789013']);

// Get Land Registry title for UPRN
$title = PropertyData::uprnTitle('123456789012');
```

### 💰 Market Data Methods

[](#-market-data-methods)

```
// Current asking prices
$prices = PropertyData::prices('SW1A 1AA', page: 1, perPage: 20);

// Prices per square foot
$pricesPerSqf = PropertyData::pricesPerSqf('SW1A 1AA');

// Sold prices from Land Registry
$soldPrices = PropertyData::soldPrices('SW1A 1AA');

// Rental market statistics
$rents = PropertyData::rents('SW1A 1AA');

// HMO rent estimates
$hmoRents = PropertyData::rentsHmo('SW1A 1AA');

// Yield calculations
$yields = PropertyData::yields('SW1A 1AA');

// Price growth metrics
$growth = PropertyData::growth('SW1A 1AA');

// Property demand analytics
$demand = PropertyData::demand(postcode: 'SW1A 1AA');
```

### 🏠 Valuation Methods

[](#-valuation-methods)

```
// Instant sale valuation
$valuation = PropertyData::valuationSale('SW1A 1AA', beds: 3, sqft: 1200);

// Rent valuation
$rentValuation = PropertyData::valuationRent('SW1A 1AA');

// HMO valuation
$hmoValuation = PropertyData::valuationHmo('SW1A 1AA');

// Historical valuations
$history = PropertyData::valuationHistorical('SW1A 1AA', page: 1);
```

### 🏗️ Development Methods

[](#️-development-methods)

```
use Lanos\LaravelPropertyData\Enums\ProjectType;
use Lanos\LaravelPropertyData\Enums\FinishQuality;

// Development feasibility calculator
$feasibility = PropertyData::developmentCalculator(
    postcode: 'SW1A 1AA',
    purchasePrice: 500000,
    sqftPreDevelopment: 1000,
    sqftPostDevelopment: 1500,
    projectType: ProjectType::REFURBISH,
    finishQuality: FinishQuality::PREMIUM,
    town: 'London' // optional
);

// Gross Development Value estimate
$gdv = PropertyData::developmentGdv(
    postcode: 'SW1A 1AA',
    town: 'London',
    flat0: 0,        // Studio flats
    flat1: 2,        // 1-bed flats
    flat2: 3,        // 2-bed flats
    flat3: 1,        // 3-bed flats
    flat4: 0,        // 4-bed flats
    terracedHouse2: 0,  // 2-bed terraced houses
    terracedHouse3: 2,  // 3-bed terraced houses
    terracedHouse4: 1,  // 4-bed terraced houses
    terracedHouse5: 0   // 5-bed terraced houses
);

// Build cost data
$buildCost = PropertyData::buildCost('SW1A 1AA');

// Rebuild cost calculator
$rebuildCost = PropertyData::rebuildCost(
    postcode: 'SW1A 1AA',
    internalArea: 1200,
    siteQuality: 'good',
    propertyType: 'detached',
    complexity: 'standard',
    storeys: 2
);
```

### 📋 Planning &amp; Regulatory Methods

[](#-planning--regulatory-methods)

```
use Lanos\LaravelPropertyData\Enums\DecisionRating;

// Planning applications
$planning = PropertyData::planningApplications(
    postcode: 'SW1A 1AA',
    decisionRating: DecisionRating::POSITIVE,
    category: 'residential',
    maxAge: 365
);

// Check if in Area of Outstanding Natural Beauty
$aonb = PropertyData::aonb(postcode: 'SW1A 1AA');

// Check if in conservation area
$conservation = PropertyData::conservationArea(postcode: 'SW1A 1AA');

// Check if in green belt
$greenBelt = PropertyData::greenBelt(postcode: 'SW1A 1AA');

// Check if in national park
$nationalPark = PropertyData::nationalPark(postcode: 'SW1A 1AA');

// Get listed buildings
$listedBuildings = PropertyData::listedBuildings('SW1A 1AA');
```

### 📊 Area Information Methods

[](#-area-information-methods)

```
// Area type classification (rural/urban)
$areaType = PropertyData::areaType('SW1A 1AA');

// Council tax information
$councilTax = PropertyData::councilTax(postcode: 'SW1A 1AA');

// Crime statistics
$crime = PropertyData::crime(postcode: 'SW1A 1AA');

// Demographics
$demographics = PropertyData::demographics(postcode: 'SW1A 1AA');

// Flood risk
$floodRisk = PropertyData::floodRisk(postcode: 'SW1A 1AA');

// Household income
$income = PropertyData::householdIncome('SW1A 1AA');

// Internet speed
$internetSpeed = PropertyData::internetSpeed('SW1A 1AA');

// Local Housing Allowance rate
$lhaRate = PropertyData::lhaRate('SW1A 1AA');

// Population statistics
$population = PropertyData::population('SW1A 1AA');

// Political representation
$politics = PropertyData::politics('SW1A 1AA');

// PTAL score (London only)
$ptal = PropertyData::ptal('SW1A 1AA');

// Key statistics by postcode
$keyStats = PropertyData::postcodeKeyStats('SW1A 1AA');
```

### 🏪 Amenities Methods

[](#-amenities-methods)

```
// Nearby restaurants
$restaurants = PropertyData::restaurants(
    postcode: 'SW1A 1AA',
    page: 1,
    perPage: 20
);

// Nearby schools
$schools = PropertyData::schools(postcode: 'SW1A 1AA');
```

### 📄 Document Methods

[](#-document-methods)

```
// Land Registry documents
$documents = PropertyData::landRegistryDocuments(
    title: 'DN123456',
    uprn: '123456789012'
);

// Site plan documents
$sitePlans = PropertyData::sitePlanDocuments('SW1A 1AA', page: 1, perPage: 20);
```

### 💳 Financial Calculators

[](#-financial-calculators)

```
// Mortgage calculator
$mortgage = PropertyData::mortgageCalculator(
    price: 500000,
    deposit: 100000,
    rate: 5.5,
    termYears: 25
);

// Current mortgage rates
$rates = PropertyData::mortgageRates();

// Stamp Duty calculator
$stampDuty = PropertyData::stampDutyCalculator(
    price: 500000,
    buyerType: 'first-time'
);
```

### 🔧 Account Methods

[](#-account-methods)

```
// Get API credits information
$credits = PropertyData::accountCredits();

// Get account documents
$documents = PropertyData::accountDocuments(page: 1, perPage: 20);

// Test API connection
$isConnected = PropertyData::testConnection();
```

Usage Examples
--------------

[](#usage-examples)

### Example 1: Property Investment Analysis

[](#example-1-property-investment-analysis)

```
use PropertyData;
use Lanos\LaravelPropertyData\Enums\ProjectType;
use Lanos\LaravelPropertyData\Enums\FinishQuality;

class PropertyInvestmentService
{
    public function analyzeInvestment(string $postcode, float $purchasePrice)
    {
        // Get current market data
        $prices = PropertyData::prices($postcode);
        $yields = PropertyData::yields($postcode);
        $demand = PropertyData::demand(postcode: $postcode);

        // Get area information
        $crime = PropertyData::crime(postcode: $postcode);
        $schools = PropertyData::schools(postcode: $postcode);
        $demographics = PropertyData::demographics(postcode: $postcode);

        // Calculate development potential
        $feasibility = PropertyData::developmentCalculator(
            postcode: $postcode,
            purchasePrice: $purchasePrice,
            sqftPreDevelopment: 1000,
            sqftPostDevelopment: 1400,
            projectType: ProjectType::REFURBISH,
            finishQuality: FinishQuality::MEDIUM
        );

        return [
            'market' => [
                'prices' => $prices,
                'yields' => $yields,
                'demand' => $demand,
            ],
            'area' => [
                'crime' => $crime,
                'schools' => $schools,
                'demographics' => $demographics,
            ],
            'development' => $feasibility,
        ];
    }
}
```

### Example 2: Property Due Diligence

[](#example-2-property-due-diligence)

```
use PropertyData;

class PropertyDueDiligenceService
{
    public function performDueDiligence(string $uprn)
    {
        // Get property details
        $property = PropertyData::uprn($uprn);
        $title = PropertyData::uprnTitle($uprn);

        // Get planning information
        $planning = PropertyData::planningApplications(
            postcode: $property['postcode']
        );

        // Check restrictions
        $checks = [
            'conservation_area' => PropertyData::conservationArea(
                postcode: $property['postcode']
            ),
            'green_belt' => PropertyData::greenBelt(
                postcode: $property['postcode']
            ),
            'listed_buildings' => PropertyData::listedBuildings(
                $property['postcode']
            ),
            'flood_risk' => PropertyData::floodRisk(
                postcode: $property['postcode']
            ),
        ];

        // Get documents
        $documents = PropertyData::landRegistryDocuments(
            uprn: $uprn
        );

        return [
            'property' => $property,
            'title' => $title,
            'planning' => $planning,
            'restrictions' => $checks,
            'documents' => $documents,
        ];
    }
}
```

### Example 3: Location-Based Search

[](#example-3-location-based-search)

```
use PropertyData;

class LocationSearchService
{
    public function searchByCoordinates(float $lat, float $lng)
    {
        $location = "$lat,$lng";

        // Get area data using coordinates
        $demand = PropertyData::demand(location: $location);
        $agents = PropertyData::agents(location: $location);
        $crime = PropertyData::crime(location: $location);
        $restaurants = PropertyData::restaurants(location: $location);
        $schools = PropertyData::schools(location: $location);

        return compact('demand', 'agents', 'crime', 'restaurants', 'schools');
    }

    public function searchByWhat3Words(string $w3w)
    {
        // Get area data using What3Words
        $demand = PropertyData::demand(w3w: $w3w);
        $planning = PropertyData::planningApplications(w3w: $w3w);

        return compact('demand', 'planning');
    }
}
```

Error Handling
--------------

[](#error-handling)

The package includes comprehensive error handling with specific exception types:

### Exception Types

[](#exception-types)

- `PropertyDataApiException` - Base exception for all API errors
- `PropertyDataAuthenticationException` - Invalid API key or authentication failed
- `PropertyDataConnectionException` - Network connection issues
- `PropertyDataServerException` - API server errors (5xx responses)
- `PropertyDataRateLimitException` - Rate limit exceeded (currently unused as API has no rate limits)

### Handling Exceptions

[](#handling-exceptions)

```
use Lanos\LaravelPropertyData\Exceptions\PropertyDataAuthenticationException;
use Lanos\LaravelPropertyData\Exceptions\PropertyDataConnectionException;
use Lanos\LaravelPropertyData\Exceptions\PropertyDataApiException;

try {
    $data = PropertyData::prices('SW1A 1AA');
} catch (PropertyDataAuthenticationException $e) {
    // Handle authentication error
    Log::error('Invalid API key: ' . $e->getMessage());
} catch (PropertyDataConnectionException $e) {
    // Handle connection error
    Log::error('Connection failed: ' . $e->getMessage());
} catch (PropertyDataApiException $e) {
    // Handle general API error
    Log::error('API error: ' . $e->getMessage());
}
```

### Input Validation

[](#input-validation)

The package validates all inputs before making API calls:

```
try {
    // This will throw an InvalidArgumentException
    $data = PropertyData::prices('INVALID_POSTCODE');
} catch (\InvalidArgumentException $e) {
    // Handle validation error
    echo $e->getMessage(); // "Invalid UK postcode format..."
}
```

### Automatic Retry Logic

[](#automatic-retry-logic)

The package automatically retries failed requests for transient errors:

- Connection failures
- Server errors (5xx responses)
- Uses exponential backoff (1s, 2s, 4s...)
- Maximum 3 attempts by default
- Configurable via environment variables

Testing
-------

[](#testing)

### Running Tests

[](#running-tests)

```
composer test
```

### Test Coverage

[](#test-coverage)

```
composer test-coverage
```

### Static Analysis

[](#static-analysis)

```
composer analyse
```

### Code Formatting

[](#code-formatting)

```
composer format
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details on how to contribute to this package.

### Development Setup

[](#development-setup)

1. Fork the repository
2. Clone your fork
3. Install dependencies: `composer install`
4. Create a feature branch: `git checkout -b feature/my-feature`
5. Make your changes
6. Run tests: `composer test`
7. Submit a pull request

Security
--------

[](#security)

If you discover any security-related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [L4nos](https://github.com/l4nos)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

Disclaimer
----------

[](#disclaimer)

⚠️ **IMPORTANT NOTICE**

This package is an independent integration library for the PropertyData API. We are not affiliated with, endorsed by, or connected to PropertyData or its parent company.

- This package serves solely as a client interface to integrate with the PropertyData API
- We do not own, operate, or have any control over the PropertyData API
- All property data, valuations, and information are provided by PropertyData
- We are not responsible for the accuracy, completeness, or reliability of data returned by the API
- Users must obtain their own API key directly from PropertyData

For official API documentation and support, please visit

### Data Usage

[](#data-usage)

Please ensure you comply with PropertyData's terms of service and data usage policies when using this package. The package authors assume no responsibility for how you use the data obtained through the API.

### No Warranty

[](#no-warranty)

This package is provided "as is" without warranty of any kind, either expressed or implied. See the LICENSE file for full disclaimer of warranties.

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance61

Regular maintenance activity

Popularity3

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity46

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

3

Last Release

273d ago

PHP version history (2 changes)v1.0.0PHP ^8.1

v1.0.1PHP ^8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/06c9e88990d6fc4ceeca54935392f46b9cec2ded8c4a858100b05f0a4d8e4e69?d=identicon)[l4nos](/maintainers/l4nos)

---

Top Contributors

[![l4nos](https://avatars.githubusercontent.com/u/31861108?v=4)](https://github.com/l4nos "l4nos (5 commits)")

---

Tags

laraveldatapropertyreal-estateuk

###  Code Quality

TestsPest

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/lanos-laravel-property-data/health.svg)

```
[![Health](https://phpackages.com/badges/lanos-laravel-property-data/health.svg)](https://phpackages.com/packages/lanos-laravel-property-data)
```

###  Alternatives

[laravel/socialite

Laravel wrapper around OAuth 1 &amp; OAuth 2 libraries.

5.7k96.9M672](/packages/laravel-socialite)[laravel/boost

Laravel Boost accelerates AI-assisted development by providing the essential context and structure that AI needs to generate high-quality, Laravel-specific code.

3.4k10.6M272](/packages/laravel-boost)[spatie/laravel-health

Monitor the health of a Laravel application

85810.0M83](/packages/spatie-laravel-health)[laravel-notification-channels/telegram

Telegram Notifications Channel for Laravel

1.1k3.4M35](/packages/laravel-notification-channels-telegram)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9682.1M97](/packages/roots-acorn)[laravel-zero/framework

The Laravel Zero Framework.

3371.4M368](/packages/laravel-zero-framework)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
