List all the nearby vehicles (v2)

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…

Purpose: Use this API to fetch a list of all the vehicles that are nearby to your specified location.

This is the version 2 of the list nearby vehicles endpoint. This endpoint works on the basis of a scoring system. This score is calculated based on 3 parameters.

The 3 scoring parameters are:

  1. Vehicle Proximity: As mentioned in the above example, all the vehicles that can arrive quickly to the location within the expected time will be given higher score. For example, if the current time is 7:00 PM, and if you add the expected_timeas 9:00 PM, the vehicle that can arrive fastest within the expected time, will be given preference and will be awarded a higher score.
  2. Hours of Service (HOS): The endpoint calculates the Hours of Service of all the drivers who are nearby and can reach fast. The drivers who have a remaining Hours of Service that is within the expected time, will receive additional scoring.
  3. Vehicle Direction: The endpoint also observes the direction of the vehicles that are towards the provided destination's latitude and longitude. It assigns higher score to vehicles that are towards the direction of the destination.

If the above requirements match, then a vehicle will receive an incremental score for each parameter. The vehicles that have the highest score, will be shown by the response of the endpoint. All the vehicles are sorted based on the score. The vehicle with the highest score will be on the top of the list, while the vehicle with the lowest score will be at the last.

📘

NOTE

Scores for the vehicles are calculated in decimals from 0.0 to 1.0, where 0.0 (lowest) meaning that non of the parameters were met, and 1.0 (highest), meaning all the parameters were met. In the list, you may have multiple vehicles that have a 1.0 score.

require 'uri'
require 'net/http'

url = URI('https://api.gomotive.com/v2/freight_visibility/vehicle_association')

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request['Authorization'] = "Bearer <OAUTH_TOKEN>"

response = http.request(request)
puts response.read_body

Response Parameters

Data

  • Type: Object
  • Description: Contains details about a company, its vehicles, and integration status.

company_id

  • Type: String
  • Description: Unique identifier for the company.

dot_ids

  • Type: Array of Strings
  • Description: List of Department of Transportation (DOT) IDs associated with the company.

integration_status

  • Type: String
  • Description: The current integration status of the company.

vehicle_details

  • Type: Array of Objects
  • Description: Detailed information about the company's vehicles.

vehicle_id

  • Type: String
  • Description: The unique ID of the vehicle.

vehicle_name

  • Type: String
  • Description: The name or identifier of the vehicle.

eld_device_id

  • Type: String
  • Description: The ID of the ELD device installed in the vehicle.

eld_identifier

  • Type: String
  • Description: The unique identifier of the ELD device.

trailer_id

  • Type: String
  • Description: Identifier for the trailer attached to the vehicle.

driver

  • Type: Object
  • Description: Information about the driver of the vehicle.

id

  • Type: Integer
  • Description: Unique identifier for the driver.

first_name

  • Type: String
  • Description: First name of the driver.

last_name

  • Type: String
  • Description: Last name of the driver.

located_at

  • Type: String
  • Description: The timestamp of when the vehicle was last located.

description

  • Type: String
  • Description: Describes the vehicle’s current location.

distance_origin

  • Type: Object
  • Description: Distance of the vehicle from a specified origin.

value

  • Type: Float
  • Description: The distance value.

unit

  • Type: String
  • Description: Unit of the distance (e.g., miles).

matching_score

  • Type: Float
  • Description: Score representing how well the vehicle matches certain criteria.

Query Params
int32

Specify the ID of the company as assigned by Motive.

int32

Specify the ID provided by the Department of Transportation, if you do not have the company_id.

float

Specify the latitude of the location from where you want to check the nearby available vehicles.

float

Specify the longitude of the location from where you are checking the nearby vehicles for service.

date

Specify the expected arrival time at the location.

Responses

Language
Credentials
Header
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json