Luna ELD

Public API

Real-time fleet tracking · REST · JSON

Base URL

https://api.lunaeld.us

Authentication

Pass your API key as a query parameter on every request:

?api_key=your_api_key

Get your key from the dashboard → Settings → API Keys.

Endpoints

GET
/api/web/v1/vehicle/coordinates/

Real-time GPS position for all fleet vehicles. Filter by vehicle ID or VIN.

GET
/api/web/v1/vehicle/coordinates/location-data/

Full fleet snapshot: vehicles, drivers, and current location data in one call.

GET/api/web/v1/vehicle/coordinates/

Returns current GPS coordinates, speed, odometer, and location description for every vehicle in your fleet. Use vehicle_id or vin to narrow results to a single vehicle.

Query Parameters

ParameterTypeDescription
api_key*stringYour API key
vehicle_idstringFilter by power unit number (e.g. unit82427)
vinstringFilter by Vehicle Identification Number (e.g. 1XPBDP9X8RD655257)

* Required

Example Requests

All vehicles:

curl "https://api.lunaeld.us/api/web/v1/vehicle/coordinates/?api_key=your_api_key"

Single vehicle by VIN:

curl "https://api.lunaeld.us/api/web/v1/vehicle/coordinates/?api_key=your_api_key&vin=1XPBDP9X8RD655257"

Single vehicle by ID:

curl "https://api.lunaeld.us/api/web/v1/vehicle/coordinates/?api_key=your_api_key&vehicle_id=unit82427"

Example Response

[
  {
    "vehicle_id": "unit82427",
    "make": "PETERBILT",
    "model": "579",
    "year": 2024,
    "vin": "1XPBDP9X8RD655257",
    "odometer": 356802,
    "start_point": "4.91 mi N of Palmyra, NJ",
    "speed": 49.0,
    "coordinates": [
      {
        "latitude": "40.07090180000000",
        "longitude": "-75.01049680000000",
        "associated_date": "2025-11-17T13:52:15.797996Z"
      }
    ]
  }
]

Response Fields

FieldTypeDescription
vehicle_idstringVehicle power unit number
makestringManufacturer (e.g. PETERBILT, FREIGHTLINER)
modelstringVehicle model
yearnumberManufacturing year
vinstringVehicle Identification Number (17 chars)
odometernumberTotal mileage in miles
start_pointstringHuman-readable current location (e.g. "4.91 mi N of Palmyra, NJ")
speednumberCurrent speed in mph. 0.0 when vehicle is stopped.
coordinatesarrayLatest GPS fix — see coordinates object below

coordinates[ ] object

FieldTypeDescription
latitudestringLatitude (decimal degrees, up to 14 decimal places)
longitudestringLongitude (decimal degrees, up to 14 decimal places)
associated_datestring (ISO 8601)UTC timestamp of this GPS reading
GET/api/web/v1/vehicle/coordinates/location-data/

Returns a complete fleet snapshot in a single call: all registered vehicles, all drivers, and current location data for each vehicle. Useful for building a live map or fleet dashboard.

Query Parameters

ParameterTypeDescription
api_key*stringYour API key

* Required

Example Request

curl "https://api.lunaeld.us/api/web/v1/vehicle/coordinates/location-data/?api_key=your_api_key"

Example Response

{
  "vehicles": [
    {
      "guid": "00000000-0000-0000-0000-000000000001",
      "power_unit_number": "unit001",
      "make": "PETERBILT",
      "model": "579",
      "year": 2022,
      "license_plate_no": "ABC1234",
      "vin": "1XPBD49X0ND000001"
    }
  ],
  "drivers": [
    {
      "guid": "00000000-0000-0000-0000-000000000002",
      "username": "driver01",
      "profile": {
        "profile_picture": null,
        "first_name": "John",
        "last_name": "Smith",
        "email": "driver01@example.com",
        "phone_number": "5550001234"
      }
    }
  ],
  "location_data": [
    {
      "vehicle_id": "unit001",
      "vin": "1XPBD49X0ND000001",
      "odometer": 124500,
      "start_point": "3.2 mi W of Nashville, TN",
      "speed": 0.0,
      "coordinates": [
        {
          "latitude": "36.16589000000000",
          "longitude": "-86.78440000000000",
          "associated_date": "2025-08-15T10:22:00.000000Z"
        }
      ]
    }
  ]
}

Response Structure

vehicles[ ]

FieldTypeDescription
guidstring (UUID)Unique vehicle identifier
power_unit_numberstringVehicle unit number used as vehicle_id in other endpoints
makestringManufacturer
modelstringVehicle model
yearnumberManufacturing year
license_plate_nostringLicense plate number
vinstringVehicle Identification Number

drivers[ ]

FieldTypeDescription
guidstring (UUID)Unique driver identifier
usernamestringDriver login username
profile.first_namestringFirst name
profile.last_namestringLast name
profile.emailstringEmail address
profile.phone_numberstringPhone number
profile.profile_picturestring | nullAvatar URL or null

location_data[ ]

FieldTypeDescription
vehicle_idstringMatches power_unit_number from vehicles[]
vinstringVehicle Identification Number
odometernumberTotal mileage in miles
start_pointstringHuman-readable current location
speednumberCurrent speed in mph
coordinatesarrayLatest GPS fix (latitude, longitude, associated_date)

HTTP Status Codes

200
OK
Request successful
400
Bad Request
Invalid query parameter or format
401
Unauthorized
Missing or invalid api_key
404
Not Found
Vehicle or resource not found
429
Too Many Requests
Rate limit exceeded, slow down
500
Server Error
Internal error, try again later