AU Postcode Metro/Non-Metro Classifier

GitHub Repository

You may find the source code and documentation on the GitHub repository:
AU Postcode Metro/Non-Metro Classifier

Overview

An AI-powered edge function that classifies Australian postcodes as metro or non-metro using advanced natural language processing.

API Endpoint

GET /api/postcodes/{postcode}

Example Request

curl https://postcode-metro-check.netlify.app/api/postcodes/3000

Possible Responses

  • metro: Metropolitan area
  • non-metro: Non-metropolitan area
  • unknown: Unable to classify
  • invalid: Invalid postcode format

Local Development

Prerequisites

  • Deno (v1.40+)
  • Netlify CLI
  • OpenRouter API Key

Setup Steps

  1. Clone the repository
    git clone https://github.com/isaacdarcilla/postcode-metro-check
    cd postcode-metro-check
  2. Install Netlify CLI
    npm install -g netlify-cli
  3. Create .env file
    echo "DEEPSEEK_API_KEY=your_openrouter_api_key" > .env
  4. Start local development
    netlify dev

Testing

Use curl or Postman to test the endpoint:

curl http://localhost:8888/api/postcodes/3000

Technical Details

Technologies

  • Netlify Edge Functions
  • Deno Runtime
  • OpenRouter AI
  • DeepSeek Chat Model

Validation

✅ 4-digit Australian postcodes only
🔒 Secure API key management
🌐 CORS enabled

Limitations

  • Relies on AI model accuracy
  • Limited to Australian postcodes

Author

IA

Isaac A.

isaacdarcilla.com