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

# Total Cost of Ownership

> Get started with Total Cost of Ownership API with our step-by-step guide.

export const StoryBoard = ({children}) => <div className="p-6 bg-gray-100/50 dark:bg-gray-800/25 rounded">
    <p className="text-base py-2 leading-6">{children}</p>
  </div>;

## Overview

The Total Cost of Ownership (TCO) API offers a detailed breakdown of the costs associated with vehicle ownership. By providing the `VIN` and `ZIP Code`, you can receive a comprehensive breakdown of the costs involved in owning the vehicle, enabling informed purchasing decisions.

In this guide, we'll follow an example scenario:

<StoryBoard>
  Chris from Minnesota is considering buying a Toyota Tacoma and wants to
  estimate the total cost of ownership. He does not know what the all-in cost of
  taxes, fees, maintenance, repairs, insurance, etc.
</StoryBoard>

To complete this scenario, you will need to:

1. Find a vehicle
2. Send a request
3. Review the data

## Walkthrough

<Steps>
  <Step title="Find a vehicle">
    Chris searched online and found a Toyota Tacoma he wants to buy and gets the VIN.

    ```plaintext theme={null}
    3TYSZ5AN8PT104981
    ```
  </Step>

  <Step title="Send a request">
    Chris sends a request to the TCO API with the vehicle's VIN and his ZIP code.

    <CodeGroup>
      ```javascript tco.js theme={null}
      fetch("https://tco.vin/3TYSZ5AN8PT104981?zip=55414")
        .then((response) => response.json())
        .then((data) => console.log(data));
      ```

      ```python tco.py theme={null}
      import requests

      response = requests.get('https://tco.vin/3TYSZ5AN8PT104981?zip=55414')
      data = response.json()
      print(data)
      ```

      ```shell tco.sh theme={null}
      curl https://tco.vin/3TYSZ5AN8PT104981?zip=55414
      ```
    </CodeGroup>
  </Step>

  <Step title="Review the data">
    Chris receives a response with detailed information about the total cost of ownership for the Toyota Tacoma. He reviews the data carefully before making any financial decisions, as it may impact sales, taxes, and other financial outcomes.

    ```json theme={null}
    {
      "vehicle": {
        "vin": "3TYSZ5AN8PT104981",
        "year": "2023",
        "make": "Toyota",
        "model": "Tacoma"
      },
      "zip": "55414",
      "tco": {
        "total": {
          "taxesAndFees": 4435,
          ...
        },
        "years": {
          "1": {
            "insurance": 1300, // Estimated 1st year insurance costs
            "maintenance": 67, // Estimated maintenance costs
            "repairs": 0,
            "taxesAndFees": 3479, // Sales tax, and other fees
            "financeInterest": 2663, // Interest on a loan
            "depreciation": 8500, // Estimated loss in value
            "fuel": 3735, // Estimated fuel costs
            "tcoPrice": 19744, // Total cost of ownership for the 1st year
            "averageCostPerMile": 0.79 // Average cost per mile
          },
          ...
        }
      }
    }
    ```

    <Warning>
      TCO data should always be reviewed to ensure its correctness.
    </Warning>
  </Step>
</Steps>

## Summary

You have successfully used the Total Cost of Ownership API to estimate the costs associated with owning a vehicle based on the VIN and ZIP code. Chris now has a detailed breakdown of the costs associated with owning the Toyota Tacoma. This
information will help him make an informed decision about his purchase.

***

## Next Steps

Review the API reference for the Total Cost of Ownership API

<Card title="Reference – Total Cost of Ownership" icon="link" href="/data/reference/vehicle/total-cost-ownership">
  Explore the Total Cost of Ownership API endpoint and parameters.
</Card>
