### JJK Search Implementation Steps Source: https://github.com/youseiushida/tse-hp-front/blob/main/TSE_SEARCH_SERVICE_REPORT.md Step-by-step guide for implementing JJK searches, including API calls and parameter handling. ```APIDOC ## JJK Search Implementation Steps ### Description This section outlines the procedure for programmatically performing JJK searches, including the necessary HTTP requests and parameters. ### Steps 1. **GET `/tseHpFront/JJK010010Action.do?Show=Show`** * Obtain `JSESSIONID` from cookies. * Also retrieve `jsessionid` from the `action` URL of the form. 2. **POST `/tseHpFront/JJK010010Action.do;jsessionid=xxx`** * **Cookie**: `JSESSIONID=xxx` * **Content-Type**: `application/x-www-form-urlencoded` * **Body**: `ListShow=ListShow&eqMgrCd=7203&mgrMiTxtBx=&dspSsuPd=10` * This request retrieves the search results HTML (`JJK010030`). 3. **POST `/tseHpFront/JJK010030Action.do`** * **Cookie**: `JSESSIONID=xxx` * **Body**: `BaseJh=BaseJh&mgrCd=72030&jjHisiFlg=1&lstDspPg=1&dspGs=10&souKnsu=1&sniMtGmnId=JJK010010&dspJnKbn=0&dspJnKmkNo=0` * This request retrieves the detailed HTML (`JJK010040`), which can be approximately 400KB in size. ``` -------------------------------- ### Quick Start: Search and Get Company Detail with TseClient (Python) Source: https://github.com/youseiushida/tse-hp-front/blob/main/README.md This Python code snippet demonstrates how to use the TseClient to search for companies by name and retrieve detailed information for a specific company code. It shows basic usage for searching and accessing company details like name and headquarters. No API key is required. ```python from tse_hp_front import TseClient, Market with TseClient() as client: # トヨタ自動車を検索 result = client.search(name="トヨタ") for item in result.items: print(item.code, item.name, item.market) # 企業詳細を取得(全タブ一括) detail = client.get_detail("7203") print(detail.basic.name) # トヨタ自動車 print(detail.basic.headquarters) # 愛知 print(detail.basic.representative_name) ``` -------------------------------- ### Install tse-hp-front Python Package Source: https://github.com/youseiushida/tse-hp-front/blob/main/README.md This command installs the tse-hp-front Python package using pip. It allows you to use the library for accessing Tokyo Stock Exchange data. Ensure you have Python and pip installed. ```sh pip install tse-hp-front ``` -------------------------------- ### CGK Search Implementation Steps Source: https://github.com/youseiushida/tse-hp-front/blob/main/TSE_SEARCH_SERVICE_REPORT.md Step-by-step guide for implementing CGK searches, including API calls and parameter handling, with specific notes on form submission. ```APIDOC ## CGK Search Implementation Steps ### Description This section details the procedure for programmatically performing CGK searches, including the necessary HTTP requests and parameters, with emphasis on the requirement to submit all form fields. ### Steps 1. **GET `/tseHpFront/CGK010010Action.do?Show=Show`** * Obtain `JSESSIONID`. 2. **POST `/tseHpFront/CGK010010Action.do;jsessionid=xxx`** * **Cookie**: `JSESSIONID=xxx` * **Body**: All form fields must be submitted, including empty ones. Minimum required parameters include: * `ListShow=ListShow` * `eqMgrCd=7203` * `mgrMiTxtBx=` * `dspSsuPd=10` * `hnsShzitPd=` (Blank) * `gyshBnriPd=` (Blank) * `bibiTniPd=` (Blank) * `kssnKiPd=` (Blank) * `sskKitiPd=` (Blank) * ... (All `select-one` fields should be blank, all `TxtBx` fields should be empty strings) * `sbrkmFlg=1` * `souKnsu=0` * `jyuKmkAti1=` * `sgiTrshmrykKnkiPd=01` * `sgiKsykKnkiPd=01` * This request returns the search results HTML. **CGK Notes**: Unlike JJK, CGK requires **all form fields** to be submitted. If not, the search will return to the form. Empty `select` fields should be submitted as a blank space. ``` -------------------------------- ### Japanese Enum Examples for Filtering Source: https://github.com/youseiushida/tse-hp-front/blob/main/README.md Demonstrates the usage of Japanese Enums provided by the tse-hp-front library for precise filtering of search results. Examples include Market, Prefecture, Industry, and OrganizationType enums, showing how to access their string values. ```python from tse_hp_front import Market, Prefecture, Industry, OrganizationType Market.プライム # "011" Market.スタンダード # "012" Market.グロース # "013" Prefecture.東京 # "13" Prefecture.大阪 # "27" Prefecture.愛知 # "23" Industry.電気機器 # "3650" Industry.医薬品 # "3250" Industry.情報_通信業 # "5250" Industry.銀行業 # "7050" OrganizationType.監査役設置会社 # "1" OrganizationType.指名委員会等設置会社 # "2" OrganizationType.監査等委員会設置会社 # "3" ``` -------------------------------- ### Asynchronous TSE Client Usage with Python Source: https://github.com/youseiushida/tse-hp-front/blob/main/README.md Demonstrates how to use the `AsyncTseClient` for making asynchronous API calls. It shows examples of searching for companies by name, retrieving detailed company information, and searching for corporate governance data. Requires Python 3.12+ and the `asyncio` library. ```python import asyncio from tse_hp_front import AsyncTseClient, Market async def main(): async with AsyncTseClient() as client: result = await client.search(name="トヨタ") for item in result.items: print(item.code, item.name) detail = await client.get_detail("7203") print(detail.basic.name) cg = await client.search_cg(markets=[Market.プライム], limit=10) print(cg.total) asyncio.run(main()) ``` -------------------------------- ### JJK Search Implementation Steps (HTTP Requests) Source: https://github.com/youseiushida/tse-hp-front/blob/main/TSE_SEARCH_SERVICE_REPORT.md This outlines the sequence of HTTP requests required to perform a JJK search programmatically. It details the GET and POST requests, including URLs, headers, and request bodies, to retrieve search results and detailed information. ```http 1. GET /tseHpFront/JJK010010Action.do?Show=Show → JSESSIONIDをCookieから取得 → formのaction URLからjsessionidも取得 2. POST /tseHpFront/JJK010010Action.do;jsessionid=xxx Cookie: JSESSIONID=xxx Content-Type: application/x-www-form-urlencoded Body: ListShow=ListShow&eqMgrCd=7203&mgrMiTxtBx=&dspSsuPd=10 → 検索結果HTML(JJK010030)を取得 3. POST /tseHpFront/JJK010030Action.do Cookie: JSESSIONID=xxx Body: BaseJh=BaseJh&mgrCd=72030&jjHisiFlg=1&lstDspPg=1&dspGs=10 &souKnsu=1&sniMtGmnId=JJK010010&dspJnKbn=0&dspJnKmkNo=0 → 詳細HTML(JJK010040)を取得(~400KB) ``` -------------------------------- ### Timeout Configuration Source: https://github.com/youseiushida/tse-hp-front/blob/main/README.md Details how to configure the request timeout for the TSE client, with a default value and an example of changing it. ```APIDOC ## Timeout Configuration ### Description This section explains how to set the timeout for HTTP requests made by the TSE client. The default timeout is 30 seconds, but this can be customized during client initialization. ### Method Client initialization parameter. ### Endpoint N/A (Client-side abstraction) ### Parameters #### Initialization Parameters - **timeout** (float) - Optional - The timeout in seconds for HTTP requests. Defaults to 30.0. ### Request Example ```python from tse_hp_front import TseClient # Default timeout (30 seconds) client_default = TseClient() # Custom timeout (60 seconds) client_custom = TseClient(timeout=60.0) ``` ### Response N/A (Focus is on client configuration) ``` -------------------------------- ### Initialize TseClient and AsyncTseClient Source: https://context7.com/youseiushida/tse-hp-front/llms.txt Initializes synchronous (TseClient) and asynchronous (AsyncTseClient) clients for accessing the Tokyo Stock Exchange search service. It's recommended to use context managers for proper HTTP connection management. The timeout parameter can be adjusted. ```python from tse_hp_front import TseClient, AsyncTseClient import asyncio # Synchronous client (context manager recommended) with TseClient(timeout=30.0) as client: result = client.search(name="トヨタ") print(f"検索結果: {result.total}件") # Synchronous client (manual close) client = TseClient(timeout=60.0) try: result = client.search(name="ソニー") finally: client.close() # Asynchronous client async def main(): async with AsyncTseClient(timeout=30.0) as client: result = await client.search(name="トヨタ") print(f"検索結果: {result.total}件") asyncio.run(main()) ``` -------------------------------- ### AsyncTseClient Usage for Asynchronous API Calls (Python) Source: https://context7.com/youseiushida/tse-hp-front/llms.txt This Python code demonstrates how to use the `AsyncTseClient` for asynchronous operations. It shows how to initialize the client, perform searches, retrieve company details, and fetch multiple company details concurrently using `asyncio.gather`. This is ideal for high-performance data fetching. ```python import asyncio from tse_hp_front import AsyncTseClient, Market, Prefecture, Industry async def main(): async with AsyncTseClient(timeout=30.0) as client: # 上場会社検索 result = await client.search(name="トヨタ") print(f"検索結果: {result.total}件") for item in result.items: print(f" {item.code}: {item.name}") # 詳細検索 result = await client.search( markets=[Market.プライム], prefecture=Prefecture.東京, industry=Industry.電気機器, limit=50, ) # 企業詳細取得 detail = await client.get_detail("7203") print(f"銘柄名: {detail.basic.name}") print(f"代表者: {detail.basic.representative_name}") # CG検索 cg_result = await client.search_cg( markets=[Market.プライム], limit=10, ) print(f"CG検索結果: {cg_result.total}件") # 複数企業の詳細を並行取得 codes = ["7203", "6758", "9984"] details = await asyncio.gather(*[ client.get_detail(code) for code in codes ]) for d in details: print(f"{d.basic.code}: {d.basic.name}") asyncio.run(main()) ``` -------------------------------- ### Setting Custom Timeout for TseClient in Python Source: https://github.com/youseiushida/tse-hp-front/blob/main/README.md Shows how to configure a custom timeout value for the `TseClient`. The default timeout is 30 seconds. This example demonstrates setting the timeout to 60.0 seconds, which can be useful for operations that might take longer to complete. ```python from tse_hp_front import TseClient client = TseClient(timeout=60.0) # 60 秒に変更 ``` -------------------------------- ### HTTP Resource Management with TseClient in Python Source: https://github.com/youseiushida/tse-hp-front/blob/main/README.md Illustrates how to manage HTTP connections using the `TseClient`. It shows the recommended approach using a context manager (`with`) for automatic resource release and the manual `close()` method within a `try...finally` block. This ensures connections are properly closed to prevent resource leaks. ```python from tse_hp_front import TseClient # コンテキストマネージャ(推奨) with TseClient() as client: result = client.search(name="トヨタ") # 手動クローズ client = TseClient() try: result = client.search(name="トヨタ") finally: client.close() ``` -------------------------------- ### HTTP Resource Management Source: https://github.com/youseiushida/tse-hp-front/blob/main/README.md Explains how to manage HTTP connections using context managers for both synchronous and asynchronous clients, ensuring proper release of resources. ```APIDOC ## HTTP Resource Management ### Description This section covers the recommended way to manage HTTP connections using context managers (`with` statement) for both the synchronous (`TseClient`) and asynchronous (`AsyncTseClient`) clients. It also shows the manual method of closing connections. ### Method Context manager (`with`) or manual `close()` method. ### Endpoint N/A (Client-side abstraction) ### Parameters N/A ### Request Example ```python from tse_hp_front import TseClient, AsyncTseClient import asyncio # Synchronous client with context manager (Recommended) with TseClient() as client: result = client.search(name="トヨタ") # Synchronous client with manual close client = TseClient() try: result = client.search(name="トヨタ") finally: client.close() # Asynchronous client with context manager async def async_example(): async with AsyncTseClient() as client: # ... perform async operations ... pass # Asynchronous client with manual close async def async_manual_close(): client = AsyncTseClient() try: # ... perform async operations ... pass finally: await client.close() asyncio.run(async_example()) asyncio.run(async_manual_close()) ``` ### Response N/A (Focus is on resource management, not API response structure) ``` -------------------------------- ### Get Company Details with Python Source: https://context7.com/youseiushida/tse-hp-front/llms.txt Retrieves detailed information for a given company using its stock code. This function fetches all tabs of company data including basic information, timely disclosures, filings, and corporate governance reports in a single request. It returns a CompanyDetail object. ```python from tse_hp_front import TseClient with TseClient() as client: detail = client.get_detail("6758") # ソニーグループ(4桁または5桁コード) # --- 基本情報タブ --- b = detail.basic print(f"証券コード: {b.code}") # 67580 print(f"ISINコード: {b.isin}") # JP3435000009 print(f"銘柄名: {b.name}") # ソニーグループ print(f"英文商号: {b.name_en}") # Sony Group Corporation print(f"市場区分: {b.market}") # プライム print(f"業種: {b.industry}") # 電気機器 print(f"決算期: {b.fiscal_period}") # 3月 print(f"本社所在地: {b.headquarters}") # 東京 print(f"代表者氏名: {b.representative_name}") print(f"上場年月日: {b.listing_date}") # 1958/12/01 print(f"株価情報URL: {b.stock_price_url}") # --- 適時開示情報タブ --- disc = detail.disclosures print(f"法定開示: {len(disc.legal)}件") print(f"決算情報: {len(disc.earnings)}件") print(f"決定事実/発生事実: {len(disc.material_facts)}件") print(f"その他: {len(disc.other)}件") for item in disc.earnings[:3]: print(f" {item.date}: {item.title}") print(f" PDF: {item.pdf_url}") print(f" XBRL: {item.xbrl_url}") print(f" HTML: {item.html_urls}") # --- 縦覧書類 / PR情報タブ --- fil = detail.filings print(f"株主総会招集通知: {len(fil.shareholder_meeting)}件") print(f"独立役員届出書: {len(fil.independent_officers)}件") print(f"定款: {len(fil.articles)}件") print(f"ESG報告書: {len(fil.esg)}件") print(f"PR情報: {len(fil.pr)}件") for item in fil.articles[:2]: print(f" {item.date}: {item.title} - {item.pdf_url}") # --- コーポレート・ガバナンス情報タブ --- for cg in detail.cg_info[:3]: print(f"組織形態: {cg.organization_type}") print(f"取締役(独立社外): {cg.directors}") print(f"監査役(独立社外): {cg.auditors}") print(f"縦覧日: {cg.viewing_date}") print(f"CG報告書PDF: {cg.pdf_url}") print(f"CG報告書HTML: {cg.html_url}") ``` -------------------------------- ### セッション管理: 初回GETとPOSTリクエスト (HTTP) Source: https://github.com/youseiushida/tse-hp-front/blob/main/TSE_SEARCH_SERVICE_REPORT.md 東証検索サービスにおけるセッション管理の基本的な流れを示しています。まずGETリクエストで検索フォームを取得し、Set-CookieヘッダーでJSESSIONIDを受け取ります。次に、同一セッションIDを使用してPOSTリクエストを送信することで、セッションが維持されます。セッションが一致しない場合は検索フォームにリダイレクトされます。 ```http GET /tseHpFront/JJK010010Action.do?Show=Show → Set-Cookie: JSESSIONID=xxxx; Path=/tseHpFront; Secure → formのaction属性にもjsessionidが埋め込まれる POST /tseHpFront/JJK010010Action.do;jsessionid=xxxx Cookie: JSESSIONID=xxxx → セッションが一致しない場合、検索フォームに戻される ``` -------------------------------- ### Retrieve All Company Detail Tabs with TseClient (Python) Source: https://github.com/youseiushida/tse-hp-front/blob/main/README.md This Python snippet demonstrates fetching comprehensive details for a given company code using the `get_detail` method of the TseClient. It retrieves all tabs including basic information, timely disclosures, filings, and corporate governance data in a single request. ```python from tse_hp_front import TseClient with TseClient() as client: detail = client.get_detail("6758") # ソニーグループ ``` -------------------------------- ### Asynchronous HTTP Resource Management with AsyncTseClient in Python Source: https://github.com/youseiushida/tse-hp-front/blob/main/README.md Demonstrates asynchronous HTTP connection management using `AsyncTseClient`. It shows the preferred method using `async with` for automatic closing of connections and an alternative using a `try...finally` block with an explicit `await client.close()`. This is crucial for preventing resource leaks in asynchronous operations. ```python from tse_hp_front import AsyncTseClient async with AsyncTseClient() as client: ... # Asynchronous operations here # または client = AsyncTseClient() try: ... # Asynchronous operations here finally: await client.close() ``` -------------------------------- ### Search Companies by Name, Code, or Market (Python) Source: https://github.com/youseiushida/tse-hp-front/blob/main/README.md This Python snippet shows how to perform basic searches for listed companies using the TseClient. You can search by company name, stock code, or filter by market segments like Prime or Standard. It also demonstrates how to include delisted companies in the search results. ```python from tse_hp_front import TseClient, Market with TseClient() as client: # 銘柄名で検索 result = client.search(name="ソニー") print(result.total) # 2 for item in result.items: print(item.code, item.name, item.market, item.industry) # 証券コードで検索 result = client.search(code="7203") # 市場区分で絞り込み result = client.search( markets=[Market.プライム, Market.スタンダード], limit=50, ) # 上場廃止会社を含む result = client.search(name="東芝", include_delisted=True) ``` -------------------------------- ### AsyncTseClient Usage Source: https://github.com/youseiushida/tse-hp-front/blob/main/README.md Demonstrates how to use the asynchronous TSE client for API calls. It shows importing the client, using it within an async context manager, and performing search and detail retrieval operations. ```APIDOC ## AsyncTseClient Usage ### Description This section details how to use the `AsyncTseClient` for making asynchronous API requests. It emphasizes the ease of use by simply importing the client and using `await` for API calls, which mirror the synchronous client's interface. ### Method Asynchronous function calls using `async` and `await`. ### Endpoint N/A (Client-side abstraction) ### Parameters N/A ### Request Example ```python import asyncio from tse_hp_front import AsyncTseClient, Market async def main(): async with AsyncTseClient() as client: # Search for companies by name result = await client.search(name="トヨタ") for item in result.items: print(item.code, item.name) # Get detailed information for a specific company code detail = await client.get_detail("7203") print(detail.basic.name) # Search for companies by market and limit results cg = await client.search_cg(markets=[Market.プライム], limit=10) print(cg.total) asyncio.run(main()) ``` ### Response #### Success Response (200) Responses vary based on the method called (e.g., `CompanySearchResult`, `CompanyDetail`, `CGSearchResult`). #### Response Example (See code example for structure of printed output) ``` -------------------------------- ### Access Filings and PR Information (Python) Source: https://github.com/youseiushida/tse-hp-front/blob/main/README.md This Python code demonstrates accessing various filing documents for a company, including shareholder meeting notices, independent officer notifications, articles of incorporation, ESG reports, and press releases. It shows how to iterate through articles of incorporation to print their date, title, and PDF URL. ```python fil = detail.filings print(len(fil.shareholder_meeting)) # 株主総会招集通知 print(len(fil.independent_officers)) # 独立役員届出書 print(len(fil.articles)) # 定款 print(len(fil.esg)) # ESG 報告書 print(len(fil.pr)) # PR 情報 for item in fil.articles: print(item.date, item.title, item.pdf_url) ``` -------------------------------- ### Access Basic Company Information (Python) Source: https://github.com/youseiushida/tse-hp-front/blob/main/README.md This Python code shows how to access the basic information of a company after retrieving its details using `get_detail`. It prints various attributes like company code, ISIN, name (Japanese and English), market, industry, fiscal period, headquarters, representative name, and listing date. ```python b = detail.basic print(b.code) # 67580 print(b.isin) # JP3435000009 print(b.name) # ソニーグループ print(b.name_en) # Sony Group Corporation print(b.market) # プライム print(b.industry) # 電気機器 print(b.fiscal_period) # 3月 print(b.headquarters) # 東京 print(b.representative_name) # 十時 裕樹 print(b.listing_date) # 1958/12/01 print(b.stock_price_url) # 株価情報URL ``` -------------------------------- ### CGK Search Implementation Steps (HTTP Requests) Source: https://github.com/youseiushida/tse-hp-front/blob/main/TSE_SEARCH_SERVICE_REPORT.md This details the HTTP request flow for CGK searches. It highlights the necessity of sending all form fields, including empty ones, and specifies the minimum required parameters for a successful POST request to avoid returning to the search form. ```http 1. GET /tseHpFront/CGK010010Action.do?Show=Show → JSESSIONID取得 2. POST /tseHpFront/CGK010010Action.do;jsessionid=xxx Cookie: JSESSIONID=xxx Body: (全フィールド送信が必要 — 空のselect/textフィールドも含む) 最低限必要なパラメータ: ListShow=ListShow eqMgrCd=7203 mgrMiTxtBx= dspSsuPd=10 hnsShzitPd= (空白) gyshBnriPd= (空白) bibiTniPd= (空白) kssnKiPd= (空白) sskKitiPd= (空白) ... (全select-one: 空白, 全TxtBx: 空文字列) sbrkmFlg=1 souKnsu=0 jyuKmkAti1= sgiTrshmrykKnkiPd=01 sgiKsykKnkiPd=01 → 検索結果HTML ``` -------------------------------- ### Search Corporate Governance by Committee and Other Criteria (Python) Source: https://context7.com/youseiushida/tse-hp-front/llms.txt Searches for companies based on committee structures, compensation disclosure, takeover defense measures, and viewing dates. Requires the tse_hp_front library and specific enum values. ```python from datetime import date from tse_hp_front import TseClient, CompensationDisclosure with TseClient() as client: result = client.search_cg( # 指名委員会等設置会社の委員数 nomination_committee_from=3, # 指名委員会 全委員3人以上 nomination_committee_outside_from=2, # 指名委員会 社外取締役2人以上 compensation_committee_from=3, # 報酬委員会 全委員3人以上 compensation_committee_outside_from=2, # 報酬委員会 社外取締役2人以上 audit_committee_from=3, # 監査委員会 全委員3人以上 audit_committee_outside_from=2, # 監査委員会 社外取締役2人以上 executive_officers_from=5, # 執行役5人以上 # 監査等委員会設置会社の委員数 audit_supervisory_committee_from=3, audit_supervisory_committee_outside_from=2, # 任意の委員会 optional_committee_exists=True, # 任意の委員会あり optional_nomination_from=3, # 指名委員会相当 全委員3人以上 optional_compensation_from=3, # 報酬委員会相当 全委員3人以上 # その他 independent_officers_from=5, # 独立役員5人以上 advisor_status_exists=True, # 相談役・顧問等の記載あり advisor_count_from=1, # 相談役・顧問等1人以上 electronic_voting=True, # 電磁的方法による議決権行使 voting_platform=True, # 議決権電子行使プラットフォーム参加 english_notice=True, # 招集通知(要約)英文提供 # 報酬開示状況 director_compensation_disclosure=[CompensationDisclosure.全員個別開示], executive_compensation_disclosure=[CompensationDisclosure.全員個別開示], compensation_policy=True, # 報酬決定方針あり takeover_defense=False, # 買収防衛策なし # 縦覧日 viewing_date_from=date(2024, 1, 1), viewing_date_to=date(2024, 12, 31), ) print(f"該当件数: {result.total}") ``` -------------------------------- ### Search Corporate Governance by Director and Auditor Criteria (Python) Source: https://context7.com/youseiushida/tse-hp-front/llms.txt Searches for companies based on director and auditor qualifications, tenure, and relationships. Requires the tse_hp_front library and specific enum values for filtering. ```python from tse_hp_front import ( TseClient, Market, DirectorTenure, OutsideOfficerAttribute, RelationPeriod, OutsideDirectorRelation, OutsideAuditorRelation, ) with TseClient() as client: result = client.search_cg( markets=[Market.プライム], # 取締役関係 director_tenure=DirectorTenure.一年, # 任期1年 directors_from=5, # 取締役5人以上 directors_to=15, # 取締役15人以下 outside_directors_from=3, # 社外取締役3人以上 independent_directors_from=3, # 独立社外取締役3人以上 # 定款上の取締役員数 articles_directors_from=10, articles_directors_to=20, # 社外取締役の属性(複数指定可) outside_director_attributes=( OutsideOfficerAttribute.弁護士, OutsideOfficerAttribute.公認会計士, OutsideOfficerAttribute.他会社出身, ), # 社外取締役の関係 outside_director_relation_period=RelationPeriod.本人現在, outside_director_relations=( OutsideDirectorRelation.F, # コンサルタント、会計専門家、法律専門家 OutsideDirectorRelation.G, # 主要株主 ), # 監査役関係 auditors_from=3, auditors_to=5, outside_auditors_from=2, independent_auditors_from=2, # 社外監査役の属性 outside_auditor_attributes=[OutsideOfficerAttribute.公認会計士], # 社外監査役の関係 outside_auditor_relation_period=RelationPeriod.本人現在, outside_auditor_relations=[OutsideAuditorRelation.H], # 会計専門家 ) print(f"該当件数: {result.total}") ``` -------------------------------- ### コーポレート・ガバナンス情報サービス (CGK) - 検索結果一覧 Source: https://github.com/youseiushida/tse-hp-front/blob/main/TSE_SEARCH_SERVICE_REPORT.md CGKサービスにおける検索結果一覧ページのAPIエンドポイントについて説明します。結果にはPDFおよびHTML形式のリンクが含まれます。 ```APIDOC ## GET /tseHpFront/CGK010030Action.do ### Description CGKサービスで実行された検索の結果一覧を表示します。各結果には、CG報告書へのPDFおよびHTMLリンクが含まれます。 ### Method GET ### Endpoint `/tseHpFront/CGK010030Action.do` ### Parameters #### Query Parameters (検索結果一覧ページに渡される具体的なクエリパラメータは、CGK010010Action.doからのリダイレクト情報に依存します。ページングやソートに関するパラメータが存在する可能性がありますが、ドキュメントには詳細な定義がありません。) ### Request Body (GETリクエストのため、リクエストボディはありません) ### Response #### Success Response (200) - **検索結果リスト**: 各CG報告書の情報を含む配列。 - **companyName** (string) - 会社名 - **stockCode** (string) - 証券コード - **reportTitle** (string) - 報告書タイトル - **pdfLink** (string) - PDF形式の報告書へのURL - **htmlLink** (string) - HTML形式の報告書へのURL #### Response Example ```json { "results": [ { "companyName": "株式会社ABC", "stockCode": "1234", "reportTitle": "第XX期コーポレート・ガバナンス報告書", "pdfLink": "/path/to/report.pdf", "htmlLink": "/path/to/report.html" } // ... 他の結果 ] } ``` ``` -------------------------------- ### 東証上場会社情報サービス (JJK) - 詳細情報 Source: https://github.com/youseiushida/tse-hp-front/blob/main/TSE_SEARCH_SERVICE_REPORT.md JJKサービスにおける会社詳細情報ページのAPIエンドポイントと、ページ構造、および各タブに含まれる情報について説明します。株価表示へのリンク情報も含まれます。 ```APIDOC ## GET /tseHpFront/JJK010040Action.do ### Description 特定の企業に関する詳細情報(基本情報、適時開示情報、CG情報、縦覧書類)を表示します。情報はクライアントサイドでタブ切り替えにより表示されます。 ### Method GET ### Endpoint `/tseHpFront/JJK010040Action.do` ### Parameters #### Query Parameters - **mgrCd** (string) - 必須 - 企業の証券コード (5桁、例: `72030`) - **jjHisiFlg** (string) - 必須 - 上場廃止フラグ (例: `false`) ### Request Body (GETリクエストのため、リクエストボディはありません) ### Response #### Success Response (200) - **基本情報**: コード、ISINコード、銘柄名、英文商号、業種、決算期、売買単位、株主名簿管理人、設立年月日、本社所在地、上場取引所、月末投資単位、決算発表予定日、株主総会開催日、代表者情報など。 - **適時開示情報**: 適時開示書類のリスト。 - **CG情報**: コーポレート・ガバナンスに関する情報。 - **縦覧書類 / PR情報**: 縦覧書類やPR情報のリスト。 - **株価表示リンク**: 株価情報ページへのリンク。 #### Response Example (レスポンスはHTML形式で、クライアントサイドでレンダリングされます。JSON形式での直接的なレスポンスはありません。) ### Details **基本情報セクションに含まれる株価表示リンクの例:** `https://quote.jpx.co.jp/jpxhp/main/index.aspx?F=stock_detail&disptype=information&qcode=7203` **タブ構成:** - **基本情報**: `div ID='body_basicInformation'` - **適時開示情報**: `div ID='body_disclosure'` - **CG情報**: `div ID='body_CorporateGovernance'` - **縦覧書類 / PR情報**: `div ID='body_filing'` ``` -------------------------------- ### Data Models Source: https://github.com/youseiushida/tse-hp-front/blob/main/README.md Provides a detailed breakdown of the data models used for search results and company details, including their fields and purpose. ```APIDOC ## Data Models ### Description This section describes the various data models returned by the API, categorized into Search Results and Company Details. Each model lists its relevant fields and their purpose. ### Method N/A (Describes data structures) ### Endpoint N/A (Describes data structures) ### Parameters N/A ### Request Example N/A ### Response #### Data Model Structures **Search Results:** - **`CompanySearchResult`** - `total` (int) - Total number of search results. - `items` (list[SearchResultItem]) - A list of `SearchResultItem` objects. - **`SearchResultItem`** - `code` (str) - Company code. - `name` (str) - Company name. - `market` (str) - Market the company is listed on. - `industry` (str) - Industry the company belongs to. - `fiscal_period` (str) - Fiscal period. - `has_notice` (bool) - Indicates if there is a notice. - `stock_price_url` (str) - URL to the stock price information. - **`CGSearchResult`** - `total` (int) - Total number of corporate governance search results. - `detailed_total` (int) - Detailed total count. - `items` (list[CGSearchResultItem]) - A list of `CGSearchResultItem` objects. - **`CGSearchResultItem`** - `code` (str) - Company code. - `name` (str) - Company name. - `organization_type` (str) - Type of organization. - `directors_count` (int) - Number of directors. - `independent_directors_count` (int) - Number of independent directors. - `viewing_date` (str) - Date of viewing. - `pdf_url` (str) - URL to the PDF document. - `html_url` (str) - URL to the HTML document. - `xbrl_url` (str) - URL to the XBRL document. - ... (other fields) **Company Details:** - **`CompanyDetail`** - `basic` (CompanyBasicInfo) - Basic company information. - `disclosure` (DisclosureSection) - Disclosure information. - `filing` (FilingSection) - Filing information. - `cg_info` (list[CGInfoItem]) - Corporate governance information. - **`CompanyBasicInfo`** - Contains approximately 25 fields including code, ISIN, market, industry, representative, head office location, etc. - **`DisclosureSection`** - `legal` (list[DisclosureItem]) - `earnings` (list[DisclosureItem]) - `material_facts` (list[DisclosureItem]) - `compliance_plan` (list[DisclosureItem]) - `other` (list[DisclosureItem]) - **`DisclosureItem`** - `date` (str) - Date of disclosure. - `title` (str) - Title of the disclosure. - `pdf_url` (str) - URL to the PDF. - `xbrl_url` (str) - URL to the XBRL. - `html_urls` (list[str]) - List of HTML URLs. - **`FilingSection`** - `shareholder_meeting` (list[FilingItem]) - `independent_officers` (list[FilingItem]) - `articles` (list[FilingItem]) - `esg` (list[FilingItem]) - `pr` (list[FilingItem]) - `other` (list[FilingItem]) - **`FilingItem`** - `date` (str) - Date of filing. - `title` (str) - Title of the filing. - `pdf_url` (str) - URL to the PDF. - **`CGInfoItem`** - `organization_type` (str) - Type of organization. - `directors` (list[dict]) - Information about directors. - `auditors` (list[dict]) - Information about auditors. - `viewing_date` (str) - Date of viewing. - `pdf_url` (str) - URL to the PDF. - `html_url` (str) - URL to the HTML. - `xbrl_url` (str) - URL to the XBRL. #### Response Example (See descriptions above for field details. Actual response would be JSON objects conforming to these structures.) ```