cURL
curl "https://api.ruseo.cn/api/yuebao_calculator?amount=10000&days=30&annual_rate=2.0"
根据投入金额、投资天数和年化收益率计算余额宝每日收益和总收益。支持自定义年化收益率,默认使用1.8%作为参考值。
https://api.ruseo.cn/api/yuebao_calculator
接口调用前需要确认的核心配置。
/api/yuebao_calculatoryuebao_calculator必填参数必须传入,示例值可直接用于联调。
免费API不强制要求API Key,但如果您希望统计个人调用次数,请在请求时附加参数 key=您的API_KEY。
注册账号后即可获得API Key。
| 参数名 | 必填 | 类型 | 说明 | 示例值 |
|---|---|---|---|---|
key |
否 | string | 可选参数:携带此参数可统计您的个人调用次数。请注册账号获取API Key。 | YOUR_API_KEY |
amount |
是 | number | 投资金额,必须大于0的单位(元) | 10000 |
days |
是 | integer | 投资天数,必须大于0 | 30 |
annual_rate |
否 | number | 年化收益率(%),不填则使用默认值1.8% | 2.0 |
优先使用示例地址测试请求参数是否正确。
https://api.ruseo.cn/api/yuebao_calculator?amount=10000&days=30&annual_rate=2.0
curl "https://api.ruseo.cn/api/yuebao_calculator?amount=10000&days=30&annual_rate=2.0"
$url = 'https://api.ruseo.cn/api/yuebao_calculator?amount=10000&days=30&annual_rate=2.0';
$response = file_get_contents($url);
$data = json_decode($response, true);
fetch('https://api.ruseo.cn/api/yuebao_calculator?amount=10000&days=30&annual_rate=2.0')
.then(res => res.json())
.then(data => console.log(data));
实际返回内容以接口脚本处理结果为准。
{
"code": 0,
"msg": "success",
"data": {
"route": "yuebao_calculator",
"example": true
}
}
| 参数名 | 类型 | 说明 | 示例值 |
|---|---|---|---|
input.amount |
number | 输入的投资金额 | 10000 |
input.days |
integer | 输入的投资天数 | 30 |
input.annual_rate |
number | 使用的年化收益率(%) | 1.8 |
result.total_income |
number | 总收益(元) | 14.79 |
result.daily_income |
number | 每日平均收益(元) | 0.49 |
result.total_amount |
number | 到期总金额(元) | 10014.79 |
result.daily_rate |
number | 日收益率(%) | 0.004932 |
info.description |
string | 接口功能描述 | 根据投入金额、投资天数和年化收益率计算余额宝收益 |
info.formula |
string | 计算公式说明 | 总收益 = 本金 × (年化收益率 / 365) × 天数 |
info.note |
string | 注意事项 | 实际收益会因市场波动而有所变化,此计算仅供参考 |
点击左侧“发送请求”查看结果...