bng2latlong API

Beginner's Pick Geocoding / No Auth Required Beginner HTTPS CORS
Free to Use
74 B
Measured Score 0 50 100 Speed 15/30 Consistency 20/20 Security 20/20 Browser access 15/15 Transparency 4/15 TESTED 2026-08-10

Overview

bng2latlong is a simple, free API that converts British National Grid (OSGB36) easting and northing coordinates into standard WGS84 latitude and longitude. It requires no API key and is perfect for working with UK-specific geographic data like Ordnance Survey maps. If you are building applications with UK location data, this API saves you from implementing the coordinate conversion math yourself.

Beginner Tip

Easting and northing are the two numbers in a British National Grid reference (e.g., 651409, 313177). Pass them as query parameters and you will get back a standard lat/long pair ready to use in Google Maps or Leaflet.

Measurement Record

What actually happened when we called this API from our own infrastructure. Every value below was recorded by the request, not copied from the provider's documentation.

Request
GET https://api.getthedata.com/bng2latlong/651409/313177
Result
HTTP 200 · application/json · 90 bytes
Response time
252 ms (median of 3) · fastest 246 ms
Transport
TLSv1.3 · TLS_AES_256_GCM_SHA384 · certificate issued by Let's Encrypt
Browser CORS
Allowed — Access-Control-Allow-Origin: *
Served by
nginx/1.18.0 (Ubuntu)
Recorded
2026-08-10

Fields Returned

Top-level fields present in the response we captured, with the type and value we actually received.

Field Type Value received
status string ok
easting integer 651409
northing integer 313177
latitude number 52.65798
longitude number 1.71604

Captured Response

Captured from a real request to https://api.getthedata.com/bng2latlong/651409/313177 on 2026-08-10. Long arrays and nested objects are truncated to keep the shape readable.

JSON Response · Captured
{
  "status": "ok",
  "easting": 651409,
  "northing": 313177,
  "latitude": 52.65798,
  "longitude": 1.71604
}

Field Reference

status Result status, either ok for a successful conversion or error if the input was invalid.
easting The easting value that was passed in the request.
northing The northing value that was passed in the request.
latitude WGS84 latitude of the converted coordinate.
longitude WGS84 longitude of the converted coordinate.

Implementation Example

Calls a real endpoint of this API. Replace any placeholder credentials with your own key.

Request
const url = "https://api.getthedata.com/bng2latlong/651409/313177";
const response = await fetch(url);
if (!response.ok) throw new Error(`Request failed: ${response.status}`);
const data = await response.json();
console.log(data);

What Can You Build?

Note: These code examples are AI-generated and unverified. Always refer to the official API documentation for accurate usage.

Common Errors & Troubleshooting

Generated guidance based on this API's documentation, not observed by us. Treat it as a starting point and check against the provider's own error reference.

400 Bad Request The easting or northing value is outside the valid range for the British National Grid.
Valid easting values are 0–700000 and northing values are 0–1300000. Check that your inputs fall within these bounds.
status: error in response Non-numeric or malformed values were passed as the easting or northing parameters.
Ensure both parameters are integers. Strip any leading letters (e.g., from a full grid reference string) before sending.
Coordinates seem wrong You may have accidentally swapped the easting and northing values in the URL.
The URL format is /bng2latlong/{easting}/{northing}. Easting is the horizontal (X) value and northing is the vertical (Y) value.

Measured Score Breakdown

Live HTTP request to the API endpoint

Speed 15/30
Consistency 20/20
Security 20/20
Browser access 15/15
Transparency 4/15
Endpoint Response Time 252ms

Fully tested on Aug 10, 2026

Technical Specifications

Auth No Auth
HTTPS REQUIRED
CORS YES
Category Geocoding
Difficulty Beginner
Endpoint last called: 2026-08-10

Related Tags

Similar APIs

View All →