This page does not describe a real client project. It is an example scenario that shows how Fincode approaches this kind of work. Technical details are based on official documentation; scope, timeline and price are set for each project.
| Who it is for | An analyst team covering Borsa Istanbul companies (example scenario) |
|---|---|
| Service | Algorithmic trading infrastructure: monitoring and alerts |
| Platforms | KAP data (licensed feed), Telegram Bot API, e-mail |
| Technologies | Python, PostgreSQL, message queue, Telegram Bot API |
| Deliverables | Alert bot, classification rules, monitoring dashboard, source code and documentation |
The need
In this scenario, an analyst team covering Borsa Istanbul companies follows disclosures for its watchlist by keeping the KAP website open all day. KAP, the Public Disclosure Platform, receives many filings at once during reporting season, and those published outside trading hours are easy to miss. The goal is that whenever a watchlist company files, a message tagged by disclosure type, with a short summary and a link to the original, reaches Telegram or e-mail quickly.
Capital Markets Law No. 6362 defines KAP as the electronic system through which information that must be disclosed under the legislation is submitted with an electronic signature and announced to the public; it is operated by Merkezi Kayıt Kuruluşu (MKK), Turkey's central securities depository. The bot does not replace reading the disclosure, gives no investment advice and generates no orders.
Access to KAP data
KAP's official publication site is kap.org.tr. The site guide published by KAP covers listing disclosures on screen, detailed queries and bulk download of up to 150 disclosures as Word or Excel files. For programmatic access, MKK's API Portal documents, as of October 2026, an official REST API for data dissemination organizations, KAP Data Dissemination Services, with services for disclosure lists, disclosure details, attachment downloads and blocked disclosures; in production every call needs a token, valid for 24 hours, obtained with an API key that MKK issues to the user.
Borsa Istanbul's data publication products, however, include KAP data sourced from MKK: financial reports, material event disclosures and other notifications published on KAP. Borsa Istanbul data reaches users through licensed data distributors in real-time, delayed and end-of-day form. In this scenario the data source is therefore a feed from a data distributor licensed by the client. Automated scraping of the website is not part of the design; any other access route would first be cleared with MKK and the data provider. How many recipients and which channels the alerts may reach is settled together with the license.
Solution architecture
- Ingest: connects to the feed and stores every disclosure raw, with its receipt time. It reconnects after a drop and, where the provider supports it, backfills the gap.
- Deduplication: the unique KAP disclosure number is the key, so a number seen twice never produces a second message. The KAP site guide marks disclosures that also have an English version, and the bot merges both languages under one record.
- Corrections: under the KAP directive, published disclosures are not deleted apart from the exceptions it lists; a correction is a second disclosure referring to the first. The bot stores it as a new record and posts it as a reply to the original message, tagged “Correction”.
- Classification: KAP's own fields come first: disclosure type (material event, financial report, rights exercise, regulatory notice, other) and subject. The team's tags (financial statements, dividends, capital increase, material events) are derived from these fields by a rule table. Disclosures that match no rule are still sent, tagged “unclassified”, and the table is updated.
- Summary: the short summary relies only on the disclosure text, is labeled as automatic and always carries a link to the original. Amounts and dates are copied verbatim; if a summary cannot be verified against the text, only the title and link are sent.
- Delivery: Telegram Bot API and e-mail. Categories can be routed to separate topics in a forum group, and low-priority types can be sent silently.
Rights-exercise messages carry a date note: under Borsa Istanbul's theoretical price procedure, for corporate-action start dates, disclosures published on KAP after 16:30 on a business day (after 12:00 on half days) or on a holiday count as published on the next business day.
Telegram delivery and rate limits
Telegram's bot FAQ advises against sending more than one message per second in a single chat, states that bots cannot send more than 20 messages per minute in a group, and puts the broadcast limit at about 30 messages per second. In the Bot API, message text is 1–4096 characters after entity parsing, and when flood control is exceeded the retry_after field says how many seconds to wait. The design follows these rules:
- Messages are first written to a durable outbox table; a separate worker sends them while respecting per-chat limits.
- The send result and Telegram message ID are stored, so nothing is resent after a restart and corrections can reply to the right message.
- At busy times, consecutive disclosures from the same company can be grouped into one message.
- KAP attachments can only be PDF files; the bot links to the disclosure rather than copying attachments.
- Watchlist commands arrive through a webhook or getUpdates. According to the Bot API these two methods are mutually exclusive and unclaimed updates are kept for at most 24 hours; with a webhook, the secret_token header confirms that requests come from Telegram.
The same alerting patterns appear in the TradingView webhook bot guide.
Monitoring and reliability
- End-to-end latency is measured: publication time on KAP, receipt time and Telegram delivery time are stored separately.
- If the feed stays silent for longer than expected, the on-call person is alerted; during reporting season KAP's “Expected Disclosures” screen serves as a reference for missing filings.
- A daily reconciliation compares the day's watchlist disclosures, exported by hand with the KAP website's Excel download, with the messages sent; missing or duplicate items go to a break list.
- The Telegram bot token and data provider credentials live in a secrets store, and access is logged.
This kind of monitoring falls under Fincode's algorithmic trading service.
Deliverables
- Feed ingest service and raw record store
- Deduplication and correction-matching module
- Rule-based classification table with an editing screen
- Summary module with verification rules
- Telegram and e-mail delivery service, watchlist management
- Monitoring dashboard, alerts, operations documentation and source code
How success is measured
- End-to-end latency is compared with a target set at the start, taking the data source's own latency into account.
- The daily reconciliation finds exactly one message for each watchlist disclosure, with nothing missing or duplicated.
- On a sample of disclosures, automatic tags are compared with tags assigned by the team, and mismatches feed back into the rule table.
- Every amount and date in a summary appears verbatim in the disclosure text.
Frequently asked questions
Does KAP have a public API or RSS feed?
As of October 2026, KAP's regulations and guides page describes no RSS feed. For API access, MKK's API Portal documents an official REST API for data dissemination organizations, KAP Data Dissemination Services, with production access through a token obtained with an API key issued by MKK. KAP data is also part of Borsa Istanbul's data publication products and is obtained through licensed data distributors.
Why does the same disclosure never arrive twice?
Every disclosure is stored under its unique KAP number, and a repeated number produces no message. Corrections arrive with a new number, so they are posted as replies to the original message.
Why are messages queued at busy times?
Telegram does not let bots send more than 20 messages per minute in a group. The bot sends messages in order within that limit and can group several disclosures from the same company into one message.
Does the bot give investment advice?
No. It classifies a disclosure, summarizes it briefly and links to the original text; it makes no trading decisions and places no orders.
Sources
- KAP: Guide to the KAP website (22 March 2025) (Turkish) (opens in a new tab)
- KAP: Regulations and guides page (Turkish) (opens in a new tab)
- MKK: Directive on KAP membership and disclosure submission, Articles 19 and 27 (Turkish) (opens in a new tab)
- Borsa Istanbul: Data publication products (MKK data, KAP data) (Turkish) (opens in a new tab)
- Borsa Istanbul: Data publication (licensed data distributors) (Turkish) (opens in a new tab)
- Borsa Istanbul: Procedure on theoretical/reference prices of shares in corporate actions, revision 03 (06/04/2026), section 5 (Turkish) (opens in a new tab)
- Turkish legislation database: Capital Markets Law No. 6362, Article 3 (definition of KAP) (Turkish) (opens in a new tab)
- Telegram: Bot API (opens in a new tab)
- Telegram: Bots FAQ (sending limits) (opens in a new tab)
- MKK API Portal: KAP Data Dissemination Services documentation (Turkish) (opens in a new tab)