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.2
/current_place/results?{parameters}&fields={place information}
Name | Description |
---|---|
| Required. A JSON encoding of coordinates, containing at least |
| The minimum confidence level of suggestions to return. Valid values are: |
| Connected and ambient wifi information. A JSON-encoded vector of wifi data, in the format |
| 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 |
Refer to the PlaceInformation reference for a list of available fields.
Edge Fields | Description |
---|---|
| For each place returned, the confidence level of the place estimate is returned in the |
You can retrieve summary information about the Response using the summary
parameter. For the Current Place API, e.g., summary=tracking
.
Name | Description |
---|---|
| A unique identifier for this response. This is used in the Current Place Feedback API. |
The following example requests the highest confidence place estimate, given a set of location coordinates, along with the tracking field.
/current_place/predictions?coordinates={"latitude":37.4839094,"longitude":-122.148969,"accuracy":65}&min_confidence_level=high&summary=tracking&limit=1
{ "data": [ { "name": "Facebook HQ", "id": "166793820034304", "confidence_level": "high" } ], "paging": { "cursors": { "before": "MAZDZD", "after": "MAZDZD" } }, "summary": { "tracking": "52313c7bd3ac8a085a706c00ff6a0f722f1c8093" } }