Skip to content
Skip to Content
DalalOSdocs

Recipe

Filing alert bot

Watch the filings of the companies you follow and post a short message for each new one. What you may do with the data is set by the terms.

What you will build

A job that reads the new filings of your companies, remembers which it has sent, and posts one message for each to a webhook or the console.

Before you start

  • An API key on a plan that includes the REST API. Create one on the keys page of your dashboard and set it as DALALOS_API_KEY.
  • Credits: each call costs credits from your plan. The limits say how many calls a run makes. Plans and credits are on Plans, credits and errors.
  • The NSE symbols to watch.
  • An optional webhook address, for example a Slack incoming webhook, in the WEBHOOK_URL variable.

Step 1: List announcement buckets

List the announcement buckets: kinds of BSE announcement that are worth watching across the market, such as order wins, fund raising and credit ratings. Each entry in buckets has an id and a label. Pick the kinds that matter to you.

GET /buckets has the parameters, the errors and a box to send the call.

List announcement buckets
curl -H "Authorization: Bearer $DALALOS_API_KEY" "https://mcp.dalalos.in/v1/buckets"
{
  "status": "success",
  "data": {
    "count": 5,
    "buckets": [
      {
        "id": "order-receipts",
        "label": "Order / Contract Receipts"
      },
      {
        "id": "fundraise",
        "label": "Fund Raising"
      }
    ]
  },
  "cached_at": null,
  "source": "bse-announcements",
  "stale": false,
  "error": null,
  "reason_code": null
}

Saved answer. Run on 2026-11-27, answered 200. Lists show their first item in full; the other items and long text are shortened. A call you make now gets the current answer.

Feeds the next step: A bucket id for step 2.

Step 2: Announcement bucket

Read every company that filed in one bucket within a window. Use days to set how far back to look; truncated says the list was cut, so use a shorter window. This is the market-wide view: each entry in events has nse_symbol, news_id, filed_at and title. The script keeps the rows of your companies.

GET /buckets/{bucket} has the parameters, the errors and a box to send the call.

Announcement bucket
curl -H "Authorization: Bearer $DALALOS_API_KEY" "https://mcp.dalalos.in/v1/buckets/credit-rating?days=30"
{
  "status": "success",
  "data": {
    "bucket": "credit-rating",
    "label": "Credit Rating Actions",
    "days": 30,
    "count": 200,
    "total_scanned": 218,
    "truncated": true,
    "events": [
      {
        "news_id": "bf7a0161-b669-43bb-9ee4-948ced224a21",
        "isin": "INE238A01034",
        "nse_symbol": "AXISBANK",
        "name": "Axis Bank Limited",
        "bse_code": "532215",
        "filed_at": "2026-11-27T19:25:48+05:30",
        "title": "RATING ACTION BY S&P GLOBAL RATINGS",
        "title_source": "headline",
        "category": "Company Update",
        "sub_category": "Credit Rating",
        "subject": "AXIS Bank Ltd - 532215 - Announcement under Regulation 30 (LODR)-Credit Rating",
        "headline": "RATING ACTION BY S&P GLOBAL RATINGS",
        "attachment_url": "https://www.bseindia.com/xml-data/corpfiling/AttachLive/c3d2283d-7d46-42b4-bb08-229e04c7a0f0.pdf",
        "critical": true,
        "filing_type": "deals"
      },
      {
        "news_id": "e2d5196a-2414-4396-b01f-41ff8005f67a",
        "isin": "INE417C01014",
        "nse_symbol": "PILANIINVS",
        "name": "Pilani Investment and Industries Corporation Limited",
        "bse_code": "539883",
        "filed_at": "2026-11-27T19:13:37+05:30",
        "title": "Please refer the attached file.",
        "title_source": "headline",
        "category": "Company Update",
        "sub_category": "Credit Rating",
        "subject": "Pilani Investment and Industries Corporation Ltd - 539883 - Announcement under Regulation 30 (LODR)-Credit Rating",
        "headline": "Please refer the attached file.",
        "attachment_url": "https://www.bseindia.com/xml-data/corpfiling/AttachLive/2011d3ae-f886-44da-8d5f-36637ad87634.pdf",
        "critical": true,
        "filing_type": "deals"
      }
    ]
  },
  "cached_at": null,
  "source": "bse-announcements",
  "stale": false,
  "error": null,
  "reason_code": null
}

Saved answer. Run on 2026-11-27, answered 200. Lists show their first item in full; the other items and long text are shortened. A call you make now gets the current answer.

Step 3: Corporate announcements

For a company on your list, read its recent announcements. Use days for the window and category to keep one kind of filing. Each entry in events has a news_id, filed_at, title and category.

GET /stocks/{q}/events has the parameters, the errors and a box to send the call.

Corporate announcements for RELIANCE
curl -H "Authorization: Bearer $DALALOS_API_KEY" "https://mcp.dalalos.in/v1/stocks/RELIANCE/events?days=30"
{
  "status": "success",
  "data": {
    "label": "Latest company disclosures",
    "source_name": "BSE",
    "coverage_statement": "BSE exchange disclosures filed by the company. Independent news coverage is not included.",
    "isin": "INE002A01018",
    "nse_symbol": "RELIANCE",
    "name": "Reliance Industries Limited",
    "days": 30,
    "category": null,
    "count": 13,
    "total_scanned": 13,
    "truncated": false,
    "merged_duplicates": 0,
    "events": [
      {
        "news_id": "b4cff113-f6e7-4de2-898b-de5e2d8bcdc6",
        "filed_at": "2026-11-19T18:37:38+05:30",
        "title": "This is further to the disclosure dated November 13, 2026 made by the Company. We wish to inform you that the Company executives participated in the Institut…",
        "title_source": "headline",
        "category": "Company Update",
        "sub_category": "General",
        "subject": "Reliance Industries Ltd - 500325 - Update On Institutional Investors'' Meeting - Morgan Stanley 25Th Annual Asia-Pacific Summit",
        "headline": "This is further to the disclosure dated November 13, 2026 made by the Company. We wish to inform you that the Company executives participated in the Institut…",
        "attachment_url": "https://www.bseindia.com/xml-data/corpfiling/AttachHis/3c911ae3-537d-4dad-b536-c6c8337562ee.pdf",
        "critical": false,
        "filing_type": "other"
      },
      {
        "news_id": "2b0ffe7a-a015-4e97-abcb-c95f89a31b67",
        "filed_at": "2026-11-17T18:51:02+05:30",
        "title": "This is further to the disclosure dated November 12, 2026 made by the Company. We wish to inform you that the Company executives participated in the Institut…",
        "title_source": "headline",
        "category": "Company Update",
        "sub_category": "General",
        "subject": "Reliance Industries Ltd - 500325 - Update On Institutional Investors'' Meeting - JM Financial India Conference",
        "headline": "This is further to the disclosure dated November 12, 2026 made by the Company. We wish to inform you that the Company executives participated in the Institut…",
        "attachment_url": "https://www.bseindia.com/xml-data/corpfiling/AttachHis/eadec632-3d3c-49bd-8f85-6d26d79a4332.pdf",
        "critical": false,
        "filing_type": "other"
      }
    ],
    "index_changes": []
  },
  "cached_at": null,
  "source": "bse-announcements",
  "stale": false,
  "error": null,
  "reason_code": null,
  "freshness": {
    "version": 1,
    "stale": false,
    "source_check": {
      "refresh_announcements_poll": "2026-11-27T14:59:30+00:00",
      "refresh_announcements": "2026-11-27T14:50:02+00:00",
      "status": "recent"
    },
    "reason_codes": [],
    "reason_text": ""
  }
}

Saved answer. Run on 2026-11-27, answered 200. Lists show their first item in full; the other items and long text are shortened. A call you make now gets the current answer.

Feeds the next step: The news_id of each filing.

Step 4: Filing extract

Read the facts of one BSE filing. Send the company and the news_id from step 3. The answer has filed_subject, a status (the saved one is facts_only, with summary empty) and the facts. A filing that has not been read yet is queued, and this call can use your on-demand quota.

GET /stocks/{q}/filings/{news_id}/extract has the parameters, the errors and a box to send the call.

Filing extract for RELIANCE
curl -H "Authorization: Bearer $DALALOS_API_KEY" "https://mcp.dalalos.in/v1/stocks/RELIANCE/filings/e415860f-9a80-4f00-aef6-d2399ad9e1e7/extract"
{
  "status": "success",
  "data": {
    "news_id": "e415860f-9a80-4f00-aef6-d2399ad9e1e7",
    "isin": "INE002A01018",
    "doc_type": "concall",
    "status": "facts_only",
    "page_count": 29,
    "extraction_method": "pypdf_text",
    "parser_version": 7,
    "filed_subject": "Reliance Industries Ltd - 500325 - Announcement under Regulation 30 (LODR)-Earnings Call Transcript",
    "filed_at": "2026-11-01T23:05:17+05:30",
    "summary": null,
    "summary_grounded": false,
    "summary_model": null,
    "conflicts_present": true,
    "facts": [
      {
        "fact_key": "qualitative_growth_guidance",
        "value": null,
        "value_text": "we are quite confident these will start giving us results next year where they will start being accretive to the bottom line as well (as stated by company)",
        "unit": null,
        "is_forward_looking": true,
        "source_quote": "we are quite confident these will start giving us results next year where they will start being accretive to the bottom line as well.",
        "source_page": 8,
        "confidence": 0.99,
        "conflicts_headline": false
      },
      {
        "fact_key": "qualitative_growth_guidance",
        "value": null,
        "value_text": "from next year onwards, we start seeing that it is being accretive (as stated by company)",
        "unit": null,
        "is_forward_looking": true,
        "source_quote": "And as we do that, while we are funding the investment right now, from next year onwards, we start seeing that it is being accretive because of the disciplin…",
        "source_page": 9,
        "confidence": 0.99,
        "conflicts_headline": false
      }
    ],
    "event": {
      "status": "complete",
      "event_type": "guidance_update",
      "schema_version": 1,
      "classifier": {
        "method": "deterministic_v1:schema_directed_v1",
        "confidence": 0.94
      },
      "fields": {
        "breakeven_target": "{…}",
        "capex_guidance": "{…}",
        "cost_pressure": "{…}",
        "cost_provision": "{…}",
        "ebitda_guidance": "{…}",
        "ebitda_margin_guidance_high": "{…}",
        "ebitda_margin_guidance_low": "{…}",
        "guidance_period": "{…}",
        "labour_availability": "{…}",
        "order_inflow_guidance_high": "{…}",
        "order_inflow_guidance_low": "{…}",
        "pass_through_mechanism": "{…}",
        "pat_guidance": "{…}",
        "qualitative_growth_guidance": "{…}",
        "revenue_growth_guidance_high": "{…}",
        "revenue_growth_guidance_low": "{…}",
        "revenue_guidance": "{…}",
        "working_capital_guidance": "{…}"
      },
      "completeness": {
        "required_found": 1,
        "required_total": 1,
        "optional_found": 2,
        "optional_total": 17
      }
    },
    "card": {
      "kind": "earnings_call",
      "about": "Transcript of Reliance Industries Limited's earnings call covering group performance, refining and marketing, petrochemicals, exploration and production, and…",
      "period": "Q2 FY27",
      "period_derived": true,
      "scope": "consolidated",
      "entity": null,
      "paragraph": null,
      "status": "read",
      "claims": [
        "{…}",
        "{…}"
      ],
      "records": [
        "{…}",
        "{…}"
      ]
    }
  },
  "cached_at": "2026-11-02T00:23:02+00:00",
  "source": "indian-stock-mcp",
  "stale": false,
  "error": null,
  "reason_code": null,
  "data_age_seconds": 2212616.411
}

Saved answer. Run on 2026-11-27, answered 200. The data in it was collected on 2026-11-02, not on the run date. Long lists and nested parts are shortened here; {…} and […] mark a part left out. A call you make now gets the current answer.

The full script

Python 3 with the requests package. It reads your key from DALALOS_API_KEY, waits once when the API asks it to slow down, stops with a plain message on 401, 402 and 403, and prints what it reads.

filing_alert_bot.py
import json
import os
import sys
import time

import requests

BASE = "https://mcp.dalalos.in/v1"
HEADERS = {"Authorization": "Bearer " + os.environ["DALALOS_API_KEY"]}


def call(method, path, **kwargs):
    """One request. Waits once on a 429. Stops with a plain message on 401, 402 and 403."""
    for attempt in range(2):
        response = requests.request(method, BASE + path, headers=HEADERS, timeout=30, **kwargs)
        if response.status_code == 429 and attempt == 0:
            time.sleep(float(response.headers.get("Retry-After", "2")))
            continue
        break
    if response.status_code == 401:
        sys.exit("401: the key is missing or not valid. Create one at https://dalalos.in/dashboard/keys")
    if response.status_code == 402:
        sys.exit("402: the monthly credits are used up.")
    if response.status_code == 403:
        sys.exit("403: this plan does not include the REST API.")
    response.raise_for_status()
    return response.json()


def show(title, answer, limit=1200):
    print("==", title)
    print(json.dumps(answer, indent=2)[:limit])


WATCH = ["RELIANCE", "TCS"]  # your companies: NSE symbols
STATE_FILE = "seen_filings.json"  # the news ids already sent
WEBHOOK_URL = os.environ.get("WEBHOOK_URL")  # for example a Slack incoming webhook

seen = set(json.load(open(STATE_FILE))) if os.path.exists(STATE_FILE) else set()

BUCKET = "credit-rating"  # an id from GET /buckets

buckets = call("GET", "/buckets")["data"]["buckets"]
print("announcement buckets:", [b["id"] for b in buckets])

market = call("GET", f"/buckets/{BUCKET}", params={"days": 7})["data"]
mine = [e for e in market["events"] if e["nse_symbol"] in WATCH]
print(len(market["events"]), "companies filed in", BUCKET, "in 7 days;", len(mine), "of them are yours")
for event in mine:
    print(" ", event["nse_symbol"], event["filed_at"][:10], event["title"])

for symbol in WATCH:
    events = call("GET", f"/stocks/{symbol}/events", params={"days": 7})["data"]["events"]
    for event in events:
        news_id = event["news_id"]
        if news_id in seen:
            continue
        extract = call("GET", f"/stocks/{symbol}/filings/{news_id}/extract")["data"]
        if extract["status"] in ("pending", "queued", "processing"):
            continue  # not read yet: leave it out of the seen list and ask again next run
        seen.add(news_id)
        text = symbol + ": " + event["title"] + " (" + event["filed_at"][:10] + ")\n" + json.dumps(extract["facts"][:2])[:500]
        if WEBHOOK_URL:
            requests.post(WEBHOOK_URL, json={"text": text}, timeout=30)
        else:
            print(text)

json.dump(sorted(seen), open(STATE_FILE, "w"))

Run it on a schedule

Runs every hour. Check how often announcements refresh on GET /freshness before choosing an interval.

crontab
0 * * * * python3 /path/to/filing_alert_bot.py

Limits

  • A run makes two calls, plus one for each company you watch and one for each filing not seen before. Each call costs credits from your plan.
  • The first run sends every filing of the last 7 days. Lower days to send fewer.
  • A filing extract that has not been read yet is queued and can use your on-demand quota. When the quota is spent the route answers 200 with a reason code, not an error.
  • Announcements come from BSE and refresh through the day, so a filing can appear some time after it was made.

Extend it

  • Add GET /stocks/{q}/filings/{news_id}/context to read the earlier filings about the same event.
  • Add GET /stocks/{q}/disclosure-search to search the text of a company's past filings.
  • More routes: Filings and announcements.

KEEP EXPLORING