Data & API

CompanyKhoja is fully static. Search, filters, and statistics run client-side from a single JSON file.

STATIC/data/companies.json

The entire dataset (~160K companies) is served as a static JSON array. All search, filtering, and statistics are computed in the browser using MiniSearch + Fuse.js.

Typical usage

const res = await fetch('/companykhoja/data/companies.json')
const companies = await res.json()
// companies is an array of Company objects
DEV ONLYhttp://localhost:3000/api

When running npm run dev, REST endpoints are available for local development. These do not exist in the static build on GitHub Pages.

GET/api/companies

Search and list companies with filters and pagination.

Query Parameters

ParamTypeDescription
qstringSearch term (name, registration number, address)
provincestringFilter by province name
districtstringFilter by district name
typestringFilter by company type (e.g. Private Limited)
ownershipstringFilter by ownership (Nepali, Foreign, etc.)
categorystringFilter by industry category (Technology, Finance, etc.)
rokkastringFilter by status (Active, Under Rokka)
yearnumberFilter by registration year (BS)
datestringFilter by exact registration date (BS YYYY-MM-DD)
sincenumberShow companies registered in the last N days from today (BS)
letterstringFilter by starting letter of company name
sortstringSort: newest, oldest, az, za, registrationNumber, random
pagenumberPage number (default: 1)
limitnumberResults per page (max: 100, default: 20)

Example Request

GET /api/companies?q=kathmandu&type=Private%20Limited&page=1&limit=10

Response

{
  "companies": [{ ...company }],
  "total": 342,
  "page": 1,
  "perPage": 10,
  "totalPages": 35,
  "executionTimeMs": 2
}
GET/api/companies/:id

Get a single company by its ID.

Example Request

GET /api/companies/351676

Response

{
  "id": "351676",
  "registrationNumber": "351676",
  "nameEnglish": "Some Company",
  "nameNepali": "कम्पनी नाम",
  "registrationDate": "2081-05-18",
  "companyType": "Private Limited",
  "ownership": "Nepali",
  "address": "Kathmandu-29,Kathmandu",
  "province": "Bagmati",
  "district": "Kathmandu",
  "municipality": "Kathmandu Metropolitan City",
  "rokkaStatus": "Active",
  "category": "Technology",
  "keywords": ["keyword1", "keyword2"],
  "updatedAt": "2025-01-01T00:00:00.000Z",
  "createdAt": "2081-05-18"
}
GET/api/stats

Aggregate statistics across all companies.

Response

{
  "totalCompanies": 162874,
  "latestRegistrationDate": "2081-05-18",
  "todayBS": "2083-02-30",
  "lastUpdated": "2025-01-01T00:00:00.000Z",
  "todayRegistrations": 12,
  "weeklyRegistrations": 45,
  "monthlyRegistrations": 203,
  "byProvince": { "Bagmati": 50000, ... },
  "byDistrict": { "Kathmandu": 30000, ... },
  "byType": { "Private Limited": 120000, ... },
  "byOwnership": { "Nepali": 140000, ... },
  "byRokka": { "Active": 150000, "Under Rokka": 5000 },
  "byCategory": { "Technology": 15000, ... },
  "yearlyGrowth": [
    { "year": 2075, "count": 2000 },
    { "year": 2081, "count": 8000 }
  ],
  "timeline": [
    { "date": "2081-01-01", "count": 10 }
  ]
}

Company Fields

FieldTypeDescription
idstringUnique identifier
registrationNumberstringOCR registration number
nameEnglishstringCompany name in English
nameNepalistringCompany name in Nepali
registrationDatestringRegistration date in BS (YYYY-MM-DD)
companyTypestringPrivate Limited, Public Limited, etc.
ownershipstringNepali, Foreign, Joint Venture, Solo Owner, etc.
addressstringFull registered address
provincestringProvince name
districtstringDistrict name
municipalitystringMunicipality name
rokkaStatusstringActive, Under Rokka, Dissolved
categorystringIndustry category (Technology, Education, Finance, etc.)
keywordsstring[]Search keywords extracted from company name

Data Source

Data is sourced from the Office of Company Registrar, Nepal via their public search API. The full dataset is available on GitHub.