Back to checker
API Reference

Eircode Lookup API

A simple JSON API for resolving Eircodes and Irish addresses to coordinates and a Google Maps link. Distributed exclusively via RapidAPI.

Base URL: https://eircode-api.p.rapidapi.comContent-Type: application/jsonGet an API key on RapidAPI →OpenAPI 3.0 spec

Authentication

Every request requires two headers from your RapidAPI subscription:

  • X-RapidAPI-Key: <your-rapidapi-key>
  • X-RapidAPI-Host: eircode-api.p.rapidapi.com
GET/api/eircode?q=<query>

Look up an address or Eircode using a URL query parameter. Best for quick tests and sharing links.

Query parameters
NameTypeRequiredDescription
qstringYesEircode (e.g. D02 X285) or address (e.g. Trinity College Dublin). 2–200 chars.
curl "https://eircode-api.p.rapidapi.com/api/eircode?q=D02+X285" \
  -H "X-RapidAPI-Key: YOUR_RAPIDAPI_KEY" \
  -H "X-RapidAPI-Host: eircode-api.p.rapidapi.com"
POST/api/eircode

Look up an address or Eircode by sending a JSON body. Recommended for queries that include special characters.

Request body (JSON)
FieldTypeRequiredDescription
querystringYesEircode or Irish address. 2–200 chars.
curl -X POST https://eircode-api.p.rapidapi.com/api/eircode \
  -H "Content-Type: application/json" \
  -H "X-RapidAPI-Key: YOUR_RAPIDAPI_KEY" \
  -H "X-RapidAPI-Host: eircode-api.p.rapidapi.com" \
  -d '{"query": "Trinity College Dublin"}'

Response

Both endpoints return the same JSON shape. ok: true on success, ok: false on failure. HTTP status is 200 on success and 400 on errors (validation, no match, upstream failure).

Success fields (ok: true)
Returned when a result is found.
FieldTypeDescription
oktrueIndicates a successful lookup.
querystringThe original query you submitted.
formattedAddressstringHuman-readable address from Google Maps.
eircodestring | nullEircode in A65 F4E2 format, or null if not resolvable.
location.latnumberLatitude in decimal degrees (WGS84).
location.lngnumberLongitude in decimal degrees (WGS84).
placeIdstringGoogle Maps Place ID for further API calls.
embedUrlstringURL ready to drop into an <iframe> for a map preview.
tookMsnumberServer-side processing time in milliseconds (includes the upstream geocoding call).
Error fields (ok: false)
Returned with HTTP 400 when a lookup fails.
FieldTypeDescription
okfalseIndicates the lookup failed.
errorstringHuman-readable error message.
tookMsnumberServer-side processing time in milliseconds.

Success example

{
  "ok": true,
  "query": "D02 X285",
  "formattedAddress": "Saint Kevin's, Dublin, Co. Dublin, D02 X285, Ireland",
  "eircode": "D02 X285",
  "location": {
    "lat": 53.3320669,
    "lng": -6.255491699999999
  },
  "placeId": "ChIJgclyraMOZ0gRRA_QJFnS6VA",
  "embedUrl": "https://www.google.com/maps/search/?api=1&query=53.3320669,-6.255491699999999&query_place_id=ChIJgclyraMOZ0gRRA_QJFnS6VA",
  "tookMs": 111
}

Error example

{
  "ok": false,
  "error": "No match found in Ireland for that input.",
  "tookMs": 87
}

Status codes & CORS

CodeMeaning
200Successful lookup. ok: true in the body.
400Validation error, no match, or upstream geocoding failure. ok: false.
204Returned for OPTIONS CORS preflight.

CORS headers allow * origins with methods GET, POST, OPTIONS and the Content-Type header.