API reference
Every field. Every code.
Addresses, fields, errors and limits of the API in one place. The same description is machine readable as OpenAPI 3.1.
Key and origin
One header, any origin.
Read access to your Drivts account: sessions, metrics, driving data and the live state. Every request carries a read key in the Authorization header.
Every request except this description carries Authorization: Bearer drivts_ro_…. Every answer, errors and preflight included, allows any origin and never cookies, so a browser source or a local file can call it. A session cookie of the portal is never read: without a key the answer is 401.
Sandbox
Sample data, same shape.
With a drivts_sb_… key every address answers with sample data and carries sandbox: true, errors after the key check too. The CSV carries the header X-Drivts-Sandbox: true instead, which every answer of a sandbox key has. A ticket of a sandbox key opens the demo stream, never the real one.
- sandboxPresent only with a sandbox key, then always true.
- X-Drivts-Sandboxtrue on every answer of a sandbox key.
Addresses
What you can ask for.
GET/api/ v1/ me
Who am I
Level, streak and the state of the steps of the account of the key, and how many sessions are still being analysed.
Parameters
- NameTypeMeaning
- lang"de" | "en"Language of level names and goal texts:
deoren, defaulten.
Answers
- 200Done.
- 401Key missing, wrong or revoked
- 403The account is suspended. Accept the current terms of use in the portal. The export works without.
- 429Too many requests, wait as long as
Retry-Aftersays - 500Error on our side
Fields
- NameTypeMeaning
- v1Version of the answer, always 1
- sandboxtruePresent only with a sandbox key, then always true.
- analysisbooleanWhether the account has Analysis access
- pendingintegerSessions whose metrics are still being calculated
- levelobject | nullCurrent level:
nrandname - streakobject | nullSessions towards the next level:
countofneeded - blockobject | nullThe steps of the coach in the current level:
stepofsteps,madeofneeddrifts,togetherwhen the steps run as one.nullfrom level 10 on - noticeNotice | nullWhy fields are
null:{ code: "entitlement_required", fields }, elsenull
GET/api/ v1/ sessions
List of sessions
Your sessions, newest first, in pages. Guest sessions on your PC are included.
Parameters
- NameTypeMeaning
- limitintegerSessions per page, 1 to 100, default 50.
- beforestringWhere the next page starts: the value of
nextfrom the answer before, as it is. It is a cursor, not the id of a session. - lang"de" | "en"Language of level names and goal texts:
deoren, defaulten.
Answers
- 200Done.
- 400A parameter does not fit, for example
limit=500 - 401Key missing, wrong or revoked
- 403The account is suspended. Accept the current terms of use in the portal. The export works without.
- 429Too many requests, wait as long as
Retry-Aftersays - 500Error on our side
Fields
- NameTypeMeaning
- v1Version of the answer, always 1
- sandboxtruePresent only with a sandbox key, then always true.
- sessionsSessionItem[]The sessions of this page, newest first
- sessions[].
idstringId of the session - sessions[].
numberintegerNumber of the session per driver, the oldest is 1 - sessions[].
startedAtstring (ISO)Start as ISO text - sessions[].
startedAtMsintegerStart in ms since 1970 - sessions[].
endedAtstring | nullEnd as ISO text, nullif unknown - sessions[].
endedAtMsinteger | nullEnd in ms since 1970, nullif unknown - sessions[].
trackstring | nullTrack, nullif unknown - sessions[].
carstring | nullCar, nullif unknown - sessions[].
driver"owner" | "guest" ownerorguest - sessions[].
kind"training" | "check" | "placement" training,checkorplacement - sessions[].
coachedbooleanWhether the coach was on - sessions[].
driftsinteger | nullNumber of drifts - sessions[].
longestDriftSnumber | nullLongest drift in seconds - nextstring | nullCursor for
?before=of the next page,nullon the last - noticeNotice | nullWhy fields are
null:{ code: "entitlement_required", fields }, elsenull
GET/api/ v1/ sessions/ {id}
One session
One session with duration, level, metrics, drifts and goals. Coach hints, the debrief and notes never go out.
Parameters
- NameTypeMeaning
- idstring · requiredId of the session, from the list.
- lang"de" | "en"Language of level names and goal texts:
deoren, defaulten.
Answers
- 200Done.
- 401Key missing, wrong or revoked
- 403The account is suspended. Accept the current terms of use in the portal. The export works without.
- 404Your account has no such session
- 429Too many requests, wait as long as
Retry-Aftersays - 500Error on our side
Fields
- NameTypeMeaning
- v1Version of the answer, always 1
- sandboxtruePresent only with a sandbox key, then always true.
- sessionSessionItemThe session as in the list
- session.
idstringId of the session - session.
numberintegerNumber of the session per driver, the oldest is 1 - session.
startedAtstring (ISO)Start as ISO text - session.
startedAtMsintegerStart in ms since 1970 - session.
endedAtstring | nullEnd as ISO text, nullif unknown - session.
endedAtMsinteger | nullEnd in ms since 1970, nullif unknown - session.
trackstring | nullTrack, nullif unknown - session.
carstring | nullCar, nullif unknown - session.
driver"owner" | "guest" ownerorguest - session.
kind"training" | "check" | "placement" training,checkorplacement - session.
coachedbooleanWhether the coach was on - session.
driftsinteger | nullNumber of drifts - session.
longestDriftSnumber | nullLongest drift in seconds - durationSnumber | nullDuration in seconds
- levelobject | nullLevel the session counted for:
nrandname - metricsMetrics | nullMetrics of the session
- metrics.
driftsTotalinteger | nullDrifts in the session - metrics.
longestDriftSnumber | nullLongest drift in seconds - metrics.
meanAngleDegnumber | nullMean drift angle in degrees - metrics.
maxAngleDegnumber | nullLargest drift angle in degrees - metrics.
angleWobbleDegnumber | nullHow much the angle swings within a drift, in degrees - metrics.
meanSpeedKmhnumber | nullMean speed in drifts, km/h - metrics.
fullThrottleSharenumber | nullShare of drift time at full throttle, 0 to 1 - metrics.
spinsinteger | nullSpins - metrics.
switchesinteger | nullSwitches from one side to the other - driftsDrift[] | nullEvery drift of the session
- drifts[].
nintegerNumber of the drift - drifts[].
side"left" | "right" leftorright - drifts[].
startSnumberStart in seconds on the axis t_sof the export - drifts[].
endSnumberEnd in seconds on the axis t_sof the export - drifts[].
durationSnumberDuration in seconds - drifts[].
angleDegnumberMean angle in degrees, one decimal - drifts[].
maxAngleDegnumberLargest angle in degrees, one decimal - drifts[].
speedKmhnumberMean speed in km/h, one decimal - drifts[].
gearinteger | nullGear at the start - drifts[].
end"switch" | "spin" | "too_slow" | "straightened" | "recording_end" | nullHow it ended: switch,spin,too_slow,straightenedorrecording_end,nullif unknown - goalsGoal[] | nullGoals of the level and whether they were met
- goals[].
textstringThe goal as the portal shows it - goals[].
valuestringWhat the session reached - goals[].
metbooleanWhether it was met - noticeNotice | nullWhy fields are
null:{ code: "entitlement_required", fields }, elsenull
GET/api/ v1/ sessions/ {id}/ telemetry. csv
Driving data as CSV
The driving data of one session at 20 Hz on one time axis. Counts as an export and works without the current terms of use and without Analysis access. Older sessions without a time channel get t_s counted from the samples: that assumes no gaps and one rate. Every call counts toward the 10 exports per hour and key, also one answered with 404 or 413.
Parameters
- NameTypeMeaning
- idstring · requiredId of the session, from the list.
Answers
- 200The CSV file, UTF-8 with BOM.
- 401Key missing, wrong or revoked
- 403The account is suspended
- 404Your account has no such session
- 413Session too large for one export
- 429Too many requests, wait as long as
Retry-Aftersays - 500Error on our side
GET/api/ v1/ sessions/ {id}/ telemetry. json
Driving data as JSON
The same columns as the CSV as { v, session, hz, columns, rows }, an empty cell is null. Counts as an export like the CSV. Older sessions without a time channel get t_s counted from the samples: that assumes no gaps and one rate. Every call counts toward the 10 exports per hour and key, also one answered with 404 or 413.
Parameters
- NameTypeMeaning
- idstring · requiredId of the session, from the list.
Answers
- 200The file as JSON.
- 401Key missing, wrong or revoked
- 403The account is suspended
- 404Your account has no such session
- 413Session too large for one export
- 429Too many requests, wait as long as
Retry-Aftersays - 500Error on our side
Fields
- NameTypeMeaning
- v1Version of the answer, always 1
- sandboxtruePresent only with a sandbox key, then always true.
- sessionobjectId, start, track, car and driver of the session
- hzinteger | nullSamples per second,
nullfor a session without driving data - columnsstring[]Names of the columns
- rowsnumber | null[][]One list per sample in the order of
columns, an empty cell isnull
POST/api/ v1/ live/ ticket
Ticket for the live stream
A one-time ticket for the live stream, valid for 60 seconds. Open a WebSocket to url?ticket=… with it.
Answers
- 200Done.
- 401Key missing, wrong or revoked
- 403The account is suspended. Accept the current terms of use in the portal. The export works without.
- 429Too many requests, wait as long as
Retry-Aftersays - 500Error on our side
Fields
- NameTypeMeaning
- sandboxtruePresent only with a sandbox key, then always true.
- ticketstringThe ticket, valid once
- urlstringAddress of the stream
- expiresAtstring (ISO)When the ticket expires, ISO text
GET/api/ v1/ openapi. json
This description · no key needed
The description of the API as OpenAPI 3.1. Needs no key.
Answers
- 200The description as JSON.
Live stream
Ticket, stream, packets.
Get a ticket with the key, open a WebSocket to the url of the answer with ?ticket=, then read. The stream carries the messages of the live page of the portal, each with the deviceId of the PC it came from. The state follows the live page of the portal: level, streak and steps are in it with or without Analysis access. /me and the sessions set them to null without it. A stream lasts at most 12 hours, then it closes with 4004. The stream is read only. Every message you send counts as invalid, more than 20 close it with 1008.
Messages
- agent_statusA PC of the account comes online, goes offline or was removed:
status,lastSeen,agentVersion,game. - stateThe whole state of the running session as the live page shows it: track, car, level, goals, task, coach and drifts.
- eventSomething happened,
kindsays what,dataholds the details.
Kinds of event
- driftA drift ended
- coachA sentence of the coach
- taskA new task
- session_startA session started
- session_endThe session ended
- check_tryA try in a check
- angleThe drift angle 5 times a second, sent once a second
- telemetryThe driving values, fields below
Fields of telemetry
- NameTypeMeaning
- hz20Samples per second,
nullfor a session without driving data - speedKmhnumber[]Speed in km/h
- angleDegnumber[]Drift angle in degrees, slip of the rear axle, left positive
- throttlePctnumber[]Throttle and brake, 0 to 100
- brakePctnumber[]Throttle and brake, 0 to 100
- clutchPctnumber[]Clutch pedal, 0 to 100, 100 means fully pressed
- steerPctnumber[]Steering, −100 to 100, right positive, measured against the calibrated lock
- handbrake0 | 1[]Handbrake, 0 or 1, only with the Drivts app for Assetto Corsa, else 0
- gearinteger[]Gear: −1 reverse, 0 neutral, 1 to 9
- rpminteger[]Revolutions per minute
Close codes
- 4004
After 12 hours it ends. Get a new ticket right away and reconnect.
- 4005
The key was revoked or the account suspended. Do not retry.
- 1013
4 streams already open for this account. Close one and try later.
- 1008
The receiver sent something. The stream is read only.
Limits
Where it stops.
- 60
requests per minute and key
- 10
exports per hour and key, on top of the 60
- 4
open live streams per account
- 12 h
at most per stream, then a new ticket
- 30
tickets per minute and account, each valid for 60 seconds
- 10
keys per account
Above that you get 429 with Retry-After in seconds. A very long session that is too large for one export gets 413, like the export in the portal.
More than 20 requests in one minute with a missing or wrong key, and the address gets 429 for up to a minute, even with a correct key. When many computers share one address, behind a router or on a mobile network, that counts for all of them.
Errors
Codes that stay.
- CodeStatusMeaning
- unauthorized401Key missing, wrong or revoked
- account_suspended403The account is suspended
- terms_required403Accept the current terms of use in the portal. The export works without.
- not_found404Your account has no such session
- invalid_input400A parameter does not fit, for example
limit=500 - payload_too_large413Session too large for one export
- rate_limited429Too many requests, wait as long as
Retry-Aftersays - internal500Error on our side