Geo­location

Convert latitude and longitude supplied by a device into address information. Your website or app first asks the user for permission to access location data.

Create a Resource Key

Eiffel Tower, 48.8584, 2.2945

{
  "road": "Avenue Anatole France",
  "suburb": "Paris 7e Arrondissement",
  "town": "Paris",
  "county": "Paris",
  "region": "Île-de-France",
  "country": "France",
  "zipcode": "75007"
}

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.

Your server sends a latitude and longitude to the 51Degrees cloud and gets the address back as JSON. Your server Latitude, longitude Address 51Degrees cloud
Cloud getting started, C#
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;

The full C# cloud example

Read the reverse geocoding quick start

🔗
  • 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.
Request, your website or app gets the user's permission to access location data. Resolve, the coordinates are matched to address data. Respond, your website receives the address. Request permission Resolve coordinates Respond There you are!

Send the coordinates as the evidence query.51D_Pos_latitude and query.51D_Pos_longitude, as the reverse geocoding quick start shows.

See the web integration examples

🔗

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 pizza restaurant's mobile site says "Good news, we deliver in your area." from the IP address, without asking, with a Tap to eat button. When the visitor taps and shares their location, the site comes back with "Delivering to 1 Nevada Close, Canterbury, CT2. We're on our way." from the coordinates. PIZZA Good news, we deliver in your area. Tap to eat Tap, share location PIZZA Delivering to 1 Nevada Close, Canterbury, CT2 We're on our way. Near you, from the IP address, no prompt Delivery address, from the shared coordinates

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.

Read about IP intelligence

🔗

Combine geolocation with device detection to adapt website content based on GPS availability.

One call, device and location
{
  "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.

See the combined example

🔗

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.
Moving from NetAcuity to 51Degrees, one call returns the IP location, the address and the device together. NetAcuity one call 51Degrees IP location Address Device

See the combined example

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.

Read the reverse geocoding guide
What is geolocation from 51Degrees?

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

Website optimization

Smarter fraud prevention

Bots and humans

Sharper ad targeting

Advertising

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.

Talk to us about this

Pairs well with Forms that fill themselves, to turn the precise location into an address.

Ingredients, 9

IP Intelligence
  • Country
  • Region
  • Town
  • TownGeoNameId
  • LocationConfidence
Geolocation
  • JavaScript
  • Suburb
  • Town
  • ZipCode

Hero ingredient. LocationConfidence Says how sure the IP location is, and so when it's worth asking for more.

  1. Look up the IP address for the country and town, with no prompt
  2. Show the page in that context, such as the nearest store found by TownGeoNameId, or the local currency
  3. Offer to make it more precise, and only then ask for the coordinates
  4. 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.

Talk to us about this

Pairs well with Location in context, to ask for the location at the right moment.

Ingredients, 8

IP Intelligence
  • Country
  • Town
Geolocation
  • JavaScript
  • Suburb
  • Town
  • County
  • Region
  • ZipCode

Hero ingredient. ZipCode The postal or zip code, filled in before the visitor types.

  1. Set the country from the IP address as the form opens
  2. Ask for the precise location when the visitor reaches the address
  3. Reverse geocode the coordinates
  4. 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.

Talk to us about this

Pairs well with Suspicious traffic management, to weigh the location with the other signals.

Ingredients, 10

IP Intelligence
  • Areas
  • Country
  • LocationConfidence
  • IsVPN
  • IsProxy
  • IsHosted
Geolocation
  • JavaScript
  • Country
  • Region
  • Town

Hero ingredient. Areas The service area of the IP address, to test the shared location against.

  1. Look up the IP address for its service area and VPN flags
  2. Ask the browser for its coordinates
  3. Check whether the coordinates fall within the service area
  4. 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.