> For the complete documentation index, see [llms.txt](https://navixy.com/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://navixy.com/docs/navixy-api/user-api/resources/tracking/tracker/stats/stats_mileage.md).

# Mileage

How far a tracker travelled over a period, in kilometres, grouped by tracker and day.

Mileage is the distance a tracker covered over a period, returned in kilometres and broken down by tracker and then by day.

Date and time values follow the [platform formats](/docs/navixy-api/general/api-conventions.md#date-time-formats).

## API actions

API base path: `/tracker/stats/mileage`.

***

## Read mileage per day

> Get mileage in kilometres for a period, grouped by tracker and then by day. Available to demo accounts.\
> \
> \*\*A day with no data comes back as \`null\`, not as zero.\*\* That distinction matters: \`null\` means nothing was recorded, while \`{"mileage": 0.0}\` means the device was tracked and did not move.

```json
{"openapi":"3.1.0","info":{"title":"Navixy Platform API","version":"1.0.0"},"tags":[{"name":"Trackers","description":"Trackers, the devices the platform tracks, together with the geo links that share their live location with people outside the account. Resources under the /tracker/ path."}],"servers":[{"url":"https://api.eu.navixy.com/v2","description":"Navixy production server on European platform"},{"url":"https://api.us.navixy.com/v2","description":"Navixy production server on American platform"},{"url":"https://api.me.navixy.com/v2","description":"Navixy production server on Middle East platform"}],"security":[{"api_key":[]}],"components":{"securitySchemes":{"api_key":{"type":"apiKey","description":"Either a user session hash or an API key, with the \"NVX \" prefix, for example \"NVX 22eac1c27af4be7b9d04da2ce1af111b\". Obtain a session hash from the userAuth operation, or create an API key from the API keys operations. A small number of operations accept a session hash only and reject an API key with error code 4; each says so in its description.","name":"Authorization","in":"header"}},"responses":{"ResponseError":{"description":"Error response object","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Always false."},"status":{"type":"object","description":"Error status. Present only when an error occurred.","properties":{"code":{"type":"integer","description":"An error code in this API, not an HTTP code."},"description":{"type":"string","description":"An error description."}}},"errors":{"type":"array","description":"Per-parameter detail, returned with validation failures such as error code 7. A parameter name here may be an internal field name rather than the documented parameter name.","items":{"type":"object","properties":{"parameter":{"type":"string","description":"Name of the parameter that failed validation."},"error":{"type":"string","description":"What was wrong with it."}}}}}}}}}}},"paths":{"/tracker/stats/mileage/read":{"post":{"tags":["Trackers"],"summary":"Read mileage per day","description":"Get mileage in kilometres for a period, grouped by tracker and then by day. Available to demo accounts.\n\n**A day with no data comes back as `null`, not as zero.** That distinction matters: `null` means nothing was recorded, while `{\"mileage\": 0.0}` means the device was tracked and did not move.","operationId":"trackerStatsMileageRead","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"trackers":{"type":"array","description":"Tracker IDs. At most 128 per request.","items":{"type":"integer"},"maxItems":128},"from":{"type":"string","description":"Start of the period, `YYYY-MM-DD HH:MM:SS`, in the account timezone."},"to":{"type":"string","description":"End of the period. Must be after `from`."}},"required":["trackers","from","to"]}}}},"responses":{"200":{"description":"The mileage","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"`true` if request finished successfully.","readOnly":true},"result":{"type":"object","description":"Keyed by tracker ID, then by date.","additionalProperties":{"type":"object","description":"Keyed by date, `YYYY-MM-DD`.","additionalProperties":{"type":["object","null"],"description":"Mileage for that day, or null when nothing was recorded.","properties":{"mileage":{"type":"number","description":"Distance travelled that day, in kilometres."}}}}},"limit_exceeded":{"type":"boolean","description":"`true` when the period was clipped because it exceeded what the plan covers."}}}}}},"400":{"description":"Bad request. The response body carries the API-level error code in `status.code`. Validation failures also include an `errors` array naming each offending parameter.","$ref":"#/components/responses/ResponseError"},"403":{"description":"Error 211: the period is longer than the platform allows. Error 217: the list names trackers that do not exist. Error 221: the dealer's device limit is exceeded.","$ref":"#/components/responses/ResponseError"},"default":{"$ref":"#/components/responses/ResponseError"}}}}}}
```

#### Errors

These errors come in addition to the [general error codes](/docs/navixy-api/general/errors.md#error-codes):

* 211 - The period is longer than the Navixy platform allows.
* 217 - The list names trackers that do not exist.
* 221 - The dealer's device limit is exceeded.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://navixy.com/docs/navixy-api/user-api/resources/tracking/tracker/stats/stats_mileage.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
