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

# (Alpha) Get statistics for a specified electric vehicle

> Retrieve savings and consumption data for a specified electric vehicle, allowing filtering by
    keywords and aggregation by various time resolutions. This endpoint is currently in Alpha
    release and should only be used for testing.



## OpenAPI

````yaml https://app.podero.com/api/partners/v2.0/openapi.json get /api/partners/v2.0/org/{org_id}/users/{user_id}/electric-vehicles/{electric_vehicle_id}/statistics
openapi: 3.1.0
info:
  title: Podero Partner API
  version: '2.0'
  description: >-
    This API provides a unified interaction point for Podero's partner
    companies.


    The goal of this API is to give partners easily integratable endpoints that
    don't require extensive software

    development. For this reason, the endpoints focus around user and device
    management, setting of preferences

    and high level device controls.


    While direct control of devices is implemented for special use cases such as
    pause power, we abstract away low level

    direct device steering so developers and partners can focus on delivering
    maximum value to end users.


    ## Authentication


    Send an OAuth2 access token in the `Authorization: Bearer <access_token>`
    header of each request.

    A token request must have a JSON body. The token endpoints do not read a
    form-encoded body.


    Server-to-server integrations use the client credentials grant:


    ```http

    POST /oauth2/token/

    Authorization: Basic base64(<client_id>:<client_secret>)

    Content-Type: application/json


    {"grant_type": "client_credentials"}

    ```


    The response does not contain a refresh token. The access token expires
    after `expires_in` seconds (one hour).

    To renew it, send the same request again. Use one token for all requests
    until shortly before it expires.

    Do not request a new token for each request. If a request returns `401`, get
    one new token and send the request

    again once. If it returns `401` again, the token is valid but the
    application has no access to that resource,

    and a new token does not change that.


    Apps where a person signs in use the password grant at `POST
    /api/partners/v2.0/auth/token`, and renew the

    session with the `refresh_token` grant at the same endpoint.
  termsOfService: https://www.podero.com/terms-and-conditions
servers: []
security: []
paths:
  /api/partners/v2.0/org/{org_id}/users/{user_id}/electric-vehicles/{electric_vehicle_id}/statistics:
    get:
      tags:
        - User Electric Vehicles
      summary: (Alpha) Get statistics for a specified electric vehicle
      description: >-
        Retrieve savings and consumption data for a specified electric vehicle,
        allowing filtering by
            keywords and aggregation by various time resolutions. This endpoint is currently in Alpha
            release and should only be used for testing.
      operationId: >-
        integrations_api_api_v2_organizations_users_electric_vehicles_router_get_electric_vehicle_statistics
      parameters:
        - in: path
          name: org_id
          schema:
            description: The organization ID
            format: uuid
            title: Org Id
            type: string
          required: true
          description: The organization ID
        - in: path
          name: user_id
          schema:
            description: The user ID
            format: uuid
            title: User Id
            type: string
          required: true
          description: The user ID
        - in: path
          name: electric_vehicle_id
          schema:
            description: The electric vehicle ID
            format: uuid
            title: Electric Vehicle Id
            type: string
          required: true
          description: The electric vehicle ID
        - in: query
          name: resolution
          schema:
            default: 1DAY
            description: >-
              The time interval for aggregating data. Comma Seperated list.
              Supported values: 1DAY, 1WEEK,
                      1MONTH, 1QUARTER, 1YEAR
            title: Resolution
            type: string
          required: false
          description: >-
            The time interval for aggregating data. Comma Seperated list.
            Supported values: 1DAY, 1WEEK,
                    1MONTH, 1QUARTER, 1YEAR
        - in: query
          name: keywords
          schema:
            description: >-
              A comma-separated list of keywords. Supported values: savings,
              consumption
            title: Keywords
            type: string
          required: false
          description: >-
            A comma-separated list of keywords. Supported values: savings,
            consumption
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StatisticsResponse'
      security:
        - OAuth2: []
components:
  schemas:
    StatisticsResponse:
      properties:
        metadata:
          $ref: '#/components/schemas/StatisticsMetadata'
        data:
          items:
            $ref: '#/components/schemas/StatisticsData'
          title: Data
          type: array
      required:
        - metadata
        - data
      title: StatisticsResponse
      type: object
    StatisticsMetadata:
      properties:
        requested_at:
          title: Requested At
          type: string
        query:
          additionalProperties:
            anyOf:
              - type: string
              - type: number
              - items:
                  type: string
                type: array
          title: Query
          type: object
        units:
          additionalProperties:
            anyOf:
              - type: string
              - type: number
          title: Units
          type: object
        error:
          anyOf:
            - type: string
            - type: 'null'
          title: Error
      required:
        - requested_at
        - query
        - units
      title: StatisticsMetadata
      type: object
    StatisticsData:
      properties:
        resolution:
          title: Resolution
          type: string
        period:
          $ref: '#/components/schemas/StatisticsPeriod'
        savings:
          anyOf:
            - $ref: '#/components/schemas/SavingsContent'
            - type: 'null'
        consumption:
          anyOf:
            - $ref: '#/components/schemas/ConsumptionContent'
            - type: 'null'
        heat_pump:
          anyOf:
            - $ref: '#/components/schemas/HeatPumpSavingsContent'
            - type: 'null'
        electric_vehicle:
          anyOf:
            - $ref: '#/components/schemas/ElectricVehicleSavingsContent'
            - type: 'null'
        inverter:
          anyOf:
            - $ref: '#/components/schemas/InverterSavingsContent'
            - type: 'null'
      required:
        - resolution
        - period
      title: StatisticsData
      type: object
    StatisticsPeriod:
      properties:
        start_period:
          title: Start Period
          type: string
        end_period:
          title: End Period
          type: string
      required:
        - start_period
        - end_period
      title: StatisticsPeriod
      type: object
    SavingsContent:
      properties:
        total:
          title: Total
          type: number
        percentage:
          title: Percentage
          type: number
        basis:
          allOf:
            - $ref: '#/components/schemas/SavingsBasis'
          default: self_consumption
      required:
        - total
        - percentage
      title: SavingsContent
      type: object
    ConsumptionContent:
      properties:
        total:
          title: Total
          type: number
      required:
        - total
      title: ConsumptionContent
      type: object
    HeatPumpSavingsContent:
      properties:
        estimated_consumption_wh:
          anyOf:
            - type: number
            - type: 'null'
          title: Estimated Consumption Wh
        context_code:
          anyOf:
            - $ref: '#/components/schemas/HeatPumpSavingsContextCode'
            - type: 'null'
      title: HeatPumpSavingsContent
      type: object
    ElectricVehicleSavingsContent:
      properties:
        estimated_consumption_wh:
          anyOf:
            - type: number
            - type: 'null'
          title: Estimated Consumption Wh
        charge_session_count:
          anyOf:
            - type: integer
            - type: 'null'
          title: Charge Session Count
        average_charge_power_w:
          anyOf:
            - type: number
            - type: 'null'
          title: Average Charge Power W
      title: ElectricVehicleSavingsContent
      type: object
    InverterSavingsContent:
      properties:
        solar_production_wh:
          anyOf:
            - type: number
            - type: 'null'
          title: Solar Production Wh
        grid_export_wh:
          anyOf:
            - type: number
            - type: 'null'
          title: Grid Export Wh
        end_user_opportunity_cost:
          anyOf:
            - type: number
            - type: 'null'
          title: End User Opportunity Cost
        end_user_tariff_cost:
          anyOf:
            - type: number
            - type: 'null'
          title: End User Tariff Cost
        context_code:
          anyOf:
            - $ref: '#/components/schemas/InverterSavingsContextCode'
            - type: 'null'
      title: InverterSavingsContent
      type: object
    SavingsBasis:
      description: >-
        Which settlement a served savings figure is the money of.


        SELF_CONSUMPTION - the household's own bill against a no-optimization
        baseline: the device is
                           settled on its owner's bill, so its optimization is worth what that bill did.
        PAYOUT           - the created value the payout ledger charged: the
        device is settled by its
                           trading fleet, so its optimization is worth what the fleet earned with it,
                           signed and never floored, because the guarantee carries a loss day.
        MIXED            - a bucket wide enough to hold days of both, summed
        each under its own basis.


        Decided per delivery day by the membership fact, never by the caller: a
        device is either a

        payable member of a payout program on that day or it is not.
      enum:
        - self_consumption
        - payout
        - mixed
      title: SavingsBasis
      type: string
    HeatPumpSavingsContextCode:
      description: >-
        Why one heat-pump device-day saved nothing, as a closed set of wire
        values.
      enum:
        - plan_not_confirmed
        - little_heating_demand
        - flat_prices
        - learning_phase
        - no_data
        - no_clear_cause
      title: HeatPumpSavingsContextCode
      type: string
    InverterSavingsContextCode:
      description: >-
        Why one inverter device-day has no savings figure, as a closed set of
        wire values.
      enum:
        - learning_phase
      title: InverterSavingsContextCode
      type: string
  securitySchemes:
    OAuth2:
      type: oauth2
      flows:
        password:
          tokenUrl: /api/partners/v2.0/auth/token
          scopes: {}
        clientCredentials:
          tokenUrl: /oauth2/token/
          scopes: {}

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.