{"uid":"cap_sEWtNk2xIeMcdydwWSZW7","slug":"aayat-ai-uk-postcode-lookup-6bfe8572","name":"Aayat AI UK Postcode Lookup","description":"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.","url":"https://aayatai.com/uk/postcode?utm_source=zero.xyz","method":"GET","headers":{},"bodySchema":{"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."}}}}}}},"responseSchema":{"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"}]}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.003","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.003/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.003","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.003","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_USW4G6mkh1hTNLEE57d-B","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.003","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"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.","exampleAgentPrompt":"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.","exampleUseCases":[{"title":"Enrich delivery address with admin data","prompt":"I have a customer address with postcode EC2A 4NE — can you look it up and tell me the local authority district, region, and LSOA code so I can tag it in our records?"},{"title":"Reverse geocode field survey location","prompt":"I'm at latitude 53.8008 and longitude -1.5491 in the UK — what's the nearest postcode and which ward, constituency, and district does it fall in?"},{"title":"Validate and geolocate user-submitted postcode","prompt":"A user submitted the postcode M1 1AE on a form — look it up and return the country, region, coordinates, and parliamentary constituency for me."}],"resultDescription":"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.","failureModes":["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"],"whenToPreferThis":"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.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-02T00:40:01.739Z","isFirstParty":false,"canonicalSlug":"aayat-ai-uk-postcode-lookup-6bfe8572"}