Get Interest Rate
curl --request GET \
--url https://api.magebank.ai/investment/interest-rate \
--header 'x-api-key: <x-api-key>'import requests
url = "https://api.magebank.ai/investment/interest-rate"
headers = {"x-api-key": "<x-api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-api-key': '<x-api-key>'}};
fetch('https://api.magebank.ai/investment/interest-rate', 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.magebank.ai/investment/interest-rate",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: <x-api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.magebank.ai/investment/interest-rate"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<x-api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.magebank.ai/investment/interest-rate")
.header("x-api-key", "<x-api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.magebank.ai/investment/interest-rate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<x-api-key>'
response = http.request(request)
puts response.read_body{
"interestRate": 4.50,
"lastUpdated": "2025-05-04T12:00:00Z"
}
{
"error": "Invalid or missing API key"
}
{
"error": "Internal Server Error"
}
Savings
Get Interest Rate
Get the current annual interest rate for investments
GET
/
investment
/
interest-rate
Get Interest Rate
curl --request GET \
--url https://api.magebank.ai/investment/interest-rate \
--header 'x-api-key: <x-api-key>'import requests
url = "https://api.magebank.ai/investment/interest-rate"
headers = {"x-api-key": "<x-api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-api-key': '<x-api-key>'}};
fetch('https://api.magebank.ai/investment/interest-rate', 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.magebank.ai/investment/interest-rate",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: <x-api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.magebank.ai/investment/interest-rate"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<x-api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.magebank.ai/investment/interest-rate")
.header("x-api-key", "<x-api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.magebank.ai/investment/interest-rate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<x-api-key>'
response = http.request(request)
puts response.read_body{
"interestRate": 4.50,
"lastUpdated": "2025-05-04T12:00:00Z"
}
{
"error": "Invalid or missing API key"
}
{
"error": "Internal Server Error"
}
Yield Information: Retrieve the current interest rate used for all savings calculations in the platform.
Request Headers
string
required
Your API key for authentication
Response
number
Current annual interest rate for investments (percentage)
string
Timestamp when the interest rate was last updated
{
"interestRate": 4.50,
"lastUpdated": "2025-05-04T12:00:00Z"
}
{
"error": "Invalid or missing API key"
}
{
"error": "Internal Server Error"
}
Status Codes
| Status Code | Description |
|---|---|
| 200 | Interest rate retrieved successfully |
| 401 | Unauthorized - Invalid or missing API key |
| 500 | Internal Server Error |
Annual Percentage Yield: The interest rate is expressed as an annual percentage yield (APY), which may change over time based on market conditions.
Rate Changes: When new investments are created, the current interest rate at that time is recorded and applied to that investment.