# GetTheData

> Work with UK locations using GetTheData's free APIs: convert a British National Grid easting and northing to latitude and longitude, and look up English, Scottish and Welsh postcodes for their coordinates and parts. No account or API key required.

App · 2 actions. Web page: https://docs.lodol.com/docs/integrations/getthedata

## Actions

### Convert grid reference to latitude and longitude

Convert a British National Grid (OSGB36) easting and northing, as used by Ordnance Survey and many UK datasets, to a WGS84 (GPS) latitude and longitude for maps and other apps. No API key required.

**Inputs**

- Easting (`easting`, number, required): Metres east of the grid's origin, 0 to 700,000. Decimals are rounded to the nearest metre. From 0 to 700000.
- Northing (`northing`, number, required): Metres north of the grid's origin, 0 to 1,300,000. Decimals are rounded to the nearest metre. From 0 to 1300000.

**Outputs**

- `easting` (number): The easting that was converted, in whole metres, e.g. 529090.
- `latitude` (number): The WGS84 (GPS) latitude, e.g. 51.50101.
- `longitude` (number): The WGS84 (GPS) longitude, e.g. -0.14158.
- `northing` (number): The northing that was converted, in whole metres, e.g. 179645.
- `summary` (text): One line with the conversion, e.g. 'Easting 529090, northing 179645 is latitude 51.50101, longitude -0.14158'.

**Example output**

```json
{
  "easting": 529090,
  "latitude": 51.50101,
  "longitude": -0.14158,
  "northing": 179645,
  "summary": "Easting 529090, northing 179645 is latitude 51.50101, longitude -0.14158"
}
```

### Look up postcode

Look up an English, Scottish or Welsh postcode in Open Postcode Geo and get its latitude and longitude, grid reference, country, whether it is still in use, and its area, district, sector, outcode and incode. A postcode sector ('SW1A 1'), district ('SW1A') or area ('SW') works too. Unknown postcodes come back with 'found' set to false. No API key required.

**Inputs**

- Postcode (`postcode`, text, required): A UK postcode such as 'SW1A 1AA' (any spacing or case), or a postcode sector, district or area. Northern Irish postcodes are not included.

**Outputs**

- `attribution` (list): The copyright statements Open Postcode Geo's licence asks you to show wherever you use the data.
- `country` (text): 'England', 'Scotland' or 'Wales'.
- `easting` (number): The British National Grid easting of the centre, in metres.
- `found` (true/false): True when Open Postcode Geo holds it. False for an unknown postcode and for every Northern Irish one (its licence excludes them); 'message' then says why.
- `incode` (text): The part after the space, e.g. '1AA'.
- `latitude` (number): The latitude of the postcode's centre, e.g. 51.501009.
- `longitude` (number): The longitude of the postcode's centre, e.g. -0.141588.
- `match_type` (text): What matched: 'unit_postcode' (a full postcode), 'postcode_sector', 'postcode_district' or 'postcode_area'. Only a full postcode has coordinates.
- `message` (text): Why nothing matched, e.g. 'No matching postcode found.'. Empty when found.
- `northing` (number): The British National Grid northing of the centre, in metres.
- `outcode` (text): The part before the space, e.g. 'SW1A'.
- `positional_quality` (number): How precise the location is, from 1 (within the building of a matched address) to 9 (no location available).
- `postcode` (text): The full postcode, e.g. 'SW1A 1AA'.
- `postcode_area` (text): The postcode area, its first one or two letters, e.g. 'SW'.
- `postcode_district` (text): The postcode district, e.g. 'SW1A'.
- `postcode_no_space` (text): The postcode without its space, e.g. 'SW1A1AA'.
- `postcode_sector` (text): The postcode sector, e.g. 'SW1A 1'.
- `query` (text): What was looked up, tidied, e.g. 'SW1A 1AA'.
- `status` (text): 'live', or 'terminated' for a postcode no longer in use.
- `summary` (text): One line about the match, e.g. 'SW1A 1AA is a live postcode in England (51.501009, -0.141588)', or why nothing matched.
- `usertype` (text): 'small' for an ordinary postcode, or 'large' for one given to a single big mail recipient (which may not be at that location).

**Example output**

```json
{
  "attribution": [
    "Contains OS data (c) Crown copyright and database right 2026",
    "Contains Royal Mail data (c) Royal Mail copyright and database right 2026",
    "Contains National Statistics data (c) Crown copyright and database right 2026"
  ],
  "country": "England",
  "easting": 529090,
  "found": true,
  "incode": "1AA",
  "latitude": 51.501009,
  "longitude": -0.141588,
  "match_type": "unit_postcode",
  "message": null,
  "northing": 179645,
  "outcode": "SW1A",
  "positional_quality": 1,
  "postcode": "SW1A 1AA",
  "postcode_area": "SW",
  "postcode_district": "SW1A",
  "postcode_no_space": "SW1A1AA",
  "postcode_sector": "SW1A 1",
  "query": "SW1A 1AA",
  "status": "live",
  "summary": "SW1A 1AA is a live postcode in England (51.501009, -0.141588)",
  "usertype": "large"
}
```
