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
| Name | Type | Required | Description |
|---|---|---|---|
| q | string | Yes | Eircode (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/eircodeLook up an address or Eircode by sending a JSON body. Recommended for queries that include special characters.
Request body (JSON)
| Field | Type | Required | Description |
|---|---|---|---|
| query | string | Yes | Eircode 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.
| Field | Type | Description |
|---|---|---|
| ok | true | Indicates a successful lookup. |
| query | string | The original query you submitted. |
| formattedAddress | string | Human-readable address from Google Maps. |
| eircode | string | null | Eircode in A65 F4E2 format, or null if not resolvable. |
| location.lat | number | Latitude in decimal degrees (WGS84). |
| location.lng | number | Longitude in decimal degrees (WGS84). |
| placeId | string | Google Maps Place ID for further API calls. |
| embedUrl | string | URL ready to drop into an <iframe> for a map preview. |
| tookMs | number | Server-side processing time in milliseconds (includes the upstream geocoding call). |
Error fields (ok: false)
Returned with HTTP 400 when a lookup fails.
| Field | Type | Description |
|---|---|---|
| ok | false | Indicates the lookup failed. |
| error | string | Human-readable error message. |
| tookMs | number | Server-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
| Code | Meaning |
|---|---|
| 200 | Successful lookup. ok: true in the body. |
| 400 | Validation error, no match, or upstream geocoding failure. ok: false. |
| 204 | Returned for OPTIONS CORS preflight. |
CORS headers allow * origins with methods GET, POST, OPTIONS and the Content-Type header.