Hours Of Service API
Introduction
NextBillion.ai’s Hours of Service (HOS) API enables logistics platforms to optimize trip planning while ensuring compliance with Hours of Service regulations. By integrating the driver's current activity status, accumulated duty times, and detailed trip itineraries, the service evaluates the feasibility of planned stops. It allows users to choose which regulations that need to be applied for their fleets and accordingly identifies necessary HOS breaks, providing precise timing to maintain safety and regulatory adherence throughout the trip.
Request Parameters
Loading..Request Body
Loading..Response Schema
Loading..Current Driver State and its impact
All the different timers that determine and control HOS compliance - continuous driving, daily drive time, daily on-duty time and cycle duty time are impacted by the driver's current activity at the time of submitting an HOS request. Here is a quick summary of different driver states and its corresponding impact on different timers:
| **Driver Activity → ** | daily_drive_minutes_used | daily_duty_minutes_used | minutes_since_last_break | cycle_time |
|---|---|---|---|---|
| driving | ⬆️ Continues increasing from API time | ⬆️ Continues increasing | ⬆️ Continues increasing | ⬆️ Continues increasing |
| on_duty_not_driving | ⏸️ No increase until trip starts | ⬆️ Continues increasing | 🔁 Reset to 0 if break qualifies, else ⬆️ continues increasing | ⬆️ Continues increasing |
| off_duty | ⏸️ No increase until trip starts | ⏸️ No increase until trip starts | 🔁 Reset to 0 if break qualifies, else ⬆️ Continues increasing | ⬆️ Continues increasing |
| daily_break | 🔁 Reset to 0 at trip start | 🔁 Reset to 0 at trip start | 🔁 Reset to 0 | ⬆️ Continues to accumulate after trip starts |
| cycle_break | 🔁 Reset to 0 at trip start | 🔁 Reset to 0 at trip start | 🔁 Reset to 0 | 🔁 Clears the daily_cycle_duty_times array |
| sleeper_berth | ⏸️ No increase until sleeper berth status ends | ⏸️ No increase until sleeper berth status ends | 🔁 Reset to 0 | ⬆️ Continues to accumulate after driver starts working |
Short break qualification for a given current driver state
This section covers when a off_duty or on_duty_not_driving activity by the driver qualifies as a break against continuous driving limitations. Applies only when the driver current activity is one of the following:
on_duty_not_drivingoff_duty
| Condition | Result |
|---|---|
time_elapsed >= 1800 sec (30min) | ✅ Current break qualifies as a short break→ minutes_since_last_break = 0 |
time_elapsed < 1800 sec (30min) | Calculated projected time in the current status. Details in the next rows. |
Projected total break time:(time_elapsed + (trip_start_time - current_time)) >= 1800 sec (30min) | ✅ Current break will qualify before trip → reset minutes_since_last_break to 0 |
Otherwise | ❌ Does NOT qualify → minutes_since_last_break keeps increasing |
Short Haul Trips
As per FMSCA, a driver can skip ELD logging and other tracking & compliance rules, if a trip meets the following rules for short haul trips:
-
150-mile air radius: The driver must operate within this area, with origin/depot/warehouse as the center.
-
Destination: The driver returns to home location at the end of the shift i.e. origin of the trip and the destination for the trip must be the same.
-
The driver must operate within following limits:
- A mandatory 10hr break off-duty before any shift
- Maximum on duty time 14hrs
- Driving time within any 14hr duty window limited to 11hrs
- Cycle duty time limits applied (60H/7D, 70H/8D)
The short haul exemption lapse and standard rules apply if any of the above are not met.
When enable_short_haul_exceptions: true HOS service automatically checks the trip details and qualifies it as a short-haul trip if all rules are met. Such trips are exempted from the clause - “30-min break after 8hr driving” and the service will not insert them when creating the final HOS-compliant trip plan.
However, if any of the short-haul conditions are violated the trip is processed as a standard trip and re-calculated as per standard HOS rules, irrespective of the user input enable_short_haul_exceptions. Standard HOS rules also apply when enable_short_haul_exceptions:false.
Sample API Query
Sample API Response
API Query Limits
- NextBillion.ai allows a maximum rate limit of 6000 queries per minute or 100 queries per second for continuous requests. Note: We can increase the quota if needed on request. Contact support@nextbillion.ai for more details.