Calculates Return on Investment (ROI) percentage from initial investment and final value. Access via MCP in Cursor or Windsurf for financial analysis, or through REST API at `/v1/finance/roi`. Returns precise ROI calculation: ((final_value - initial_investment) / initial_investment) × 100. Essential for investment performance evaluation and portfolio analysis.
curl "https://tinyfn.io/v1/finance/roi" \
-H "X-API-Key: YOUR_API_KEY"
const response = await fetch('https://tinyfn.io/v1/finance/roi', {
headers: { 'X-API-Key': 'YOUR_API_KEY' }
});
const data = await response.json();
console.log(data);
import requests
response = requests.get('https://tinyfn.io/v1/finance/roi',
headers={'X-API-Key': 'YOUR_API_KEY'})
data = response.json()
print(data)
Connect your AI agent (Claude, Cursor, Windsurf, etc.) to TinyFn's finance tools:
{
"mcpServers": {
"tinyfn-finance": {
"url": "https://tinyfn.io/mcp/finance",
"headers": {
"X-API-Key": "YOUR_API_KEY"
}
}
}
}
Pass your initial purchase amount and current value to get the ROI percentage. For example, $1000 initial, $1250 current returns 25% ROI.
ROI shows simple percentage return without considering time, while metrics like IRR account for investment duration and cash flow timing.
Yes, the tool handles losses. If you invested $1000 and it's now worth $800, ROI returns -20%.
Provide initial_investment and final_value as numeric parameters. Both can be integers or decimals in any currency unit.
Agents can analyze portfolio performance, compare investment options, or generate financial reports by calculating ROI for multiple assets automatically.
Get your free API key and start using Return On Investment in seconds.
Get Free API Key