KAP API Reference¶
financelib.kap.client.KAP(download_delay: int = 15)
¶
KAP (Public Disclosure Platform) PDF downloader.
Downloads disclosure PDFs from the KAP website for Turkish publicly traded companies.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
download_delay
|
int
|
Seconds to wait between PDF downloads to avoid rate limiting. |
15
|
Example
kap = KAP() kap.download_pdfs_via_date_ranges("2025-01-01", "2025-01-21", "pdfs") kap.download_pdf_via_disclosure_no(123456, "pdfs")
Source code in financelib/kap/client.py
Functions¶
download_pdf_via_disclosure_no(disclosure_no: int, desired_path: str = '') -> Optional[str]
¶
Download a single PDF by disclosure number.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
disclosure_no
|
int
|
KAP disclosure number. |
required |
desired_path
|
str
|
Directory to save the PDF. |
''
|
Returns:
| Type | Description |
|---|---|
Optional[str]
|
Path to the downloaded file, or None on failure. |
Source code in financelib/kap/client.py
download_pdfs_via_date_ranges(date_from: str = '', date_to: str = '', desired_path: str = '') -> List[str]
¶
Download all disclosure PDFs within a date range.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
date_from
|
str
|
Start date (YYYY-MM-DD format). Defaults to today. |
''
|
date_to
|
str
|
End date (YYYY-MM-DD format). Defaults to today. |
''
|
desired_path
|
str
|
Directory to save PDFs. Created if it doesn't exist. |
''
|
Returns:
| Type | Description |
|---|---|
List[str]
|
List of downloaded file paths. |
Raises:
| Type | Description |
|---|---|
DataFetchError
|
If the API request fails. |