---
title: "Profit / loss calculator"
method: GET
path: "/api/v1/calculators/profit-loss"
tags: ["Calculators"]
---

# Profit / loss calculator

`GET /api/v1/calculators/profit-loss`

What a buy-then-sell between two historical dates returned, using the coin's real
prices on those dates. Fees are flat USD amounts, not percentages.

## Query parameters

- `slug` string, required — The coin's slug identifier.
- `amount` number, required — USD invested at `buy_date` (0.01–1,000,000,000).
- `buy_date` string, required — date Purchase date.
- `sell_date` string, required — date Sale date (on/after `buy_date`).
- `buy_fee` number, nullable — Flat purchase fee in USD (default 0).
- `sell_fee` number, nullable — Flat sale fee in USD (default 0).

## Response `200`

- object
  - `data` object
    - `buy_price` string
    - `sell_price` string
    - `quantity` number
    - `investment_worth` number
    - `total_fees` integer
    - `profit` number
    - `roi` number
  - `meta` object
    - `coin` string
    - `amount` integer
    - `buy_date` string
    - `sell_date` string
    - `buy_fee` integer
    - `sell_fee` integer
    - `currency` string

---

[API](https://skmtc.net/bitculator/apis/bitculator-data-api.md) · [All operations](https://skmtc.net/bitculator/apis/bitculator-data-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/bitculator/bitculator-data-api/revisions/ed1378af68b6/schema)
