curl --request POST \
--url https://api.iotools.cloud/v1/tool/bitcoin-investment-calculator \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"investmentAmount": "1000",
"purchasePrice": "45000",
"targetPrice": "120000",
"holdingPeriodYears": "4",
"currency": "USD"
}
'import requests
url = "https://api.iotools.cloud/v1/tool/bitcoin-investment-calculator"
payload = {
"investmentAmount": "1000",
"purchasePrice": "45000",
"targetPrice": "120000",
"holdingPeriodYears": "4",
"currency": "USD"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
investmentAmount: '1000',
purchasePrice: '45000',
targetPrice: '120000',
holdingPeriodYears: '4',
currency: 'USD'
})
};
fetch('https://api.iotools.cloud/v1/tool/bitcoin-investment-calculator', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.iotools.cloud/v1/tool/bitcoin-investment-calculator",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'investmentAmount' => '1000',
'purchasePrice' => '45000',
'targetPrice' => '120000',
'holdingPeriodYears' => '4',
'currency' => 'USD'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.iotools.cloud/v1/tool/bitcoin-investment-calculator"
payload := strings.NewReader("{\n \"investmentAmount\": \"1000\",\n \"purchasePrice\": \"45000\",\n \"targetPrice\": \"120000\",\n \"holdingPeriodYears\": \"4\",\n \"currency\": \"USD\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.iotools.cloud/v1/tool/bitcoin-investment-calculator")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"investmentAmount\": \"1000\",\n \"purchasePrice\": \"45000\",\n \"targetPrice\": \"120000\",\n \"holdingPeriodYears\": \"4\",\n \"currency\": \"USD\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.iotools.cloud/v1/tool/bitcoin-investment-calculator")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"investmentAmount\": \"1000\",\n \"purchasePrice\": \"45000\",\n \"targetPrice\": \"120000\",\n \"holdingPeriodYears\": \"4\",\n \"currency\": \"USD\"\n}"
response = http.request(request)
puts response.read_body{
"tool": "bitcoin-investment-calculator",
"tool_version": "1.0.2",
"outputs": {
"summary": [
{
"metric": "Investment Amount",
"value": "$1,000.00"
},
{
"metric": "BTC Purchase Price",
"value": "$45,000.00"
},
{
"metric": "Target BTC Price",
"value": "$120,000.00"
},
{
"metric": "BTC Amount Owned",
"value": "0.02222222 BTC"
},
{
"metric": "Satoshi Equivalent",
"value": "2,222,222 sats"
},
{
"metric": "Future Value",
"value": "$2,666.67"
},
{
"metric": "Profit/Loss",
"value": "$1,666.67"
},
{
"metric": "Result",
"value": "Profit"
},
{
"metric": "ROI",
"value": "+166.67%"
},
{
"metric": "CAGR (over 4 yr)",
"value": "+27.79%"
}
],
"scenarios": [
{
"scenario": "Bear (0.5×)",
"btc-price": "$60,000.00",
"future-value": "$1,333.33",
"profit-loss": "$333.33",
"roi": "+33.33%"
},
{
"scenario": "Base (target)",
"btc-price": "$120,000.00",
"future-value": "$2,666.67",
"profit-loss": "$1,666.67",
"roi": "+166.67%"
},
{
"scenario": "Bull (2×)",
"btc-price": "$240,000.00",
"future-value": "$5,333.33",
"profit-loss": "$4,333.33",
"roi": "+433.33%"
}
],
"benchmarks": [
{
"asset": "Bitcoin (this projection)",
"avg-annual-return": "+27.79%",
"projected-value": "$2,666.67"
},
{
"asset": "S&P 500 (historical avg.)",
"avg-annual-return": "+10.00%",
"projected-value": "$1,464.10"
},
{
"asset": "Gold (historical avg.)",
"avg-annual-return": "+7.00%",
"projected-value": "$1,310.80"
}
],
"milestones": [
{
"return-multiple": "1.5×",
"btc-price-needed": "$67,500.00"
},
{
"return-multiple": "2×",
"btc-price-needed": "$90,000.00"
},
{
"return-multiple": "3×",
"btc-price-needed": "$135,000.00"
},
{
"return-multiple": "5×",
"btc-price-needed": "$225,000.00"
},
{
"return-multiple": "10×",
"btc-price-needed": "$450,000.00"
},
{
"return-multiple": "20×",
"btc-price-needed": "$900,000.00"
},
{
"return-multiple": "100×",
"btc-price-needed": "$4,500,000.00"
}
]
},
"credits_used": 5,
"credits_remaining": null
}{
"type": "https://docs.iotools.cloud/errors/validation_error",
"title": "Invalid request",
"status": 400,
"code": "validation_error",
"detail": "One or more inputs are invalid — see `fields`.",
"request_id": "e4042b29-8f1e-4c7a-9b52-6f0d1a3c7e11",
"fields": {
"inputString": "Required"
}
}{
"type": "https://docs.iotools.cloud/errors/invalid_api_key",
"title": "Invalid API key",
"status": 401,
"code": "invalid_api_key",
"detail": "Provide 'Authorization: Bearer <key>'.",
"request_id": "e4042b29-8f1e-4c7a-9b52-6f0d1a3c7e11"
}{
"type": "https://docs.iotools.cloud/errors/insufficient_credits",
"title": "Insufficient credits",
"status": 402,
"code": "insufficient_credits",
"detail": "This call costs 1 credit and 0 remain in this month's allowance.",
"request_id": "e4042b29-8f1e-4c7a-9b52-6f0d1a3c7e11",
"credits_used": 0,
"credits_remaining": 0
}{
"type": "https://docs.iotools.cloud/errors/tool_not_allowed",
"title": "Tool not available over the API",
"status": 403,
"code": "tool_not_allowed",
"detail": "\"Background Remover\" is available on iotools.cloud but has no API endpoint.",
"request_id": "e4042b29-8f1e-4c7a-9b52-6f0d1a3c7e11"
}{
"type": "https://docs.iotools.cloud/errors/tool_not_found",
"title": "Tool not found",
"status": 404,
"code": "tool_not_found",
"detail": "No tool with that slug. See GET /v1/tools/list.",
"request_id": "e4042b29-8f1e-4c7a-9b52-6f0d1a3c7e11"
}{
"type": "https://docs.iotools.cloud/errors/payload_too_large",
"title": "Payload too large",
"status": 413,
"code": "payload_too_large",
"detail": "Request body exceeds this tool's size limit.",
"request_id": "e4042b29-8f1e-4c7a-9b52-6f0d1a3c7e11"
}{
"type": "https://docs.iotools.cloud/errors/unprocessable_input",
"title": "Input cannot be processed",
"status": 422,
"code": "unprocessable_input",
"detail": "This video has no captions or subtitles, so there is no transcript to extract.",
"request_id": "e4042b29-8f1e-4c7a-9b52-6f0d1a3c7e11",
"credits_used": 0
}{
"type": "https://docs.iotools.cloud/errors/rate_limited",
"title": "Rate limit exceeded",
"status": 429,
"code": "rate_limited",
"detail": "Too many requests. Retry in 30s.",
"request_id": "e4042b29-8f1e-4c7a-9b52-6f0d1a3c7e11",
"retry_after": 30
}{
"type": "https://docs.iotools.cloud/errors/processing_error",
"title": "Tool failed to run",
"status": 500,
"code": "processing_error",
"detail": "The tool failed to run. Please try again.",
"request_id": "e4042b29-8f1e-4c7a-9b52-6f0d1a3c7e11",
"credits_used": 0
}{
"type": "https://docs.iotools.cloud/errors/tool_disabled",
"title": "Tool temporarily disabled",
"status": 503,
"code": "tool_disabled",
"detail": "This tool is temporarily unavailable. Try again shortly.",
"request_id": "e4042b29-8f1e-4c7a-9b52-6f0d1a3c7e11"
}Bitcoin Investment Calculator
Project Bitcoin holdings, future value, profit, ROI, and CAGR from an investment amount, purchase price, and target price — with bear/base/bull scenarios, S&P 500 and gold benchmarks, and a return-multiple milestone table.
curl --request POST \
--url https://api.iotools.cloud/v1/tool/bitcoin-investment-calculator \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"investmentAmount": "1000",
"purchasePrice": "45000",
"targetPrice": "120000",
"holdingPeriodYears": "4",
"currency": "USD"
}
'import requests
url = "https://api.iotools.cloud/v1/tool/bitcoin-investment-calculator"
payload = {
"investmentAmount": "1000",
"purchasePrice": "45000",
"targetPrice": "120000",
"holdingPeriodYears": "4",
"currency": "USD"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
investmentAmount: '1000',
purchasePrice: '45000',
targetPrice: '120000',
holdingPeriodYears: '4',
currency: 'USD'
})
};
fetch('https://api.iotools.cloud/v1/tool/bitcoin-investment-calculator', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.iotools.cloud/v1/tool/bitcoin-investment-calculator",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'investmentAmount' => '1000',
'purchasePrice' => '45000',
'targetPrice' => '120000',
'holdingPeriodYears' => '4',
'currency' => 'USD'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.iotools.cloud/v1/tool/bitcoin-investment-calculator"
payload := strings.NewReader("{\n \"investmentAmount\": \"1000\",\n \"purchasePrice\": \"45000\",\n \"targetPrice\": \"120000\",\n \"holdingPeriodYears\": \"4\",\n \"currency\": \"USD\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.iotools.cloud/v1/tool/bitcoin-investment-calculator")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"investmentAmount\": \"1000\",\n \"purchasePrice\": \"45000\",\n \"targetPrice\": \"120000\",\n \"holdingPeriodYears\": \"4\",\n \"currency\": \"USD\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.iotools.cloud/v1/tool/bitcoin-investment-calculator")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"investmentAmount\": \"1000\",\n \"purchasePrice\": \"45000\",\n \"targetPrice\": \"120000\",\n \"holdingPeriodYears\": \"4\",\n \"currency\": \"USD\"\n}"
response = http.request(request)
puts response.read_body{
"tool": "bitcoin-investment-calculator",
"tool_version": "1.0.2",
"outputs": {
"summary": [
{
"metric": "Investment Amount",
"value": "$1,000.00"
},
{
"metric": "BTC Purchase Price",
"value": "$45,000.00"
},
{
"metric": "Target BTC Price",
"value": "$120,000.00"
},
{
"metric": "BTC Amount Owned",
"value": "0.02222222 BTC"
},
{
"metric": "Satoshi Equivalent",
"value": "2,222,222 sats"
},
{
"metric": "Future Value",
"value": "$2,666.67"
},
{
"metric": "Profit/Loss",
"value": "$1,666.67"
},
{
"metric": "Result",
"value": "Profit"
},
{
"metric": "ROI",
"value": "+166.67%"
},
{
"metric": "CAGR (over 4 yr)",
"value": "+27.79%"
}
],
"scenarios": [
{
"scenario": "Bear (0.5×)",
"btc-price": "$60,000.00",
"future-value": "$1,333.33",
"profit-loss": "$333.33",
"roi": "+33.33%"
},
{
"scenario": "Base (target)",
"btc-price": "$120,000.00",
"future-value": "$2,666.67",
"profit-loss": "$1,666.67",
"roi": "+166.67%"
},
{
"scenario": "Bull (2×)",
"btc-price": "$240,000.00",
"future-value": "$5,333.33",
"profit-loss": "$4,333.33",
"roi": "+433.33%"
}
],
"benchmarks": [
{
"asset": "Bitcoin (this projection)",
"avg-annual-return": "+27.79%",
"projected-value": "$2,666.67"
},
{
"asset": "S&P 500 (historical avg.)",
"avg-annual-return": "+10.00%",
"projected-value": "$1,464.10"
},
{
"asset": "Gold (historical avg.)",
"avg-annual-return": "+7.00%",
"projected-value": "$1,310.80"
}
],
"milestones": [
{
"return-multiple": "1.5×",
"btc-price-needed": "$67,500.00"
},
{
"return-multiple": "2×",
"btc-price-needed": "$90,000.00"
},
{
"return-multiple": "3×",
"btc-price-needed": "$135,000.00"
},
{
"return-multiple": "5×",
"btc-price-needed": "$225,000.00"
},
{
"return-multiple": "10×",
"btc-price-needed": "$450,000.00"
},
{
"return-multiple": "20×",
"btc-price-needed": "$900,000.00"
},
{
"return-multiple": "100×",
"btc-price-needed": "$4,500,000.00"
}
]
},
"credits_used": 5,
"credits_remaining": null
}{
"type": "https://docs.iotools.cloud/errors/validation_error",
"title": "Invalid request",
"status": 400,
"code": "validation_error",
"detail": "One or more inputs are invalid — see `fields`.",
"request_id": "e4042b29-8f1e-4c7a-9b52-6f0d1a3c7e11",
"fields": {
"inputString": "Required"
}
}{
"type": "https://docs.iotools.cloud/errors/invalid_api_key",
"title": "Invalid API key",
"status": 401,
"code": "invalid_api_key",
"detail": "Provide 'Authorization: Bearer <key>'.",
"request_id": "e4042b29-8f1e-4c7a-9b52-6f0d1a3c7e11"
}{
"type": "https://docs.iotools.cloud/errors/insufficient_credits",
"title": "Insufficient credits",
"status": 402,
"code": "insufficient_credits",
"detail": "This call costs 1 credit and 0 remain in this month's allowance.",
"request_id": "e4042b29-8f1e-4c7a-9b52-6f0d1a3c7e11",
"credits_used": 0,
"credits_remaining": 0
}{
"type": "https://docs.iotools.cloud/errors/tool_not_allowed",
"title": "Tool not available over the API",
"status": 403,
"code": "tool_not_allowed",
"detail": "\"Background Remover\" is available on iotools.cloud but has no API endpoint.",
"request_id": "e4042b29-8f1e-4c7a-9b52-6f0d1a3c7e11"
}{
"type": "https://docs.iotools.cloud/errors/tool_not_found",
"title": "Tool not found",
"status": 404,
"code": "tool_not_found",
"detail": "No tool with that slug. See GET /v1/tools/list.",
"request_id": "e4042b29-8f1e-4c7a-9b52-6f0d1a3c7e11"
}{
"type": "https://docs.iotools.cloud/errors/payload_too_large",
"title": "Payload too large",
"status": 413,
"code": "payload_too_large",
"detail": "Request body exceeds this tool's size limit.",
"request_id": "e4042b29-8f1e-4c7a-9b52-6f0d1a3c7e11"
}{
"type": "https://docs.iotools.cloud/errors/unprocessable_input",
"title": "Input cannot be processed",
"status": 422,
"code": "unprocessable_input",
"detail": "This video has no captions or subtitles, so there is no transcript to extract.",
"request_id": "e4042b29-8f1e-4c7a-9b52-6f0d1a3c7e11",
"credits_used": 0
}{
"type": "https://docs.iotools.cloud/errors/rate_limited",
"title": "Rate limit exceeded",
"status": 429,
"code": "rate_limited",
"detail": "Too many requests. Retry in 30s.",
"request_id": "e4042b29-8f1e-4c7a-9b52-6f0d1a3c7e11",
"retry_after": 30
}{
"type": "https://docs.iotools.cloud/errors/processing_error",
"title": "Tool failed to run",
"status": 500,
"code": "processing_error",
"detail": "The tool failed to run. Please try again.",
"request_id": "e4042b29-8f1e-4c7a-9b52-6f0d1a3c7e11",
"credits_used": 0
}{
"type": "https://docs.iotools.cloud/errors/tool_disabled",
"title": "Tool temporarily disabled",
"status": 503,
"code": "tool_disabled",
"detail": "This tool is temporarily unavailable. Try again shortly.",
"request_id": "e4042b29-8f1e-4c7a-9b52-6f0d1a3c7e11"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
Investment Amount ($)
0.01 <= x <= 1000000000BTC Purchase Price ($)
0.01 <= x <= 100000000Target BTC Price ($)
0.01 <= x <= 100000000Holding Period (years)
0.1 <= x <= 100Currency
USD, EUR, GBP, AUD, JPY, CAD Response
Tool output
Show child attributes
Show child attributes
The tool's slug, echoing the {slug} in the request path.
Output-contract version for this tool.
Credits this call consumed, after any settlement refund. 0 when metering is disabled.
Credits left in the current monthly allowance, or null when metering is disabled.
Correlation id, also sent as x-request-id.
Was this page helpful?