A comprehensive toolkit for fetching, processing, and analyzing data from the Indonesia Stock Exchange (IDX / Bursa Efek Indonesia). This project provides scrapers for market data, company profiles, and financial ratios, with integration into Neo4j for network analysis and PostgreSQL for financial modeling.
- Data Scraping: Efficiently fetch data from the official IDX API using
curl_cffito handle rate limiting and browser emulation. - Graph Analysis: Ingest company data into Neo4j to visualize and query relationships between companies, directors, commissioners, and shareholders.
- Financial Ratios: Process and analyze financial ratios with support for PostgreSQL ingestion.
- iXBRL Parser: Extract data from inline XBRL financial reports.
- Yahoo Finance Integration: Supplemental market data via
yfinance.
- Language: Python 3.13+
- Database: Neo4j (Graph), PostgreSQL (Relational)
- Tools:
uvfor package management, Docker for database services. - Libraries:
pandas,sqlalchemy,neo4j,matplotlib,seaborn,scikit-learn.
- Python 3.13+ (Recommended: uv)
- Docker & Docker Compose (for Neo4j)
git clone https://github.com/yourusername/idx-bei.git
cd idx-beiWe use uv for fast, reliable Python dependency management.
cd python
uv syncUse Docker Compose to spin up a Neo4j instance:
docker compose up -dNeo4j will be available at:
- Web UI: http://localhost:7474
- Bolt: bolt://localhost:7687
- Default Login:
neo4j/password
The python/ directory contains various scripts for data collection:
# Scrape all company profiles
uv run scrape_company_profiles.py
# Scrape financial ratios
uv run scrape_financial_ratio.py
# Scrape broker search results
uv run scrape_broker_search.pyOpen the Jupyter notebook for Neo4j ingestion and network analysis:
cd python
uv run jupyter notebook neo4j.ipynbidx-bei/
├── data/ # Stored JSON data (ignored by git in production)
├── docker-compose/ # Docker service configurations
├── docker-compose.yml # Main docker-compose file
├── python/ # Core Python scripts and notebooks
│ ├── scrape_*.py # Data collection scripts
│ ├── neo4j_ingest.py # Script to push data to Neo4j
│ ├── neo4j.ipynb # Main analysis & ingestion notebook
│ └── pyproject.toml # Python dependencies (managed by uv)
└── LICENSE # MIT License
The Neo4j integration allows for powerful queries, such as:
- Identifying interlocking directorates (insiders holding positions in multiple companies).
- Mapping complex ownership structures and ultimate beneficiaries.
- Tracking historical trading performance against corporate actions.
Example Cypher query to find insider ownership:
MATCH (i:Insider)-[owns:OWNS]->(c:Company)-[:HAS_TRADE_DAY]->(td:TradeDay)
WITH i, owns.jumlah AS sharesOwned, c, td.close AS latestClosePrice
WITH i, sum(sharesOwned * latestClosePrice) AS totalValue
RETURN i.name AS InsiderName, totalValue
ORDER BY totalValue DESCThis project is licensed under the MIT License - see the LICENSE file for details.
Contributions are welcome! Please feel free to submit a Pull Request.
Disclaimer: This project is for educational and research purposes only. Ensure you comply with IDX terms of service when using these scripts.
