Skip to main content

Time

GET /v1/analytics/time

Returns summary statistics (quantiles, mean, and median) for a delivery time metric at a specific building. The address is required.

Requires an API key sent as a Bearer token in the Authorization header.

Request

Query Parameters

ParameterTypeRequired?Description
addressstringYesThe building to analyze.
Example: 123 Main St, San Francisco, CA 94105
metricstringNoWhich time metric to analyze. Default: handoverTime.
Allowed values: handoverTime, totalTime, walkingTime, inBuildingTime, activeTime
quantilesstringNoComma-separated quantile values, each between 0 and 1 (exclusive). Default: 0.05,0.5,0.95. Max: 20.
Example: 0.1,0.5,0.9
deliveryTypestringNoComma-separated delivery type filter.
Allowed values: doorstep, threshold, curbside, vehicle_handoff
timeFramestringNoPreset time window. Default: week.
Allowed values: day, week, month, 3m, ytd, year, all
fromintegerNoStart time in epoch seconds. Overrides timeFrame. Must be ≤ to.
tointegerNoEnd time in epoch seconds. Overrides timeFrame. Must be ≥ from.

Time Metrics

See Time Metrics in the reference for what each metric measures. All time values in the response are in seconds.

Example Request

curl "https://api.core.doorstep.ai/v1/analytics/time?address=123 Main St, San Francisco, CA 94105&metric=handoverTime" \
-H "Authorization: Bearer $API_KEY"

Response

Statistical summary of the requested time metric for the building.

Response Body

FieldTypeDescription
metricstringThe time metric analyzed.
countintegerNumber of sessions included in the summary.
mediannumber | nullMedian value, in seconds. null if there are no sessions.
meannumber | nullMean value, in seconds. null if there are no sessions.
quantilesarray of objectsOne entry per requested quantile.
quantiles[].pnumberThe quantile (between 0 and 1).
quantiles[].valuenumber | nullThe metric value at that quantile, in seconds. null if there are no sessions.

Example Response

{
"metric": "handoverTime",
"count": 342,
"median": 180,
"mean": 195.5,
"quantiles": [
{ "p": 0.05, "value": 45 },
{ "p": 0.5, "value": 180 },
{ "p": 0.95, "value": 420 }
]
}

Limits

  • Max 20 quantiles per request.

Example Usage

A histogram of handoverTime reconstructed from the quantile response. Values are sampled from the inverse CDF defined by the returned quantiles.

Time example

Common Applications

  • More efficient route planning for dispatchers
  • Better stop time estimates
  • Better ETA estimation for the customer
  • More accurate delivery windows
  • Verifying driver stop time during dispute resolution