Skip to main content
Thirdwatchthirdwatch
Companies & leads

Build an Indian Company Database by CIN

Build a CIN-keyed research database from Apify exports. Keep Tofler observations and CIN-only fallbacks separate so a later lookup preserves earlier company data.

Editorial illustration for companies & leads
· Updated · 2 min read · 474 words
View the Apify scraper →

Use a Corporate Identification Number (CIN) to group observations about the same Indian company. The MCA India Actor can return two kinds of rows. A tofler row contains fields read from a public company page. A cin_format row contains information decoded from the identifier alone. A database that treats the two as equivalent can silently replace a known company name with a blank.

Start with one known CIN

Enter this input on the Actor’s Apify listing. A CIN works better than a company name for this lookup. Export the resulting dataset as JSON. Keep the dataset ID and the UTC time the run finished so you can trace the observation later. Actor input schema

{
  "queries": ["L17110MH1973PLC019786"],
  "maxResults": 1,
  "includeDirectors": false
}
Value of data_source What you can store How to read it
tofler CIN, available company name, share capital and other returned fields Tofler supplied a page. Individual fields can still be empty.
cin_format CIN and decoded fields such as state code and incorporation year The identifier’s format alone gives no evidence of current registration or status.

Import repeatable snapshots into SQLite

Save this script as import_companies.py. Give it the JSON file, its Apify dataset ID and the UTC run time. Replaying the same dataset keeps one row per CIN. A later dataset can contain a fallback record without erasing the earlier observation.

import json
import sqlite3
import sys
from pathlib import Path

file_name, dataset_id, observed_at = sys.argv[1:]
items = json.loads(Path(file_name).read_text(encoding="utf-8"))
with sqlite3.connect("companies.sqlite") as db:
    db.execute("""
        CREATE TABLE IF NOT EXISTS company_observation (
            dataset_id TEXT NOT NULL,
            cin TEXT NOT NULL,
            observed_at TEXT NOT NULL,
            data_source TEXT NOT NULL,
            company_name TEXT,
            authorized_capital TEXT,
            PRIMARY KEY (dataset_id, cin)
        )
    """)
    for item in items:
        cin, source = item.get("cin"), item.get("data_source")
        if not cin or source not in ("tofler", "cin_format"):
            raise ValueError("Review the dataset: expected a CIN and a known source")
        db.execute("""
            INSERT INTO company_observation VALUES (?, ?, ?, ?, ?, ?)
            ON CONFLICT (dataset_id, cin) DO NOTHING
        """, (dataset_id, cin, observed_at, source,
              item.get("company_name"), item.get("authorized_capital")))

For example, run python import_companies.py companies.json DATASET_ID 2026-11-06T09:00:00Z with the ID and time from your run. The searchable unit is one observation. To see the name most recently returned by Tofler for a particular CIN, query the dated records.

SELECT company_name, authorized_capital, observed_at, dataset_id
FROM company_observation
WHERE cin = 'L17110MH1973PLC019786'
  AND data_source = 'tofler' AND company_name IS NOT NULL AND company_name <> ''
ORDER BY observed_at DESC, dataset_id DESC
LIMIT 1;

Keep observed_at with the result. It tells you when you captured the page. For a current official status or filing, check the company on the Ministry’s portal. For interpreting directors, capital and missing fields, see the separate due-diligence guide. Ministry of Corporate Affairs · CIN due-diligence guide

Frequently asked questions

Where does the company information come from?

The Actor reads public Tofler pages. When it can only interpret the CIN, it labels the result cin_format. Check current official records through the Ministry of Corporate Affairs.

How should I update an existing company?

Save each dataset as a new observation keyed by dataset ID and CIN. Keep a missing field empty and preserve earlier observations so you can see when a value was last reported.

Related