Data & API
CompanyKhoja is fully static. Search, filters, and statistics run client-side from a single JSON file.
STATIC
/data/companies.jsonThe 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 objectsDEV ONLY
http://localhost:3000/apiWhen running npm run dev, REST endpoints are available for local development. These do not exist in the static build on GitHub Pages.
GET
/api/companiesSearch and list companies with filters and pagination.
Query Parameters
| Param | Type | Description |
|---|---|---|
| q | string | Search term (name, registration number, address) |
| province | string | Filter by province name |
| district | string | Filter by district name |
| type | string | Filter by company type (e.g. Private Limited) |
| ownership | string | Filter by ownership (Nepali, Foreign, etc.) |
| category | string | Filter by industry category (Technology, Finance, etc.) |
| rokka | string | Filter by status (Active, Under Rokka) |
| year | number | Filter by registration year (BS) |
| date | string | Filter by exact registration date (BS YYYY-MM-DD) |
| since | number | Show companies registered in the last N days from today (BS) |
| letter | string | Filter by starting letter of company name |
| sort | string | Sort: newest, oldest, az, za, registrationNumber, random |
| page | number | Page number (default: 1) |
| limit | number | Results 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/:idGet 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/statsAggregate 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
| Field | Type | Description |
|---|---|---|
| id | string | Unique identifier |
| registrationNumber | string | OCR registration number |
| nameEnglish | string | Company name in English |
| nameNepali | string | Company name in Nepali |
| registrationDate | string | Registration date in BS (YYYY-MM-DD) |
| companyType | string | Private Limited, Public Limited, etc. |
| ownership | string | Nepali, Foreign, Joint Venture, Solo Owner, etc. |
| address | string | Full registered address |
| province | string | Province name |
| district | string | District name |
| municipality | string | Municipality name |
| rokkaStatus | string | Active, Under Rokka, Dissolved |
| category | string | Industry category (Technology, Education, Finance, etc.) |
| keywords | string[] | 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.
