Skip to main content
GET
Nearest vehicles (V2)

Overview

Returns the vehicles mapped to the specified company with their distance from a given coordinate. Like Fleet last positions, it does not include sub-company vehicles unless they are also mapped to this company.
Distances are planar degrees, not metres. realDistance is the straight-line distance between the two coordinates in degrees of latitude and longitude — there is no road routing, and the distortion grows with latitude. distance is realDistance rounded to a multiple of 100, so it is 0 whenever the point is within 50° of the vehicles. As a result:
  • radius is compared with the rounded distance: with a nearby point, any radius of 1 or more keeps every vehicle that has a position, and a radius of 0 or less returns nothing.
  • Results are ordered by distance, so within a bucket (in practice, all of them) the order is not by nearness. Paging follows that order.
  • num has no default cap, and it keeps the first N results in that order — not the N nearest.
  • lat and lng are optional; omitting them measures from (0, 0), which gives Australian vehicles a distance of 100 or 200.
  • Vehicles with no stored position are included at (0, 0). From an Australian point they fall in the 100 or the 200 bucket depending on the point (100 from Perth, Adelaide or Darwin; 200 from Sydney or Brisbane), so a radius of up to 100 always drops them; from (0, 0) they sort first.
To find the nearest vehicles, fetch every page and compute distances yourself from vehicle.lat and vehicle.lng, ignoring vehicles at 0/0.
The V1 version of this endpoint is Nearest vehicles. V2 is paginated.
Rate limit: 4 req/s · 20/min · 600/hr · 14,400/day

Endpoint

GET /v2/api/companies/{id}/vehicles/nearest

Path parameters

integer
required
Company ID.

Query parameters

number
Latitude of the reference point. Optional; defaults to 0.
number
Longitude of the reference point. Optional; defaults to 0.
integer
Maximum number of vehicles to return, applied after the radius filter. No limit when omitted.
integer
Upper bound on the rounded distance (degrees — see the warning above): vehicles with distance at or above radius are excluded. No limit when omitted.
integer
default:"1"
Page number (1-based).
integer
default:"50"
Records per page.

Response

200 OK — PagedListResult<NearestPointResultItemDto> Each item in the paginated items array:

Error responses

Authorizations

Authorization
string
header
required

JWT Bearer token obtained from POST /v2/api/authentication/token/api-key.

Lifetime: ~24 hours (86,399 seconds). Cache the token and reuse it. Re-authenticate 5 minutes before expiry.

Scoping: API key tokens are scoped by the key's company and its action set; see Token scoping.

No refresh endpoint — re-authenticate with your API key when the token expires.

Path Parameters

id
integer
required

Query Parameters

lat
number
default:0

Latitude of the reference point. Optional; defaults to 0.

lng
number
default:0

Longitude of the reference point. Optional; defaults to 0.

num
integer

Maximum number of vehicles to return, applied after the radius filter. No limit when omitted.

radius
integer

Upper bound on the rounded distance, which is in degrees (not metres): vehicles with distance at or above radius are excluded. No limit when omitted.

page
integer
default:1
pageSize
integer
default:50

Response

Successful response