Get workers by location

Get workers by location

You may provide a coordinate pair along with a radius to get a list of workers who are currently within a certain target area.

Query parameters

NameTypeDescription
longitudenumberThe longitude component of the coordinate pair.
latitudenumberThe latitude component of the coordinate pair.
radiusnumberOptional. The length in meters of the radius of the spherical area in which to look for workers. Defaults to 1000 if missing. Maximum value is 10000.
curl -X GET "https://onfleet.com/api/v2/workers/location?longitude=-122.41275787353516&latitude=37.78998061344339&radius=6000" \
       -u "cd3b3de84cc1ee040bf06512d233719c:"
onfleet.workers.getByLocation({"longitude":-122.41275787353516, "latitude":37.78998061344339, "radius":6000})
onfleet.workers.getByLocation({"longitude":-122.41275787353516, "latitude":37.78998061344339, "radius":6000});
$onfleet->workers->getByLocation(["longitude"=>-122.41275787353516, "latitude"=>37.78998061344339, "radius"=>6000)
{
  "workers": [
    {
      "id": "h*wSb*apKlDkUFnuLTtjPke7",
      "timeCreated": 1458416497000,
      "timeLastModified": 1478383350446,
      "organization": "yAM*fDkztrT3gUcz9mNDgNOL",
      "name": "Andoni",
      "displayName": "Andoni",
      "phone": "+14155558442",
      "activeTask": "kc8SS1tzuZ~jqjlebKGrUmpe",
      "tasks": [
        "11z1BbsQUZFHD1XAd~emDDeK",
        "kc8SS1tzuZ~jqjlebKGrUmpe"
      ],
      "onDuty": true,
      "isResponding": true,
      "timeLastSeen": 1480385504517,
      "capacity": 0,
      "userData": {
         "appVersion": "1.2.0",
         "batteryLevel": 0.99,
         "deviceDescription": "Simulator (iOS 12.1.0)",
         "platform": "IOS"
      },
      "accountStatus": "ACCEPTED",
      "metadata": [],
      "imageUrl": null,
      "capacity": 0,
      "userData": {},
      "location": [
        -122.4088934,
        37.7593079
      ],
      "delayTime": 1650,
      "vehicle": {
        "id": "ArBoHNxS4B76AiBKoIawY9OS",
        "type": "CAR",
        "description": "Tesla Roadster",
        "licensePlate": "ELON4PREZ",
        "color": "black",
        "timeLastModified": 1478383350431
      }
    },
    {
      "id": "sFtvhYK2l26zS0imptJJdC2q",
      "timeCreated": 1473361545000,
      "timeLastModified": 1480384608044,
      "organization": "yAM*fDkztrT3gUcz9mNDgNOL",
      "name": "Hitachino",
      "displayName": "HT",
      "phone": "+16175552820",
      "activeTask": null,
      "tasks": [],
      "onDuty": true,
      "isResponding": true,
      "timeLastSeen": 1480385496759,
      "capacity": 0,
      "userData": {
        "deviceDescription": "iPhone 6S (iOS 9.3.2)",
        "batteryLevel": 0.43,
        "appVersion": "0.9.65",
        "platform": "IOS"
      },
      "accountStatus": "ACCEPTED",
      "metadata": [],
      "imageUrl": null,
      "location": [
        -122.4431349803903,
        37.75080475959717
      ],
      "delayTime": null,
      "vehicle": {
        "id": "tN1HjcvygQWvz5FRR1JAxwL8",
        "type": "CAR",
        "description": null,
        "licensePlate": null,
        "color": null,
        "timeLastModified": 1473361545335
      }
    }
  ]
}