post
/api/v2/traffic/speed-trend
Python SDK method:
client.traffic.speed_trend(params).run()

Start speed trend job

Creates a job to generate a speed trend analysis. Produces speed trend data over time for the supplied road segments or zones. Only Custom and Segment zone types are accepted; requests with other zone types are rejected.

Altitude Help Center — getSpeedAnalysisTrendAnalysis

Request Body

Analysis parameters.

application/json: object

NameTypeInput ShapeValuesDescriptionValue Required
aggregationUnitstring--Time unit for trend grouping: 'hour', 'day', 'week', 'month', or 'year'.Y
dateFromstring--First date of the analysis range, formatted as yyyy-mm-dd.Y
dateTostring--Last date of the analysis range, formatted as yyyy-mm-dd.Y
daysOfWeekarray<integer (int64)>--Days of the week to include (1=Sunday … 7=Saturday). An empty array includes all days.N
isDirectionalboolean--When true, one record is returned per direction of travel; when false, results are averaged across both directions.Y
isMetricboolean--When true, speeds are returned in km/h; when false, in mph. Defaults to the isMetric setting on the authenticated user's profile when omitted.N
jobIdstring--Optional job identifier in the format its_<unixMillis>_<11-char alphanumeric> (e.g. its_1234567890123_abcde123456). Generated by the server when omitted.N
percentilesarray<integer (int64)>--Percentile values to compute (1–99). Defaults to [15, 50, 85] when omitted.N
segmentsDirectionalarray<object>direction: integer (int64) (values: -1, 1); segmentId: string-Ordered directional road segments. Provide exactly one of zones, zoneIds, or segmentsDirectional. Direction must be 1 or -1; input order is preserved.N
timeFromstring--Start of the time-of-day range, formatted as hh:mm:ss. Defaults to 00:00:00 when omitted.N
timeTostring--End of the time-of-day range, formatted as hh:mm:ss.999. 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. An empty array includes all vehicle classes.N
vehicleClassSchemeIdinteger--Vehicle classification scheme, from 1 through 5. Defaults to 2 (FHWA/GVWR) when omitted.N
vehicleClassesarray<object>vehicleType: string; weightClass: string-Vehicle class filters. Use an empty array to include all vehicle classes.N
zoneIdsarray<string>--Encoded zone ID strings. Provide exactly one of zoneIds or zones (not both).N
zonesarray<object>code: string; iso_3166_2: string; type: string-Zone objects with code, type, and iso_3166_2. Provide exactly one of zones or zoneIds (not both).N

Examples

Directional segment speed trend

Translated from the v1 directional-segment sample using the v2 segmentsDirectional selector.

{
  "aggregationUnit": "day",
  "dateFrom": "2026-01-01",
  "dateTo": "2026-01-07",
  "daysOfWeek": [],
  "isDirectional": true,
  "isMetric": false,
  "percentiles": [
    15,
    50,
    85
  ],
  "segmentsDirectional": [
    {
      "direction": 1,
      "segmentId": "-5413282495872703901"
    },
    {
      "direction": 1,
      "segmentId": "-4350021053557322330"
    },
    {
      "direction": 1,
      "segmentId": "-5326185399566610743"
    }
  ],
  "timeFrom": "00:00:00",
  "timeTo": "23:59:59.999",
  "vehicleClassSchemeId": 2,
  "vehicleClasses": []
}

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.