How to Integrate Bank Indonesia Data into Your App: Complete API Guide

How to Integrate Bank Indonesia Data into Your App: Complete API Guide

Introduction

In the rapidly evolving world of fintech, access to accurate and timely financial data is crucial for developers, economists, and analysts. One of the key data points that influence financial markets is interest rate data, particularly from central banks. This blog post will guide you through integrating Bank Indonesia's interest rate data into your applications using the Interest Rates API from interestratesapi.com. We will cover various endpoints, including how to retrieve the latest rates, historical data, and time series analysis, all while focusing on the Bank Indonesia Rate (BI_RATE).

Why Use Interest Rates API?

The Interest Rates API provides a comprehensive solution for accessing interest rate data from various central banks, including Bank Indonesia. Without such an API, developers face challenges such as:

  • Difficulty in obtaining real-time data from multiple sources.
  • Increased development time and costs associated with building and maintaining data retrieval systems.
  • Inconsistent data formats and reliability issues when aggregating data from different financial institutions.

By leveraging the Interest Rates API, developers can focus on building features rather than managing data sources, ensuring that their applications are both efficient and reliable.

Getting Started with the Interest Rates API

To begin using the Interest Rates API, you need to familiarize yourself with its endpoints. The API provides several functionalities, including:

  • /symbols: Retrieve a list of available rate symbols.
  • /latest: Get the latest interest rates for specified symbols.
  • /historical: Access historical rates for a specific date.
  • /timeseries: Retrieve a series of rates between two dates.
  • /fluctuation: Get change statistics over a specified range.
  • /ohlc: Obtain OHLC candlestick data.
  • /convert: Compare loan interest costs between two rates.

All requests to the API must be made using the GET method, and authentication is done via the api_key query parameter.

1. Retrieving Available Symbols

The first step in integrating the Interest Rates API is to retrieve the available symbols. This can be done using the /symbols endpoint.

Endpoint: /api/v1/symbols

This endpoint provides a catalogue of available rate symbols, allowing you to filter by category, base currency, or provider.

cURL Example:

curl "https://interestratesapi.com/api/v1/symbols?category=central_bank&base=IDR&api_key=YOUR_KEY"

JSON Response Example:

{
"success": true,
"count": 1,
"symbols": [
{
"symbol": "BI_RATE",
"name": "Bank Indonesia Rate",
"category": "central_bank",
"country_code": "ID",
"currency_code": "IDR",
"frequency": "monthly",
"description": "The interest rate set by Bank Indonesia."
}
]
}

The response includes the symbol for the Bank Indonesia Rate (BI_RATE), which is essential for subsequent API calls.

2. Fetching the Latest Rates

Once you have the symbol, you can retrieve the latest interest rates using the /latest endpoint.

Endpoint: /api/v1/latest

This endpoint returns the latest value for specified symbols.

cURL Example:

curl "https://interestratesapi.com/api/v1/latest?symbols=BI_RATE&api_key=YOUR_KEY"

JSON Response Example:

{
"success": true,
"date": "2026-06-21",
"base": "IDR",
"rates": {
"BI_RATE": 5.33
},
"dates": {
"BI_RATE": "2026-06-21"
},
"currencies": {
"BI_RATE": "IDR"
}
}

The response provides the latest BI_RATE value, which can be used in your application for financial calculations or analytics.

3. Accessing Historical Data

To analyze trends over time, you may need historical data. The /historical endpoint allows you to retrieve the interest rate for a specific date.

Endpoint: /api/v1/historical

This endpoint requires a date and can optionally take symbols and base currency as parameters.

cURL Example:

curl "https://interestratesapi.com/api/v1/historical?date=2025-06-15&symbols=BI_RATE&api_key=YOUR_KEY"

JSON Response Example:

{
"success": true,
"date": "2025-06-15",
"base": "IDR",
"rates": {
"BI_RATE": 5.25
},
"currencies": {
"BI_RATE": "IDR"
}
}

This data can be crucial for understanding how the BI_RATE has changed over time, aiding in financial forecasting and analysis.

4. Time Series Data

For a more comprehensive analysis, you can retrieve a series of rates over a specified date range using the /timeseries endpoint.

Endpoint: /api/v1/timeseries

This endpoint requires a start date, end date, and symbols.

cURL Example:

curl "https://interestratesapi.com/api/v1/timeseries?start=2025-06-01&end=2025-06-30&symbols=BI_RATE&api_key=YOUR_KEY"

JSON Response Example:

{
"success": true,
"base": "IDR",
"start_date": "2025-06-01",
"end_date": "2025-06-30",
"rates": {
"BI_RATE": {
"2025-06-01": 5.25,
"2025-06-02": 5.27,
"2025-06-03": 5.30
}
},
"frequencies": {
"BI_RATE": "daily"
},
"currencies": {
"BI_RATE": "IDR"
}
}

This endpoint is particularly useful for visualizing trends and fluctuations in the BI_RATE over time.

5. Analyzing Fluctuations

To understand how the BI_RATE has changed over a specific period, you can use the /fluctuation endpoint.

Endpoint: /api/v1/fluctuation

This endpoint provides change statistics over a specified range.

cURL Example:

curl "https://interestratesapi.com/api/v1/fluctuation?start=2025-06-01&end=2025-06-30&symbols=BI_RATE&api_key=YOUR_KEY"

JSON Response Example:

{
"success": true,
"rates": {
"BI_RATE": {
"start_date": "2025-06-01",
"end_date": "2025-06-30",
"start_value": 5.25,
"end_value": 5.30,
"change": 0.05,
"change_pct": 0.95,
"high": 5.35,
"low": 5.20
}
}
}

This data can help in assessing the volatility of the BI_RATE, which is essential for risk management and investment decisions.

6. Obtaining OHLC Data

For applications that require candlestick charting, the /ohlc endpoint provides Open, High, Low, and Close data.

Endpoint: /api/v1/ohlc

This endpoint computes OHLC data on-the-fly from daily data.

cURL Example:

curl "https://interestratesapi.com/api/v1/ohlc?symbols=BI_RATE&period=monthly&start=2025-06-01&end=2025-06-30&api_key=YOUR_KEY"

JSON Response Example:

{
"success": true,
"period": "monthly",
"start_date": "2025-06-01",
"end_date": "2025-06-30",
"rates": {
"BI_RATE": [
{
"period": "2025-06",
"open": 5.25,
"high": 5.35,
"low": 5.20,
"close": 5.30,
"data_points": 30
}
]
}
}

This endpoint is particularly useful for traders and analysts who rely on technical analysis for decision-making.

7. Comparing Loan Interest Costs

Finally, the /convert endpoint allows you to compare the total interest cost of loans between two rates.

Endpoint: /api/v1/convert

This endpoint helps in evaluating the financial implications of different interest rates.

cURL Example:

curl "https://interestratesapi.com/api/v1/convert?from=BI_RATE&to=ECB_MRO&amount=100000&term_months=12&api_key=YOUR_KEY"

JSON Response Example:

{
"success": true,
"amount": 100000,
"term_months": 12,
"from": {
"symbol": "BI_RATE",
"rate": 5.33,
"date": "2026-06-21",
"total_interest": 5330.00,
"total_payment": 105330.00
},
"to": {
"symbol": "ECB_MRO",
"rate": 4.50,
"date": "2026-06-21",
"total_interest": 4500.00,
"total_payment": 104500.00
},
"difference": {
"rate_spread": 0.83,
"interest_saved": 830.00
}
}

This endpoint is invaluable for financial institutions and individuals looking to make informed borrowing decisions.

Error Handling

When working with the Interest Rates API, it's essential to handle errors gracefully. Common error responses include:

  • 401: Missing or invalid api_key.
  • 403: Account without active plan.
  • 404: No symbols matched or no data for requested date/range.
  • 422: Validation error (e.g., wrong date format, invalid symbol).
  • 429: Request quota exhausted.

For rate limit errors (429), the response includes headers such as X-RateLimit-Limit, X-RateLimit-Remaining, and X-RateLimit-Reset, which help you manage your API usage effectively.

Building a Mini Project

To demonstrate the practical application of the Interest Rates API, let's outline a simple Node.js/Express project that fetches, caches, and serves BI_RATE data.

Project Setup

npm init -y
npm install express axios node-cache

Sample Code:

const express = require('express');
const axios = require('axios');
const NodeCache = require('node-cache');

const app = express();
const cache = new NodeCache();

const API_KEY = 'YOUR_KEY';
const BASE_URL = 'https://interestratesapi.com/api/v1/latest?symbols=BI_RATE&api_key=' + API_KEY;

app.get('/bi-rate', async (req, res) => {
const cachedData = cache.get('bi_rate');
if (cachedData) {
return res.json(cachedData);
}

try {
const response = await axios.get(BASE_URL);
cache.set('bi_rate', response.data, 3600); // Cache for 1 hour
res.json(response.data);
} catch (error) {
res.status(500).json({ error: 'Failed to fetch data' });
}
});

app.listen(3000, () => {
console.log('Server running on http://localhost:3000');
});

This simple application fetches the latest BI_RATE from the Interest Rates API and caches it for one hour, reducing the number of API calls and improving response times.

Conclusion

Integrating Bank Indonesia's interest rate data into your applications using the Interest Rates API from interestratesapi.com is a straightforward process that can significantly enhance your financial applications. By leveraging the various endpoints, you can access real-time data, historical trends, and perform complex analyses with ease. This API not only saves development time but also ensures that your applications are built on reliable and accurate financial data.

For more information and to get started with the Interest Rates API, visit Explore Interest Rates API features and Get started with Interest Rates API.

Ready to get started?

Get your API key and start validating bank data in minutes.

Get API Key

Related posts