> ## Documentation Index
> Fetch the complete documentation index at: https://docs.voltview.co.uk/llms.txt
> Use this file to discover all available pages before exploring further.

# Energy cost data for a specific site

> Retrieves energy cost data for a specific site



## OpenAPI

````yaml get /v1/sites/{siteId}/cost
openapi: 3.0.3
info:
  title: VoltView API
  description: >-
    The VoltView API provides comprehensive energy monitoring and management
    capabilities for multi-site businesses, enabling real-time tracking of
    energy consumption, cost analysis, and environmental impact metrics.


    Our API suite includes:

    - Site Management API - Manage and monitor multiple site locations

    - Energy Consumption API - Access detailed energy usage data

    - Cost Analysis API - Track and analyse energy costs

    - Environmental Metrics API - Monitor carbon emissions and energy efficiency

    - Bill Validation API - Validate and audit utility bills for accuracy

    - Supplier Integration API - Integrate with utility suppliers for automated
    data collection


    ## Getting started guide


    To start using the VoltView API, you need to:


    - Sign up for a VoltView account to receive your API credentials

    - Review our data granularity options (hourly/daily/monthly)

    - Ensure your requests are sent via HTTPS

    - All responses are returned in JSON format


    ## Authentication


    Include your VoltView API key in the `x-api-key` header on every request.


    ### Authentication error response

    If authentication fails, you will receive an HTTP 401 Unauthorised response
    with a detailed error message in the JSON response body.


    ## Data Units

    - Energy Consumption: kWh

    - Power Demand: kW

    - Carbon Emissions: kg CO2e/tonnes CO2e

    - Currency: GBP (£)

    - Time Series: ISO 8601 format

    - Numeric Values: Rounded to 2 decimal places
  version: 1.0.0
  contact:
    email: info@voltview.co.uk
  license:
    name: Proprietary
servers:
  - url: https://api.voltview.co.uk
    description: Production server
security:
  - apiKeyAuth: []
tags:
  - name: Authentication
    description: Endpoints for authentication
  - name: User
    description: User profile management
  - name: Sites
    description: Multi-site management endpoints
  - name: Energy Consumption
    description: Energy consumption data endpoints
  - name: Specific Site
    description: Operations for specific sites
  - name: Meters
    description: Meter lookup and meter readings management
  - name: Emissions
    description: Carbon emissions data endpoints
  - name: LOA Management
    description: >-
      Letter of Authority (LOA) management - create, list, view, and update
      status of LOAs
  - name: Supplier Integration
    description: Utilities integration endpoints
  - name: Billing Insights
    description: Account-level billing insights and bill assurance opportunities
  - name: Bill Validation
    description: Utility bill validation and error detection endpoints
paths:
  /v1/sites/{siteId}/cost:
    get:
      tags:
        - Specific Site
      summary: Energy cost data for a specific site
      description: Retrieves energy cost data for a specific site
      operationId: getSiteSpecificCost
      parameters:
        - $ref: '#/components/parameters/siteId'
        - $ref: '#/components/parameters/lookback'
        - $ref: '#/components/parameters/granularity'
        - $ref: '#/components/parameters/from'
        - $ref: '#/components/parameters/to'
      responses:
        '200':
          description: Cost data retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CostData'
        4XX:
          $ref: '#/components/responses/Error4XX'
components:
  parameters:
    siteId:
      in: path
      name: siteId
      required: true
      schema:
        type: string
      description: Site identifier
    lookback:
      in: query
      name: lookback
      required: false
      schema:
        type: string
        pattern: ^\d+[dwmy]$
        example: 1y
      description: >-
        Time period to look back (e.g. 1d, 1w, 1m, 1y for day, week, month,
        year)
    granularity:
      in: query
      name: granularity
      required: false
      schema:
        type: string
        enum:
          - hour
          - day
          - month
          - year
      description: Data aggregation granularity
    from:
      in: query
      name: from
      required: false
      schema:
        type: string
        format: date-time
        example: '2024-01-01T00:00:00.000Z'
      description: Start date and time (ISO 8601)
    to:
      in: query
      name: to
      required: false
      schema:
        type: string
        format: date-time
        example: '2024-12-31T23:59:59.999Z'
      description: End date and time (ISO 8601)
  schemas:
    CostData:
      type: object
      properties:
        siteId:
          type: string
          description: Site identifier
        period:
          type: string
          description: Reporting period
        totalCost:
          type: number
          description: Total cost in GBP
        energyCost:
          type: number
          description: Energy cost in GBP
        standingCharges:
          type: number
          description: Standing charges in GBP
        data:
          type: array
          items:
            type: object
            properties:
              timestamp:
                type: string
                format: date-time
              cost:
                type: number
              consumption:
                type: number
  responses:
    Error4XX:
      description: Client error response
      content:
        application/json:
          schema:
            type: object
            properties:
              type:
                type: string
                enum:
                  - error
              error:
                type: object
                properties:
                  type:
                    type: string
                    enum:
                      - invalid_request_error
                  message:
                    type: string
                    default: Invalid request
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: VoltView API key

````