GetLocationFromCellsOrWifiNetworks
<div class="nrf-note"> <p><b>Cloud-to-cloud — authorize with an Organization Auth Token.</b><br><code>https://api.location.nrfcloud.com/v1/organizations/{organizationSlug}/projects/{projectSlug}/location/ground-fix</code></p> <p><b>Device-to-cloud — authorize with a JSON Web Token.</b><br><code>https://api.location.nrfcloud.com/v1/location/ground-fix</code></p> </div>Gets the lat, lon, and uncertainty values for the LTE/GSM/WCDMA cell(s) or wifi access points passed. Wifi will be prioritized and fall back to cell if unavailable. At least one cell or two Wi-Fi access points are required. An empty lte, ltecatm, nbiot, gsm, wcdma, or wifi array is treated the same as an omitted field.
Return JSON payload.
Basic Request:
curl -X POST "$API_HOST/v1/location/ground-fix" -H "Authorization: Bearer $JWT" -H "Content-Type: application/json" -d "{\"lte\":[{\"mcc\": 244, \"mnc\": 91,\"tac\": 4099,\"eci\":36078631}], \"wifi\":[{\"macAddress\": \"00-18-39-59-8C-53\", \"ssid\": \"my-wifi-network\", \"signalStrength\": -42}, {\"macAddress\": \"00:21:55:61:F3:0A\", \"ssid\": \"my-other-wifi-network\", \"signalStrength\": -22}]}"
Save device location and silence response:
curl --verbose -X POST "$API_HOST/v1/location/ground-fix?doReply=false" -H "Authorization: Bearer $JWT" -H "Content-Type: application/json" -d "{\"lte\":[{\"mcc\": 244, \"mnc\": 91,\"tac\": 4099,\"eci\":36078631}], \"wifi\":[{\"macAddress\": \"00-18-39-59-8C-53\", \"ssid\": \"my-wifi-network\", \"signalStrength\": -42}, {\"macAddress\": \"00:21:55:61:F3:0A\", \"ssid\": \"my-other-wifi-network\", \"signalStrength\": -22}]}"
Query parameters
nRF Cloud will always return the most accurate response based on cell tower location or AP location for wifi, if available. When not available, nRF Cloud falls back to area-level location estimate based on cell tower tracking area code.
To disable this behavior, set fallback=false. This will ignore cell tracking area and return a 404 in event a higher accuracy response cannot be provided.
nRF Cloud automatically uses a 68% confidence interval when estimating the Horizontal Positioning Error (HPE) for a location. This means that there is a 68% probability that the device's actual location is within the HPE radius of the returned coordinates. Enabling this flag will use a 95% confidence interval instead, resulting in a larger HPE radius, and a higher probability that the device's actual location is within the circle.
nRF Cloud combats stale and inaccurate Wi-Fi location data by comparing the distance between Wi-Fi and cell location (if provided). This parameter allows the user to customize this behavior by setting the distance threshold used in that comparison, with the requirement that cell location is also provided in the request.
Measured in meters (m).
nRF Cloud makes its best effort to return the most quality location data possible. Sometimes that means choosing one location and throwing out the other. These details are omitted from the response to keep a small and succinct payload.
Sending alt=true will allow you to see this alternate location and its distance from the chosen location in meters.
When enabled, the response will include reverse-geocoded address data for the resolved coordinates. This adds a reverseGeo property to the response containing the address, formatted address string, and the coordinates/uncertainty of the resolved address. Note: enabling this flag results in two API requests internally — one for the geolocation and one for the reverse geocoding lookup, which each get charged independently.
Headers
User-defined device ID, used to identify requests when using a cloud-to-cloud integration. Ignored if using a device token.
Request body
Example request
{
"lte": [
{
"rsrp": -90,
"rsrq": -8,
"mcc": 310,
"eci": 167899669,
"tac": 13601,
"pci": 143,
"earfcn": 41490,
"adv": 20000,
"nmr": [
{
"rsrp": -90,
"rsrq": -8,
"earfcn": 41490,
"pci": 143,
"eci": 167899669,
"timeDiff": 300
}
]
}
],
"ltecatm": [
{
"rsrp": -90,
"rsrq": -8,
"mcc": 310,
"eci": 167899669,
"tac": 13601,
"pci": 143,
"earfcn": 41490,
"adv": 20000,
"nmr": [
{
"rsrp": -90,
"rsrq": -8,
"earfcn": 41490,
"pci": 143,
"eci": 167899669,
"timeDiff": 300
}
]
}
],
"nbiot": [
{
"rsrp": -90,
"rsrq": -8,
"mcc": 310,
"eci": 167899669,
"tac": 13601,
"pci": 143,
"earfcn": 41490,
"adv": 20000,
"nmr": [
{
"rsrp": -90,
"rsrq": -8,
"earfcn": 41490,
"pci": 143,
"eci": 167899669,
"timeDiff": 300
}
]
}
],
"gsm": [
{
"mcc": 310,
"lac": 5126,
"cid": 16504,
"rssi": -75,
"nmr": [
{
"baseStationId": 6,
"arfcn": 82,
"rssi": -75
}
]
}
],
"wcdma": [
{
"mcc": 310,
"lac": 5126,
"cid": 16504,
"rscp": -95,
"nmr": [
{
"uarfcn": 10788,
"psc": 123,
"rscp": -95
}
]
}
],
"wifi": [
{
"macAddress": "FE:1E:41:2D:9E:53",
"signalStrength": -42,
"age": 500,
"frequency": 2412
}
]
}Response
Returns lat/lon coordinates and uncertainty for a device using cell or wifi data.
Example response
{
"lat": 45.524098,
"lon": -122.688408,
"uncertainty": 300.5,
"alt": {
"loc": {
"lat": 45.524098,
"lon": -122.688408,
"uncertainty": 300.5
}
},
"reverseGeo": {
"lat": 45.524098,
"lon": -122.688408,
"uncertainty": 300.5,
"address": {
"country": "United States of America",
"state": "Oregon",
"countryCode": "US",
"postalCode": "97123",
"stateCode": "OR",
"city": "Portland",
"street": "Main St.",
"streetNumber": "123"
}
}
}Changes
No recorded changes to this endpoint across all 1 revision of this API.