# Aayat AI UK Postcode Lookup

> Aayat AI UK Postcode Lookup is a paid API for AI agents from aayatai.com, paid per call via x402, $0.003/call, status unknown (last checked 2026-10-02).

Looks up detailed geographic and administrative data for a UK postcode, or finds the nearest postcodes to a lat/lon coordinate, using official ONS data.

## Facts

- Endpoint: GET https://aayatai.com/uk/postcode?utm_source=zero.xyz
- Price: $0.003/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-02
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/aayat-ai-uk-postcode-lookup-6bfe8572
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_sEWtNk2xIeMcdydwWSZW7

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability aayat-ai-uk-postcode-lookup-6bfe8572
```

Example prompt: What region, local authority, ward, and parliamentary constituency does the postcode SW1A 1AA belong to? Also give me its exact latitude and longitude and any ONS codes.

## When to prefer this

Choose this endpoint when you need official ONS administrative geography data (LSOA, MSOA, constituency, ward, district) for UK postcodes, or when you need to find the nearest postcode to UK coordinates. It is authoritative, cheap per call, and covers the full ONS dataset. Prefer over general geocoding APIs when UK-specific administrative codes are required.

## Known failure modes

- Invalid or malformed postcode returns found:false with an empty results array
- Lat/lon outside UK bounds (lat 49–61, lon -9–3) may return no results or an error
- Missing both postcode and lat/lon query parameters results in an error response
- Terminated or non-existent postcodes may return found:false

## How this service works

UK postcode lookup: coordinates, country, region, local authority, ward, parish, parliamentary constituency, LSOA/MSOA and official ONS codes. Pass ?postcode=SW1A1AA, or ?lat=51.5&lon=-0.12 to find the nearest postcodes. Official ONS data via postcodes.io.

## Output

A JSON object with a 'found' boolean, licence attribution, and a 'results' array. Each result contains the postcode, outcode, latitude, longitude, eastings, northings, country, region, county, district, ward, parish, constituency, LSOA, MSOA, and an ONS codes object with official area identifiers.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "properties": {
      "lat": {
       "type": "number",
       "maximum": 61,
       "minimum": 49,
       "description": "Latitude, for a nearest-postcode search."
      },
      "lon": {
       "type": "number",
       "maximum": 3,
       "minimum": -9,
       "description": "Longitude, for a nearest-postcode search."
      },
      "postcode": {
       "type": "string",
       "maxLength": 10,
       "description": "Full UK postcode (spaces optional)."
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "required": [
      "found",
      "results",
      "licence"
     ],
     "properties": {
      "found": {
       "type": "boolean"
      },
      "licence": {
       "type": "string"
      },
      "results": {
       "type": "array",
       "items": {
        "type": "object"
       },
       "description": "One postcode, or the nearest ones for a lat/lon search."
      }
     }
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "found": true,
  "licence": "Contains public sector information licensed under the Open Government Licence v3.0.",
  "results": [
   {
    "lsoa": "Westminster 018C",
    "msoa": "Westminster 018",
    "ward": "St James's",
    "codes": {
     "admin_district": "E09000033"
    },
    "county": null,
    "parish": "Westminster, unparished area",
    "region": "London",
    "country": "England",
    "outcode": "SW1A",
    "district": "Westminster",
    "eastings": 529090,
    "latitude": 51.501009,
    "postcode": "SW1A 1AA",
    "longitude": -0.141588,
    "northings": 179645,
    "constituency": "Cities of London and Westminster"
   }
  ]
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/aayat-ai-uk-postcode-lookup-6bfe8572/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from aayatai.com](https://www.zero.xyz/host/aayatai.com/llms.txt)
