Current Place API for Web

The Current Place API takes raw location signals and returns an array of current place candidates along with confidence level estimates—that the user is at those places. Latitude and longitude are required, but prediction accuracy increases dramatically when you include Wi-Fi and Bluetooth signals. The following code example demonstrates how to call the Current Place API.

GET https://graph.facebook.com/v3.3/current_place/results?{parameters}&fields={place information}

Parameters

Name Description

coordinates

Required. A JSON encoding of coordinates, containing at least latitude and longitude; and optionally accuracy, speed, timestamp, altitude, altitudeAccuracy, and heading.

min_confidence_level

The minimum confidence level of suggestions to return. Valid values are: low, medium, and high.

wifi

Connected and ambient wifi information. A JSON-encoded vector of wifi data, in the format {"enabled":bool,"current_connection":wifi_data,"access_points":[wifi_data1,wifi_data2,...]} where enabled indicates whether Wi-Fi is enabled on the device, current_connection is the Wi-Fi access point that the device is connected to, and access_points is a vector of other ambient Wi-Fi signals. wifi_data is a map containing information about the Wi-Fi, with ssid (network name), mac_address (BSSID), signal_strength (RSSI), and frequency. E.g., {"ssid":"Lighthouse","mac_address":"00:11:aa:bb:22:33","signal_strength":-10,"frequency":2000}.

bluetooth

A JSON-encoded map of two fields: "enabled", a boolean value that indicates whether the Bluetooth is enabled on the device; and "scans", a vector of Bluetooth Low Energy (including iBeacon) scans, in the format [{"payload":string,"rssi":float,...], where payload is the raw scan data. E.g., "0201041aff4c00021566622e6d652f40ca9e6f6f71666163653e3a5f06c5" (iBeacon), and rssi is the signal strength. E.g., -92.

Fields

Refer to the PlaceInformation reference for a list of available fields.

Edge FieldsDescription

confidence_level

For each place returned, the confidence level of the place estimate is returned in the confidence_level field, and it can have one of three values: low, medium, or high.

Summary

You can retrieve summary information about the Response using the summary parameter. For the Current Place API, e.g., summary=tracking.

Name Description

tracking

A unique identifier for this response. This is used in the Current Place Feedback API.

Example

The following example requests the highest confidence place estimate, given a set of location coordinates, along with the tracking field.

Request

/current_place/predictions?coordinates={"latitude":37.4839094,"longitude":-122.148969,"accuracy":65}&min_confidence_level=high&summary=tracking&limit=1

Response

{
  "data": [
    {
      "name": "Facebook HQ",
      "id": "166793820034304",
      "confidence_level": "high"
    }
  ],
  "paging": {
    "cursors": {
      "before": "MAZDZD",
      "after": "MAZDZD"
    }
  },
  "summary": {
    "tracking": "52313c7bd3ac8a085a706c00ff6a0f722f1c8093"
  }
}