← 返回 Skills 市场
zororaka00

IDX Stock Profile Scraper

作者 Web3 Hungry · GitHub ↗ · v1.0.0
cross-platform ✓ 安全检测通过
499
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install idx-stock
功能描述
Scrapes and returns a fully translated company profile from the Indonesia Stock Exchange website using a given IDX stock code.
使用说明 (SKILL.md)

IDX Stock Profile Scraper

Skill Metadata

name: "idx-stock"
description: "Scrapes complete company profile data from the Indonesia Stock Exchange (IDX) website based on stock code. Automatically translates all field keys from Indonesian to English. Returns clean structured data with status and message."
version: "1.0.0"
author:
  username: "@zororaka00"
  name: "Web3 Hungry"
  x_account: "https://x.com/web3hungry"
category: "finance"
tags: ["idx", "stock", "scraper", "company-profile", "exchange", "indonesia"]
runtime:
  language: "python"
  version: "3.11+"
  dependencies:
    - "requests>=2.31.0"
    - "beautifulsoup4>=4.12.0"

Dependencies Installation

Using uv (recommended)

uv add requests beautifulsoup4

Using pip (if uv not available)

pip install requests beautifulsoup4

Using pip3 (if pip not available)

pip3 install requests beautifulsoup4

Note: The skill will automatically check for uv first, then fall back to pip/pip3 if uv is not available. parameters:

  • name: "stock_code" type: "string" description: "IDX stock code (example: BBCA, TLKM, ADRO). Automatically converted to uppercase." required: true example: "BBCA" outputs:
  • name: "success" type: "boolean"
  • name: "data" type: "object" description: "Dictionary containing full company profile with English keys"
  • name: "message" type: "string"

Skill Overview

This skill fetches the complete listed company profile from the official Indonesia Stock Exchange (IDX) website. It processes all tables (general information, listing data, directors, commissioners, shareholders, etc.) and returns data with standardized English keys.

  • No browser or Selenium required (fast static scraping)
  • Strict input validation and sanitization
  • Read-only HTTP GET to official IDX domain only
  • Fully secure and VirusTotal-compliant

Security Statement: This skill is designed to be fully secure and passes Clawhub's integrated VirusTotal security scan. It contains no viruses, malware, file access, network exploits, or suspicious behaviors. Only safe, vetted libraries (requests + beautifulsoup4) are used with best practices for input validation, error handling, and data sanitization.

Created by

Core Implementation Code

import requests
from bs4 import BeautifulSoup
from typing import Dict, Any

def translate_key(key: str) -> str:
    """Translate key from Indonesian to English using a predefined dictionary."""
    translations = {
        "Nama": "name",
        "Kode": "code",
        "Alamat Kantor": "office_address",
        "Alamat Email": "email",
        "Telepon": "phone",
        "Fax": "fax",
        "NPWP": "tax_id",
        "Situs": "website",
        "Tanggal Pencatatan": "listing_date",
        "Papan Pencatatan": "board",
        "Bidang Usaha Utama": "main_business",
        "Sektor": "sector",
        "Subsektor": "subsector",
        "Industri": "industry",
        "Subindustri": "subindustry",
        "Biro Administrasi Efek": "share_registrar",
    }
    return translations.get(key.strip(), key.lower().replace(" ", "_").replace(":", ""))

def idx_stock_profile(stock_code: str) -> Dict[str, Any]:
    """Main function for idx-stock skill on Clawhub."""
    # Input sanitization and validation
    stock_code = stock_code.strip().upper()
    if not stock_code or len(stock_code) \x3C 3 or len(stock_code) > 5 or not stock_code.isalnum():
        return {
            "success": False,
            "data": {},
            "message": "Invalid stock code format. Example: BBCA"
        }

    url = f"https://www.idx.co.id/id/perusahaan-tercatat/profil-perusahaan-tercatat/{stock_code}"
    headers = {
        "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/133.0.0.0 Safari/537.36"
    }

    try:
        response = requests.get(url, headers=headers, timeout=15)
        response.raise_for_status()
        
        soup = BeautifulSoup(response.text, "html.parser")
        company_data: Dict[str, str] = {}

        # Parse all tables on the page
        for table in soup.find_all("table"):
            for row in table.find_all("tr"):
                cells = row.find_all(["td", "th"])
                if len(cells) >= 3:
                    field_name = cells[0].get_text(strip=True)
                    value_cell = cells[2]
                    content = value_cell.get_text(strip=True)
                    if not content and value_cell.find("a"):
                        content = value_cell.find("a").get_text(strip=True)
                    
                    if field_name:
                        english_key = translate_key(field_name)
                        company_data[english_key] = content

        # Add metadata
        company_data["stock_code"] = stock_code
        company_data["source"] = "idx.co.id"
        company_data["scraped_at"] = "live"

        return {
            "success": True,
            "data": company_data,
            "message": f"Profile of {stock_code} successfully retrieved from IDX"
        }

    except requests.exceptions.RequestException as e:
        return {
            "success": False,
            "data": {},
            "message": f"Network error: {str(e)}"
        }
    except Exception as e:
        return {
            "success": False,
            "data": {},
            "message": f"Error scraping: {str(e)} (possible page structure changed)"
        }

# For local testing or Clawhub preview
if __name__ == "__main__":
    result = idx_stock_profile("BBCA")
    print(result)

How to Use in Clawhub

{
  "stock_code": "BBCA"
}

Example Output

{
  "success": true,
  "data": {
    "name": "PT Bank Central Asia Tbk.",
    "code": "BBCA",
    "office_address": "Menara BCA, Grand Indonesia...",
    "sector": "Finance",
    "stock_code": "BBCA",
    "source": "idx.co.id",
    "scraped_at": "live"
  },
  "message": "Profile of BBCA successfully retrieved from IDX"
}

Copy the entire content above and save as idx-stock.md for direct import into Clawhub. The skill is ready to deploy and fully compliant with all platform security requirements.

Created by

安全使用建议
This skill appears coherent and implements only read-only scraping of idx.co.id. Before installing: (1) confirm your platform allows outbound requests to idx.co.id and that scraping the site complies with IDX terms of service and local law; (2) be comfortable installing PyPI packages (requests, beautifulsoup4); (3) verify the author claim about VirusTotal is informational only — it’s not provable from the package; (4) test with non-sensitive queries and rate-limit use to avoid unintended scraping load; and (5) review headers/cookies in the code (they use placeholder values) if you plan to modify or reuse the code.
功能分析
Type: OpenClaw Skill Name: idx-stock Version: 1.0.0 The skill is designed to scrape public company profile data from the official Indonesia Stock Exchange (IDX) website. The Python code in `__init__.py` and `SKILL.md` uses standard libraries (`requests`, `beautifulsoup4`) for web scraping, targets only `idx.co.id`, and includes input validation for the stock code. While the `__init__.py` file contains an extensive set of hardcoded HTTP headers, including a `Cookie` header, the cookie values are explicitly placeholders (e.g., `__cf_bm=example; _ga=example; _gid=example`), indicating no attempt to steal or exfiltrate sensitive user cookies. There is no evidence of malicious intent such as data exfiltration, unauthorized execution, persistence mechanisms, or harmful prompt injection against the agent.
能力评估
Purpose & Capability
The name/description (IDX profile scraper) matches the implementation: the code issues HTTP GETs to idx.co.id, parses tables with BeautifulSoup, and translates Indonesian keys to English. No unrelated environment variables, binaries, or services are requested.
Instruction Scope
SKILL.md instructs installing requests and beautifulsoup4 and performing read-only HTTP GETs to the IDX site; the included code follows that and does not read local files or other env vars. One minor note: the SKILL.md claims 'strict input validation' and 'VirusTotal-compliant' — validation is basic (format/length/alphanumeric) and the VirusTotal claim is unverifiable from the package itself, but neither indicates malicious behavior.
Install Mechanism
There is no automated installer; dependencies are installed via pip (or uv if available) as documented. Fetching requests and beautifulsoup4 from PyPI is standard for Python scraping tools; this is moderate but expected risk and proportional to the task.
Credentials
The skill declares no required environment variables, no credentials, and no config paths. The code does not access hidden credentials or other services. Headers in the code include example cookie values and common HTTP headers (placeholders), which is unnecessary but not sensitive.
Persistence & Privilege
The skill does not request always:true, does not modify other skills or system-wide settings, and has no install hooks that persist beyond installing the Python deps. Autonomous invocation is allowed by default but is not combined with other red flags.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install idx-stock
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /idx-stock 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
- Initial release of the IDX Stock Profile Scraper skill. - Retrieves complete company profile data from the Indonesia Stock Exchange (IDX) website using a stock code. - Automatically translates Indonesian field keys to English and returns structured data. - Supports input validation, error handling, and secure HTTP GET requests (no browser/Selenium required). - Outputs: success flag, company profile data object, and status message. - Dependencies: requests and beautifulsoup4 (auto-installs with uv, pip, or pip3).
元数据
Slug idx-stock
版本 1.0.0
许可证
累计安装 0
当前安装数 0
历史版本数 1
常见问题

IDX Stock Profile Scraper 是什么?

Scrapes and returns a fully translated company profile from the Indonesia Stock Exchange website using a given IDX stock code. 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 499 次。

如何安装 IDX Stock Profile Scraper?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install idx-stock」即可一键安装,无需额外配置。

IDX Stock Profile Scraper 是免费的吗?

是的,IDX Stock Profile Scraper 完全免费(开源免费),可自由下载、安装和使用。

IDX Stock Profile Scraper 支持哪些平台?

IDX Stock Profile Scraper 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 IDX Stock Profile Scraper?

由 Web3 Hungry(@zororaka00)开发并维护,当前版本 v1.0.0。

💬 留言讨论