Skip to content

forcequit/eircode-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Eircode API

Open-source Cloudflare Worker that geocodes Irish addresses and Eircodes via Google Maps.

This is the standalone API behind eircode.dev. The frontend lives in a separate (closed) repo.

Endpoints

  • GET /health — health check
  • GET /eircode?q=D02+X285 — lookup
  • POST /eircode — JSON body: { "query": "D02 X285" }

Response

{
  "ok": true,
  "query": "D02 X285",
  "formattedAddress": "Trinity College Dublin, College Green, Dublin 2, Ireland",
  "eircode": "D02 X285",
  "businessName": "Trinity College Dublin",
  "location": { "lat": 53.3438, "lng": -6.2546 },
  "placeId": "ChIJ...",
  "embedUrl": "https://www.google.com/maps/...",
  "tookMs": 142
}

Setup

bun install   # or npm install
cp .dev.vars.example .dev.vars  # add your keys
bun run dev

Required secrets

Name Purpose
GOOGLE_MAPS_API_KEY Google Geocoding + Places API key (required)
RAPIDAPI_PROXY_SECRET If set, /eircode requires header X-RapidAPI-Proxy-Secret to match. Leave unset to run open.

Deploy

wrangler secret put GOOGLE_MAPS_API_KEY
wrangler secret put RAPIDAPI_PROXY_SECRET   # optional
bun run deploy

License

MIT

About

EIRCODE api

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors