Overview
The Company Filings API uses a hybrid dual-endpoint approach to maximize coverage of regulatory filings. It fetches from both the legacy/company_filings endpoint and the newer /lodr endpoint, then merges and deduplicates results to ensure comprehensive filing coverage.
Source File: fetch_company_filings.py
Endpoint Details
Primary Endpoint
https://ow-static-scanx.dhan.co/staticscanx/company_filingsSecondary Endpoint (LODR)
https://ow-static-scanx.dhan.co/staticscanx/lodrPOST (both endpoints)application/jsonRequest Headers
Request Payload
Both endpoints use identical payload structure:ISIN code of the company
Page number (1-indexed)
Number of filings per page (maximum 100)
Example Payload
Example Request
Response Structure
Array of filing objects
Filing Object Fields
Unique filing identifier
Filing date in YYYY-MM-DD format
Filing title/caption
Filing description
PDF or document URL
Filing category (e.g., “Board Meeting”, “Financial Results”)
Example Response
Hybrid Merge Logic
The implementation merges results from both endpoints and deduplicates:Deduplication Strategy
news_id (if available){news_date}_{caption} (composite key)Priority Rules
- If
news_idexists, use it as unique key - Otherwise, create composite key from date + caption
- On duplicates, prefer entry with
file_url - Sort final results by
news_datedescending (latest first)
Code Implementation
Implementation Details
Configuration
Concurrent threads for parallel fetching across stocks
Request timeout in seconds per endpoint
Filings per page (maximum supported)
Refresh all filings regardless of existing files
master_isin_map.jsoncompany_filings/{SYMBOL}_filings.jsonOutput File Structure
Each stock gets its own file:Threading Model
The script uses ThreadPoolExecutor for parallel processing:Performance Metrics
- Total Stocks: ~2,775
- Threads: 20 concurrent requests
- Time per Stock: ~2-3 seconds (dual endpoint fetch)
- Total Time: ~7-10 minutes for full market
- Success Rate: >95%
- Avg Filings per Stock: 50-100 (varies by company)
Progress Tracking
Error Handling
Timeout Handling
Empty Response Handling
- If both endpoints return empty: File marked as “empty”
- If one endpoint fails: Uses data from successful endpoint
- If both fail: Error count incremented, no file written
Use Cases
- Regulatory Compliance Tracking: Monitor LODR filings
- Corporate Action Discovery: Find dividend, bonus, split announcements
- Board Meeting Outcomes: Track quarterly result approvals
- Material Events: Identify significant corporate events
- Document Archive: Build comprehensive filing database
Filing Categories
Common filing types retrieved:- Board Meeting Outcomes
- Financial Results (Quarterly/Annual)
- Dividend Announcements
- Corporate Actions (Bonus, Split, Rights)
- Material Events
- Shareholding Pattern
- Related Party Transactions
- General Announcements
Notes
- The dual-endpoint approach ensures maximum filing coverage
- LODR endpoint typically has more recent filings
- Legacy endpoint may have historical filings not in LODR
- Deduplication prevents double-counting of filings
- Files are per-symbol for efficient selective updates
- Set
FORCE_UPDATE = Falseto skip existing files (faster incremental runs) - The API does not paginate beyond page 1 in current implementation (100 filings assumed sufficient)