https://cloud.51degrees.com/api/v4/json?resource=YOUR_KEY&51D_Pos_latitude=48.8584&51D_Pos_longitude=2.2945
What you need to know
We match supplied coordinates to address data. Check the result against the precision your application needs.
Reverse geocoding runs as a cloud service, so there's no local setup needed. We use current OpenStreetMap (OSM) location data exposed and managed via our geo-diverse infrastructure.
var pipelineBuilder = new GeoLocationPipelineBuilder(
_loggerFactory)
.UseCloud(resourceKey,
FiftyOne.GeoLocation.Core.GeoLocationProvider
.FiftyOneDegrees)
.UseLazyLoading(TimeSpan.FromSeconds(10));
using var pipeline = pipelineBuilder.Build();
using var data = pipeline.CreateFlowData();
data.AddEvidence("query.51D_Pos_latitude", latitude);
data.AddEvidence("query.51D_Pos_longitude", longitude);
data.Process();
var country = data.Get<IGeoData>().Country;
Pipeline pipeline = new GeoLocationPipelineBuilder(loggerFactory)
.useCloud(resourceKey,
Enums.GeoLocationProvider.FiftyOneDegrees)
.setEndPoint("https://cloud.51degrees.com/api/v4")
.useLazyLoading(1000)
.setAutoCloseElements(true)
.build();
try (FlowData flowData = pipeline.createFlowData()) {
flowData.addEvidence(EVIDENCE_GEO_LAT_PARAM_KEY, "51.458048")
.addEvidence(EVIDENCE_GEO_LON_PARAM_KEY,
"-0.9822207999999999")
.process();
AspectPropertyValue<String> country =
flowData.get(GeoData.class).getCountry();
}
pipeline.close();
const pipeline =
new FiftyOneDegreesGeoLocation.GeoLocationPipelineBuilder({
resourceKey: localResourceKey
}).build();
const flowData = pipeline.createFlowData();
flowData.evidence.add('query.51D_Pos_latitude', latitude);
flowData.evidence.add('query.51D_Pos_longitude', longitude);
await flowData.process();
const country = flowData.location.country;
pipeline = LocationPipelineBuilder(
resource_key=resource_key).build()
flow_data = pipeline.create_flowdata()
latitude = "51.458048"
longitude = "-0.9822207999999999"
flow_data.evidence.add("query.51D_Pos_latitude", latitude)
flow_data.evidence.add("query.51D_Pos_longitude", longitude)
flow_data.process()
if flow_data.location.country.has_value():
print(flow_data.location.country.value())
$settings = array(
"resourceKey" => $resourceKey,
"locationProvider" => "fiftyonedegrees"
);
$builder = new GeoLocationPipelineBuilder($settings);
$pipeline = $builder->build();
$flowData = $pipeline->createFlowData();
$latitude = "51.458048";
$longitude = "-0.9822207999999999";
$flowData->evidence->set('query.51D_Pos_latitude', $latitude);
$flowData->evidence->set('query.51D_Pos_longitude', $longitude);
$result = $flowData->process();
$country = $flowData->location->country;
- Request. Your website or app gets the user's permission to access location data.
- Resolve. The API matches the device's longitude/latitude (via GPS) to a geolocation database.
- Respond. Your website receives address information that you can use to adapt content.
Send the coordinates as the evidence query.51D_Pos_latitude and query.51D_Pos_longitude, as the reverse geocoding quick start shows.
Start with IP location, which you get without having to prompt the user, but which is not precise. Then move to the precise coordinates the operating system or the web browser provides, and reverse geocode them to an address.
A location from the GPS that falls within the service area of the IP address is an indication that the person is actually in the country and not using a VPN.
Combine geolocation with device detection to adapt website content based on GPS availability.
{
"device": {
"hardwarevendor": "Apple",
"platformname": "iOS"
},
"location": {
"town": "Canterbury",
"country": "United Kingdom"
}
}
Plans and prices are on the pricing page, and every property is in the Property Dictionary.
No messy setup and operating costs.
- IP location, the address and the device, all in one call.
- Daily data updates, applied automatically.
- Open source for both on-premise and cloud.
- Published prices on the pricing page, and ISO 9001 and ISO/IEC 27001 certification.
Pick one to find out more
Each heading opens a short answer, with code, a map, a diagram, or a video, and a link to the documentation for more.

What is geolocation from 51Degrees?
Reverse geocoding
Reverse geocoding converts supplied longitude and latitude into address information from OpenStreetMap (OSM), with the country code, the currency, the time zone, the dialing code, and the language. The result depends on the coordinates and the address data available.
You can use the returned address information to prefill an address form. Let the user check the address before submitting it.
Why use geolocation?
The basic free properties within our Geolocation service are powered by the Nominatim API and OpenStreetMap data. The premium location properties within our Geolocation service (offered by OpenStreetMap) go one step further to provide precise data such as building name.
If you want to see our Geolocation in action, web veterans Bruce Lawson and Stuart Langridge integrated geolocation into Which Three Birdies.
Super-localized content
Smarter fraud prevention
Sharper ad targeting
3 ways to use geolocation
Set the location context first, then ask to make it more precise
Start with IP location, which you get without having to prompt the user, but which is not precise. Then move to the precise coordinates the operating system or the web browser provides.
It's done in context, so the user isn't shocked with a “door slam” about where they are. The location context is set first, and then they're asked whether they'd like it to be more precise.
Who it serves. Websites and apps that need a visitor's precise location.
Pairs well with Forms that fill themselves, to turn the precise location into an address.
Ingredients, 9
- Country
- Region
- Town
- TownGeoNameId
- LocationConfidence
- JavaScript
- Suburb
- Town
- ZipCode
Hero ingredient. LocationConfidence Says how sure the IP location is, and so when it's worth asking for more.
- Look up the IP address for the country and town, with no prompt
- Show the page in that context, such as the nearest store found by TownGeoNameId, or the local currency
- Offer to make it more precise, and only then ask for the coordinates
- Reverse geocode the coordinates to the suburb and zip code
Chef's tip. Never open with the permission prompt. Show the visitor you already know roughly where they are, then ask.
Pre-populate forms from the location, down to the zip code
By using the location, forms can easily be pre-populated, even down to the postal code or zip code. The IP address gives the country and town before anyone types, and the coordinates the browser shares give the rest of the address.
Who it serves. Anyone whose forms ask for an address.
Pairs well with Location in context, to ask for the location at the right moment.
Ingredients, 8
- Country
- Town
- JavaScript
- Suburb
- Town
- County
- Region
- ZipCode
Hero ingredient. ZipCode The postal or zip code, filled in before the visitor types.
- Set the country from the IP address as the form opens
- Ask for the precise location when the visitor reaches the address
- Reverse geocode the coordinates
- Fill in the town, county, and zip code, and let the visitor correct them
Chef's tip. Fill in what you can, and leave every field for the visitor to correct.
Check a shared location against the IP address
Someone who's prepared to share their location, and whose location matches the IP address, gives a signal of more certainty than if there were a big divergence.
A location from the GPS that falls within the service area of the IP address is an indication that the person is actually in the country and not using a VPN.
Who it serves. Anyone who needs more certainty that a visitor is where they appear to be.
Pairs well with Suspicious traffic management, to weigh the location with the other signals.
Ingredients, 10
- Areas
- Country
- LocationConfidence
- IsVPN
- IsProxy
- IsHosted
- JavaScript
- Country
- Region
- Town
Hero ingredient. Areas The service area of the IP address, to test the shared location against.
- Look up the IP address for its service area and VPN flags
- Ask the browser for its coordinates
- Check whether the coordinates fall within the service area
- Take a big divergence as a reason for a closer look
Chef's tip. A match is a signal, not proof. Weigh it with IsVPN and Human Confidence.
Pick the one closest to your business challenge
The story is for you and the recipe for your engineers, with the properties they need and a link to create their Resource Key.