UK Data API
24 UK data endpoints paid via x402 protocol. Property (Land Registry sold prices, rental yields, stamp duty, EPC, crime, flood risk, planning, council tax), weather (current, forecast, historical, air quality), companies (search, profile, officers, filings), vehicles (DVLA, MOT, tax, emissions), finance (interest rates, exchange rates, inflation, mortgage calculator). Agents pay per-request with USDC on Base network β no API keys needed.
Ask AI about UK Data API
Powered by Claude Β· Grounded in docs
I know everything about UK Data API. Ask me about installation, configuration, usage, or troubleshooting.
0/500
Reviews
Documentation
UK Property Data API β Production Version
What This Is
A paid API that lets AI agents (and humans) look up UK property data:
| Endpoint | What It Does | Data Source |
|---|---|---|
/sold-prices | Recent sale prices for a postcode | HM Land Registry (free, public) |
/yield-estimate | Estimated rental yield for a postcode | VOA council tax / rental data |
/stamp-duty | UK Stamp Duty (SDLT) calculation | HMRC rules coded in Python |
Payments are handled by the x402 protocol β an HTTP-native payment standard where AI agents pay per-request using crypto wallets.
How the Code Is Organised
uk-property-api/
β
βββ app/ # All application code lives here
β βββ main.py # The "front door" β starts the server
β βββ config.py # All settings (read from environment variables)
β β
β βββ routes/ # One file per endpoint (URL path)
β β βββ sold_prices.py # /sold-prices
β β βββ yield_estimate.py # /yield-estimate
β β βββ stamp_duty.py # /stamp-duty
β β
β βββ services/ # Business logic (the "brains")
β β βββ land_registry.py # Talks to Land Registry SPARQL API
β β βββ voa_rental.py # Rental yield calculations
β β βββ sdlt.py # Stamp duty maths
β β
β βββ middleware/ # Code that runs BEFORE your endpoints
β β βββ payment.py # x402 payment verification
β β βββ rate_limiter.py # Stops one wallet spamming requests
β β βββ cache.py # Redis caching (saves repeat lookups)
β β
β βββ models/ # Data shapes (what requests/responses look like)
β βββ schemas.py # Pydantic validation models
β
βββ tests/ # Automated tests
β βββ test_sdlt.py # Stamp duty calculation tests
β βββ test_yield.py # Yield estimate tests
β
βββ Makefile # Shortcuts: `make dev`, `make test`, `make deploy`
βββ requirements.txt # Python packages to install
βββ Procfile # Tells Railway how to start the app
βββ railway.toml # Railway-specific settings
βββ .env.example # Template for your secret settings
Quick Start (Local Development)
# 1. Install Python 3.11+ then:
make install
# 2. Copy the example env file and fill in your values
cp .env.example .env
# 3. Start the server locally
make dev
# 4. Open the docs in your browser
# http://localhost:8000/docs
Deploy to Railway
# 1. Install Railway CLI: https://docs.railway.app/guides/cli
# 2. Login and link your project
railway login
railway link
# 3. Add a Redis plugin in the Railway dashboard
# (click "New" β "Database" β "Redis")
# 4. Set your environment variables in Railway dashboard:
# X402_FACILITATOR_URL, PAYMENT_WALLET_ADDRESS, etc.
# 5. Deploy
make deploy
Running Tests
make test
Environment Variables You Need
| Variable | What It Is | Example |
|---|---|---|
REDIS_URL | Redis connection string | redis://default:xxx@host:6379 |
X402_FACILITATOR_URL | x402 payment facilitator | https://x402.org/facilitator |
PAYMENT_WALLET_ADDRESS | Your wallet (receives payments) | 0xYourAddress... |
RATE_LIMIT_PER_MINUTE | Max requests per wallet per minute | 30 |
CACHE_TTL_SECONDS | How long to cache results | 3600 |
LOG_LEVEL | Logging verbosity | INFO |
