OHLC.dev editorialIDX

IDX Market Calendar Dashboard Using Python and RapidAPI

This project develops an automated IDX Market Calendar Dashboard using Python and RapidAPI. The system is designed to help investors monitor important market information from th...

September 1, 20265 min readRafatar
IDX Market Calendar Dashboard Using Python and RapidAPI

This project develops an automated IDX Market Calendar Dashboard using Python and RapidAPI. The system is designed to help investors monitor important market information from the Indonesia Stock Exchange through three main components:

  1. RUPS Calendar Analysis

  2. Economic Calendar Monitoring

  3. Corporate Actions Tracking

The objective of this project is to build a simple investor dashboard that can collect, process, and display important market events such as company general meetings, economic events, dividends, warrants, and other corporate actions.

The project uses Python libraries such as requests for API communication, pandas for data processing, json for handling API responses, and datetime for recording time-related information.

The complete workflow is organized into five main cells:

  • Cell 1: Library import and API configuration

  • Cell 2: Retrieve RUPS Calendar data

  • Cell 3: Retrieve Economic Calendar data

  • Cell 4: Retrieve Today Corporate Actions data

  • Cell 5: Create an investor-friendly dashboard

The purpose of this system is to simplify market monitoring by transforming raw API responses into structured information that is easier to understand for investors.


Cell 1 - Import Library and API Configuration

# =====================================
# CELL 1 : SETUP
# =====================================

import requests
import pandas as pd
import json
from datetime import datetime


RAPIDAPI_KEY = "YOUR_API_KEY"


BASE_URL = (
    "https://indonesia-stock-exchange-idx.p.rapidapi.com"
)


HEADERS = {

    "Content-Type": "application/json",

    "x-rapidapi-host":
    "indonesia-stock-exchange-idx.p.rapidapi.com",

    "x-rapidapi-key":
    RAPIDAPI_KEY
}



def call_idx_api(endpoint):

    """
    Generic IDX API Caller
    """

    url = BASE_URL + endpoint


    response = requests.get(
        url,
        headers=HEADERS,
        timeout=30
    )


    if response.status_code == 200:

        return response.json()


    else:

        print(
            "ERROR:",
            response.status_code
        )

        print(
            response.text
        )

        return None

Explanation

Cell 1 prepares the Python environment and creates the main API communication function.

The program imports several libraries:

  • requests for sending requests to the IDX API.

  • pandas for converting and analyzing data tables.

  • json for processing API responses.

  • datetime for handling time-related information.

The API configuration defines the RapidAPI host, authentication key, and request headers required to access Indonesia Stock Exchange data.

The function:

call_idx_api()

acts as a reusable API caller. It receives an endpoint, sends an HTTP GET request, checks the response status, and returns JSON data if the request is successful. If an error occurs, the function displays the HTTP status and response message.


Cell 2 - Get RUPS Calendar

# =====================================
# CELL 2 : RUPS CALENDAR
# =====================================


def getRupsCalendar():

    data = call_idx_api(
        "/api/calendar/rups"
    )


    return data



rups = getRupsCalendar()


print(
    json.dumps(
        rups,
        indent=2
    )[:3000]
)

Explanation

Cell 2 retrieves the RUPS (General Meeting of Shareholders) calendar from the IDX API.

The function:

getRupsCalendar()

accesses the endpoint:

/api/calendar/rups

to obtain company meeting schedules.

The returned JSON response is stored in:

rups

and displayed in formatted JSON structure.

RUPS information is important for investors because company decisions discussed during general meetings may affect future corporate strategies, dividend policies, management decisions, and shareholder rights.

Cell 3 - Get Economic Calendar

# =====================================
# CELL 3 : ECONOMIC CALENDAR
# =====================================


def getEconomicCalendar():

    data = call_idx_api(
        "/api/calendar/economic"
    )


    return data



economic = getEconomicCalendar()


print(
    json.dumps(
        economic,
        indent=2
    )[:3000]
)

Explanation

Cell 3 retrieves economic calendar information from the IDX API.

The function:

getEconomicCalendar()

calls the endpoint:

/api/calendar/economic

to collect economic event data.

The output is stored in:

economic

and displayed as formatted JSON data.

Economic calendar information helps investors monitor external factors that may influence stock market movements, such as economic announcements and important market events.


Cell 4 - Get Today Corporate Actions

# =====================================
# CELL 4 : CORPORATE ACTIONS
# =====================================


def getTodayCorporateActions():

    data = call_idx_api(
        "/api/calendar/today"
    )


    return data



corporate_action = (
    getTodayCorporateActions()
)


print(
    json.dumps(
        corporate_action,
        indent=2
    )[:3000]
)

Explanation

Cell 4 retrieves corporate action information from the IDX API.

The function:

getTodayCorporateActions()

accesses:

/api/calendar/today

to obtain corporate actions occurring on the current date.

The response contains information related to corporate events, which can include:

  • Dividend announcements.

  • Warrant information.

  • Other company actions.

The raw response is stored in:

corporate_action

and displayed for inspection.

Cell 5 - Investor Friendly Dashboard

# =====================================
# CELL 5 : IDX SIMPLE INVESTOR DASHBOARD
# =====================================


from IPython.display import display



def find_lists(obj):

    result=[]


    if isinstance(obj,dict):

        for k,v in obj.items():

            if isinstance(v,list):

                result.extend(v)

            elif isinstance(v,dict):

                result.extend(
                    find_lists(v)
                )


    elif isinstance(obj,list):

        result.extend(obj)


    return result



# CORPORATE ACTION CLEAN

def clean_corporate_action(data):

    rows=[]


    items=find_lists(data)


    for item in items:


        symbol=item.get(
            "company_symbol",
            "-"
        )


        if symbol=="-":

            continue


        action="Corporate Action"

        value="-"



        if item.get("dividend_id"):

            action="Dividend"

            value=item.get(
                "dividend_amount",
                "-"
            )



        elif item.get("warrant_series"):

            action="Warrant"

            value=item.get(
                "warrant_exc_price_formatted",
                "-"
            )


        rows.append({

            "Kode Saham":
            symbol,

            "Jenis Aksi":
            action,

            "Tanggal":
            item.get(
                "dividend_exdate",
                "-"
            ),

            "Nilai":
            value

        })


    return pd.DataFrame(rows)



# ECONOMIC CLEAN

def clean_economic(data):

    items=find_lists(data)


    df=pd.DataFrame(items)


    if len(df)>0:


        columns=[

            c for c in [

                "date",

                "event",

                "actual",

                "forecast",

                "previous"

            ]

            if c in df.columns

        ]


        return df[columns]


    return df



# SHOW DASHBOARD


df_ca = clean_corporate_action(
    corporate_action
)


display(df_ca)



df_eco = clean_economic(
    economic
)


display(df_eco)



df_rups = pd.DataFrame(
    find_lists(rups)
)


display(df_rups)

Explanation

Cell 5 transforms raw API responses into a simple investor dashboard.

The function:

find_lists()

searches nested JSON structures and extracts list-based data so it can be converted into tables.

The corporate action cleaning function:

clean_corporate_action()

converts raw corporate action data into a structured table containing:

  • Stock code.

  • Action type.

  • Date.

  • Value.

The system identifies different corporate actions, including:

  • Dividend.

  • Warrant.

based on available API fields.

The economic calendar cleaning function:

clean_economic()

selects important economic fields:

  • Date.

  • Event.

  • Actual value.

  • Forecast.

  • Previous value.

Finally, the dashboard displays three main investor information sections:

  1. Corporate Actions

  2. Economic Calendar

  3. RUPS Calendar

using structured pandas tables.


Conclusion

This project demonstrates how Python and RapidAPI can be used to build an automated IDX Market Calendar Dashboard.

The system integrates three important investor information sources:

  1. RUPS Calendar

    To monitor company shareholder meetings and important corporate decisions.

  2. Economic Calendar

    To track economic events that may influence market conditions.

  3. Corporate Actions Calendar

    To monitor dividends, warrants, and other company activities.

The dashboard simplifies raw IDX API data into a structured format that is easier for investors to monitor.

However, calendar information should not be considered as a direct buy or sell signal. Investors should combine event-based analysis with fundamental analysis, valuation, technical analysis, and overall market conditions before making investment decisions.