> ## Documentation Index
> Fetch the complete documentation index at: https://developer.tessie.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Historical States

> Returns historical states for a vehicle during a timeframe.

If no interval is specified, a sensible interval based on the timeframe is used.



## OpenAPI

````yaml get /{vin}/states
openapi: 3.0.0
info:
  title: Tessie API
  version: 1.0.0
  license:
    name: Apache 2.0
    url: https://www.apache.org/licenses/LICENSE-2.0.html
  description: The Tesla management platform.
  contact:
    name: Tessie
    url: https://tessie.com
    email: support@tessie.com
  x-logo:
    url: ''
  termsOfService: https://tessie.com/terms
servers:
  - url: https://api.tessie.com
security:
  - bearerAuth: []
tags:
  - name: Driver Management
    description: Driver management endpoints
  - name: Telemetry Configuration
    description: Vehicle telemetry configuration endpoints
  - name: Vehicle Commands
    description: Vehicle command endpoints
  - name: Vehicle Data
    description: Vehicle data endpoints
paths:
  /{vin}/states:
    parameters:
      - $ref: '#/components/parameters/vin'
    get:
      tags:
        - Vehicle Data
      summary: Get Historical States
      description: >-
        Returns historical states for a vehicle during a timeframe.


        If no interval is specified, a sensible interval based on the timeframe
        is used.
      operationId: get-historical-states
      parameters:
        - $ref: '#/components/parameters/vin'
        - $ref: '#/components/parameters/from'
        - $ref: '#/components/parameters/to'
        - schema:
            type: number
            example: 1
          in: query
          name: interval
          description: >-
            The desired number of seconds between data points. Set to 1 to
            return all data points.
          allowEmptyValue: true
        - schema:
            default: true
            type: boolean
          in: query
          name: condense
          description: Whether to condense data output.
        - $ref: '#/components/parameters/timezone'
        - $ref: '#/components/parameters/distance_format'
        - $ref: '#/components/parameters/temperature_format'
        - $ref: '#/components/parameters/format'
      responses:
        '200':
          content:
            application/json:
              schema:
                description: ''
                oneOf:
                  - properties:
                      results:
                        type: array
                        items:
                          $ref: '#/components/schemas/HistoryState'
                  - properties:
                      results:
                        $ref: '#/components/schemas/CondensedHistoryStates'
                type: object
              examples:
                Example 1:
                  value:
                    results:
                      - id: 1644010150
                        timestamp: 1644010150
                        state: online
                        charging_state: Charging
                        shift_state: P
                        battery_level: 88
                        usable_battery_level: 88
                        battery_range: 266.69
                        ideal_battery_range: 999
                        latitude: 40.7484
                        longitude: 73.9857
                        elevation: null
                        speed: null
                        power: null
                        odometer: 14096.5
                        charge_rate: 2
                        charger_actual_current: 12
                        charger_power: 1
                        charger_phases: 1
                        charger_voltage: 118
                        charge_energy_added: 4.64
                        charge_miles_added_rated: 1.5
                        charge_miles_added_ideal: 422
                        is_climate_on: 0
                        battery_heater_on: 0
                        inside_temp: 37.7
                        outside_temp: 20.5
                        locked: 1
                        sentry_mode: 0
                        lifetime_energy_used: 5224.71
                        energy_remaining: 51.26
                        pack_current: -0.7
                        pack_voltage: 419.79
                        module_temp_min: 25.5
                        module_temp_max: 26
                Example (Condensed):
                  value:
                    results:
                      ids:
                        - 1644010150
                        - 1644010160
                        - 1644010170
                      timestamps:
                        - 1644010150
                        - 1644010160
                        - 1644010170
                      states:
                        - online
                        - online
                        - online
                      charging_states:
                        - Charging
                        - Charging
                        - Charging
                      shift_states:
                        - P
                        - P
                        - P
                      battery_levels:
                        - 88
                        - 88
                        - 88
                      usable_battery_levels:
                        - 88
                        - 88
                        - 88
                      battery_ranges:
                        - 266.69
                        - 266.69
                        - 266.69
                      ideal_battery_ranges:
                        - 999
                        - 999
                        - 999
                      latitudes:
                        - 40.7484
                        - 40.7484
                        - 40.7484
                      longitudes:
                        - 73.9857
                        - 73.9857
                        - 73.9857
                      elevations:
                        - null
                        - null
                        - null
                      speeds:
                        - null
                        - null
                        - null
                      powers:
                        - null
                        - null
                        - null
                      odometers:
                        - 14096.5
                        - 14096.5
                        - 14096.5
                      charge_rates:
                        - 2
                        - 1
                        - 1
                      charger_actual_currents:
                        - 12
                        - 12
                        - 12
                      charger_powers:
                        - 1
                        - 1
                        - 1
                      charger_phasess:
                        - 1
                        - 1
                        - 1
                      charger_voltages:
                        - 118
                        - 119
                        - 118
                      charge_energy_addeds:
                        - 4.64
                        - 4.66
                        - 4.68
                      charge_miles_added_rateds:
                        - 1.5
                        - 1.5
                        - 1.5
                      charge_miles_added_ideals:
                        - 422
                        - 422
                        - 422
                      is_climate_ons:
                        - 0
                        - 0
                        - 0
                      battery_heater_ons:
                        - 0
                        - 0
                        - 0
                      inside_temps:
                        - 37.7
                        - 37.8
                        - 37.7
                      outside_temps:
                        - 20.5
                        - 20.5
                        - 20.5
                      lockeds:
                        - 1
                        - 1
                        - 1
                      sentry_modes:
                        - 0
                        - 0
                        - 0
                      lifetime_energy_used:
                        - 5224.71
                        - 5224.72
                        - 5224.73
                      energy_remaining:
                        - 51.26
                        - 51.28
                        - 51.3
                      pack_current:
                        - -0.7
                        - -0.6
                        - -0.7
                      pack_voltage:
                        - 419.79
                        - 419.81
                        - 419.8
                      module_temp_min:
                        - 25.5
                        - 25.5
                        - 25.5
                      module_temp_max:
                        - 26
                        - 26
                        - 26
          description: Success
components:
  parameters:
    vin:
      name: vin
      description: The associated VIN.
      schema:
        type: string
      in: path
      required: true
      deprecated: false
      x-last-modified: 1643747623235
      example: 5YJXCAE43LF123456
    from:
      name: from
      description: The start of the timeframe. Unix timestamp in seconds.
      schema:
        type: number
      in: query
      required: false
      allowEmptyValue: false
      deprecated: false
      example: 1643747642
      x-last-modified: 1643747658888
    to:
      name: to
      description: The end of the timeframe. Unix timestamp in seconds.
      schema:
        type: number
      in: query
      required: false
      allowEmptyValue: false
      deprecated: false
      example: 1643747642
      x-last-modified: 1643747664858
    timezone:
      name: timezone
      in: query
      schema:
        type: string
        default: UTC
      description: The IANA timezone name.
    distance_format:
      name: distance_format
      in: query
      required: false
      schema:
        type: string
        default: mi
        enum:
          - mi
          - km
      description: Whether to return data in miles or kilometers.
    temperature_format:
      name: temperature_format
      in: query
      required: false
      schema:
        type: string
        default: c
        enum:
          - c
          - f
      description: Whether to return data in Fahrenheit or Celsius.
    format:
      name: format
      in: query
      required: false
      schema:
        type: string
        enum:
          - json
          - csv
        default: json
      description: Whether to output the results in JSON or CSV.
  schemas:
    HistoryState:
      description: The historical state of a vehicle.
      type: object
      title: Historical State
      properties:
        id:
          type: number
          example: 1644010170
        timestamp:
          type: number
          example: 1644010170
        state:
          type: string
          example: online
          nullable: true
        charging_state:
          type: string
          example: Charging
          nullable: true
        shift_state:
          type: string
          example: P
          nullable: true
        battery_level:
          type: number
          example: 88
          nullable: true
        usable_battery_level:
          type: number
          example: 88
          nullable: true
        battery_range:
          type: number
          example: 266.69
          nullable: true
        ideal_battery_range:
          type: number
          example: 999
          nullable: true
        latitude:
          type: number
          example: 40.7128
          nullable: true
        longitude:
          type: number
          example: 74.006
          nullable: true
        elevation:
          type: number
          example: null
          nullable: true
        speed:
          type: number
          example: null
          nullable: true
        power:
          type: number
          example: null
          nullable: true
        odometer:
          type: number
          example: 14096.5
          nullable: true
        charge_rate:
          type: number
          example: 1
          nullable: true
        charger_actual_current:
          type: number
          example: 12
          nullable: true
        charger_power:
          type: number
          example: 1
          nullable: true
        charger_phases:
          type: number
          example: 1
          nullable: true
        charger_voltage:
          type: number
          example: 118
          nullable: true
        charge_energy_added:
          type: number
          example: 4.64
          nullable: true
        charge_miles_added_rated:
          type: number
          example: 1.5
          nullable: true
        charge_miles_added_ideal:
          type: number
          example: 422
          nullable: true
        is_climate_on:
          type: number
          example: 0
          nullable: true
        battery_heater_on:
          type: number
          example: 0
          nullable: true
        inside_temp:
          type: number
          example: 37.7
          nullable: true
        outside_temp:
          type: number
          example: 20.5
          nullable: true
        locked:
          type: number
          example: 1
          nullable: true
        sentry_mode:
          type: number
          example: 0
          nullable: true
        lifetime_energy_used:
          type: number
          example: 5224.71
          nullable: true
        energy_remaining:
          type: number
          example: 51.26
          nullable: true
        pack_current:
          type: number
          example: -0.7
          nullable: true
        pack_voltage:
          type: number
          example: 419.79
          nullable: true
        module_temp_min:
          type: number
          example: 25.5
          nullable: true
        module_temp_max:
          type: number
          example: 26
          nullable: true
    CondensedHistoryStates:
      title: Condensed History States
      description: The historical states of a vehicle in a condensed format.
      type: object
      properties:
        ids:
          type: array
          items:
            type: number
            example: 1644010170
        timestamps:
          type: array
          items:
            type: number
            example: 1644010170
        states:
          type: array
          items:
            type: string
            example: online
            nullable: true
        charging_states:
          type: array
          items:
            type: string
            example: Charging
            nullable: true
        shift_states:
          type: array
          items:
            type: string
            example: P
            nullable: true
        battery_levels:
          type: array
          items:
            type: number
            example: 88
            nullable: true
        usable_battery_levels:
          type: array
          items:
            type: number
            example: 88
            nullable: true
        battery_ranges:
          type: array
          items:
            type: number
            example: 266.69
            nullable: true
        ideal_battery_ranges:
          type: array
          items:
            type: number
            example: 999
            nullable: true
        latitudes:
          type: array
          items:
            type: number
            example: 40.7128
            nullable: true
        longitudes:
          type: array
          items:
            type: number
            example: 74.006
            nullable: true
        elevations:
          type: array
          items:
            type: number
            example: null
            nullable: true
        speeds:
          type: array
          items:
            type: number
            example: null
            nullable: true
        powers:
          type: array
          items:
            type: number
            example: null
            nullable: true
        odometers:
          type: array
          items:
            type: number
            example: 14096.5
            nullable: true
        charge_rates:
          type: array
          items:
            type: number
            example: 1
            nullable: true
        charger_actual_currents:
          type: array
          items:
            type: number
            example: 12
            nullable: true
        charger_powers:
          type: array
          items:
            type: number
            example: 1
            nullable: true
        charger_phasess:
          type: array
          items:
            type: number
            example: 1
            nullable: true
        charger_voltages:
          type: array
          items:
            type: number
            example: 118
            nullable: true
        charge_energy_addeds:
          type: array
          items:
            type: number
            example: 4.64
            nullable: true
        charge_miles_added_rateds:
          type: array
          items:
            type: number
            example: 1.5
            nullable: true
        charge_miles_added_ideals:
          type: array
          items:
            type: number
            example: 422
            nullable: true
        is_climate_ons:
          type: array
          items:
            type: number
            example: 0
            nullable: true
        battery_heater_ons:
          type: array
          items:
            type: number
            example: 0
            nullable: true
        inside_temps:
          type: array
          items:
            type: number
            example: 37.7
            nullable: true
        outside_temps:
          type: array
          items:
            type: number
            example: 20.5
            nullable: true
        lockeds:
          type: array
          items:
            type: number
            example: 1
            nullable: true
        sentry_modes:
          type: array
          items:
            type: number
            example: 0
            nullable: true
        lifetime_energy_used:
          type: array
          items:
            type: number
            example: 5224.71
            nullable: true
        energy_remaining:
          type: array
          items:
            type: number
            example: 51.26
            nullable: true
        pack_current:
          type: array
          items:
            type: number
            example: -0.7
            nullable: true
        pack_voltage:
          type: array
          items:
            type: number
            example: 419.79
            nullable: true
        module_temp_min:
          type: array
          items:
            type: number
            example: 25.5
            nullable: true
        module_temp_max:
          type: array
          items:
            type: number
            example: 26
            nullable: true
  securitySchemes:
    bearerAuth:
      scheme: bearer
      type: http

````