post
/api/v2/stop-analytics/hours-of-service-analytics
Python SDK method:
client.stop_analytics.hours_of_service_analytics(params).run()

Start hours of service analytics job

Hours of Service Analytics shows how aggregated metrics for commercial drivers' remaining Hours of Service (HOS) status across required Rest, Drive Time, Daily, and Weekly. Use it to support truck parking siting, safety research, and route planning. Results can be filtered by number of stops in a zone (defaults to 30), minimum or maximum hours of service remaining, or vehicle characteristics. Country, Segment, and RelatedRoad zones are not supported.

Altitude Help Center - Stop Analytics API module

Request Body

Analysis parameters.

application/json: object

NameTypeInput ShapeValuesDescriptionValue Required
aggregationModeinteger-0, 2, 3Geographic aggregation mode: 0=road segment, 2=zone, 3=H3.Y
dateRangesarray<object>dateFrom: string (date); dateTo: string (date)-Date ranges to include in the analysis. Maximum 4 non-overlapping ranges; results are aggregated across all ranges. The earliest supported date is April 1, 2026.Y
daysOfWeekarray<integer>-1, 2, 3, 4, 5, 6, 7Days of the week to include (1=Sunday … 7=Saturday). An empty array includes all days.N
fuelTypesarray<string>-diesel, electric, flexible, gasoline, hybrid, other, unknownFuel types to include. Valid values: diesel, electric, flexible, gasoline, hybrid, other, unknown. An empty array includes all fuel types.N
includeGeographyboolean--When true, includes GeoJSON geography in the response. Forced true for aggregation mode 3. Defaults to false for all other modes.N
industriesarray<string>-agriculture, mining, utilities, construction, manufacturing, wholesale, retail, transportation_and_warehousing, information_and_cultural, finance_and_insurance, real_estate, science_and_technology, management, administrative_and_support, education, health_care, arts_and_entertainment, accommodation_and_food, public_administration, other_services, unclassifiedNamed industry IDs from GET /api/v2/filters/industries (e.g. 'manufacturing', 'retail'). Resolved to NAICS codes at query time and combined with any naics values. Leave both industries and naics empty to include all industries.N
maxCellLevelinteger--Maximum H3 cell level when aggregationMode is 3. Defaults to 10.N
maxHosClockRemainingnumber--Maximum hours of service clock time remaining (minutes, inclusive) for a stop to count toward the in-threshold stop counts. Defaults to 60 when omitted.N
minCellLevelinteger--Minimum H3 cell level when aggregationMode is 3. Defaults to 5.N
minHosClockRemainingnumber--Minimum hours of service clock time remaining (minutes, inclusive) for a stop to count toward the in-threshold stop counts. No lower bound when omitted.N
minHosStopCountinteger--Minimum number of hours of service stops an output zone must have to be included in the results. Defaults to 30 when omitted.N
naicsarray<integer>--Explicit raw NAICS integer codes to filter by. Combined with any industries values. Leave both naics and industries empty to include all industries.N
roadTypesarray<string>-living_street, motorway, motorway_link, primary, primary_link, residential, road, secondary, secondary_link, service, tertiary, tertiary_link, trunk, trunk_link, unclassifiedRoad types to include. Applies only when aggregationMode is 0. Omit or send an empty array to include all road types.N
timeFromstring--Start of the time-of-day window (hh:mm:ss or hh:mm:ss.ms). Defaults to 00:00:00 when omitted.N
timeTostring--End of the time-of-day window (hh:mm:ss or hh:mm:ss.ms). Defaults to 23:59:59.999 when omitted.N
vehicleClassIdsarray<string>--Vehicle class filter IDs from GET /api/v2/filters/vehicle-classes. IDs must use the scheme_vehicleClassIndex_categoryIndex format and share one scheme; IDs that do not name a known vehicle class are rejected. An empty array includes all vehicle classes.N
vehicleClassSchemeIdinteger-1, 2, 3, 4, 5, 6Vehicle classification scheme: 1 = VIUS, 2 = GVWR (FHWA), 3 = Truck Weight Classes, 4 = CARB, 5 = Gross Weight Group (custom scheme), 6 = Expansion Factors (custom scheme). Defaults to 2 when omitted. See GET /api/v2/filters/vehicle-class-schemes.N
vehicleClassesarray<object>vehicleType: string (values: Truck, Passenger, MPV, Bus, Limo, Other, n/a); weightClass: string (values: *, Class 1, Class 2, Class 3, Class 4, Class 5, Class 6, Class 7, Class 8, Class A, Class B, Class C, Class D, Class E, Class F, Class G, Class H)-Vehicle class filters. Use an empty array to include all vehicle classes.N
vocationsarray<integer>-1, 2, 3, 4, 5Vocation IDs from GET /api/v2/filters/vocations. An empty array includes all vocations.N
zoneIdsarray<string>--Encoded zone IDs. Country, Segment, and RelatedRoad zones are not supported. Provide either zoneIds or zones, not both.N
zonesarray<object>code: string; iso_3166_2: string; type: string (values: State, County, City, FSA, ZIP, TAZ, CTR, Custom)-Zones to include, each identified by a code, a zone type and a state or province code (iso_3166_2). Country, Segment, and RelatedRoad zones are not supported. Provide either zones or zoneIds, not both.N

Examples

County hours of service request

Zone-level (aggregationMode 2) request for one county.

{
  "aggregationMode": 2,
  "dateRanges": [
    {
      "dateFrom": "2026-04-01",
      "dateTo": "2026-04-30"
    }
  ],
  "zones": [
    {
      "code": "32007",
      "iso_3166_2": "US-NV",
      "type": "County"
    }
  ]
}

Success Responses

202 response: object

Job accepted and queued for processing. Poll the location header URL to check status.

NameTypeDescription
errorobjectDetails about why the job failed (RFC 7807 format), or null if it succeeded.
idstringUnique job identifier.
linksobjectNavigation URLs for polling and result retrieval.
statusstringCurrent job lifecycle state: PENDING, QUEUED, RUNNING, DONE, FAILED, CANCELED, or NOT_FOUND.

Response Errors

HTTP Status CodeReason
400The request body or parameters are invalid.
401Authentication is required or the provided credentials are invalid.
403The authenticated user lacks permission to perform this operation.
409The operation conflicts with the current state of the resource.
422The request is syntactically valid but semantically cannot be processed.
429The request rate limit has been exceeded.
500An unexpected server error occurred.