Node.js SDK for German Trade Register: Access Company Data via API
Discover the new handelsregister.ai Node.js package for easy access to German company data. Retrieve financial KPIs, management info, and business data directly from the German trade register – with practical code examples and batch processing for developers.
The New Node.js Package for the Commercial Register
The new Node.js SDK from handelsregister.ai delivers comprehensive company data: management information, financial statements, and much more. With this official handelsregister.ai NPM package you can now access structured company data from the German Commercial Register even more easily and use it in your Node.js projects. Whether you want to analyse financial KPIs, query executives, or enrich large data sets, this package combines all key functions in a slim, modern client.
New Node.js package for accessing the Commercial Register released
We’re excited to introduce our brand-new Node.js SDK for the handelsregister.ai API. JavaScript/TypeScript developers now have an easy way to integrate up-to-date company data from the German Commercial Register into their applications. The SDK wraps handelsregister.ai’s REST API and offers convenient methods to fetch company information programmatically—without wrestling with unstructured PDFs or complex endpoints.
What can the new package do?
- Simple search: Find companies by name, location, and other parameters.
- Financial data: Access annual reports, financial KPIs, and profit & loss statements.
- Management information: Learn about current and former executives, including roles and terms of office.
- Detailed company data: Get comprehensive info on legal form, status, register number, business purpose, and more.
- Batch processing: Automate the enrichment of large company datasets with current register data.
- Resilient design: Built-in fault tolerance (retries, caching, snapshots) means you don’t have to worry even with complex queries.
These features simplify countless use cases—from targeted company searches to large-scale automated data enrichment. Start-ups and developers in Germany especially benefit from the ability to embed official company data quickly and easily into their products without building their own scrapers or manual workflows.
Installation and first steps
Installation is straightforward. Install the package via npm:
npm install handelsregister
Next, add your handelsregister.ai API key—either as an environment variable or directly in your code. The recommended way is the environment variable HANDELSREGISTER_API_KEY:
export HANDELSREGISTER_API_KEY=YOUR_API_KEY
Alternatively, you can pass the API key when initializing the client.
Example 1: Quick start
With just a few lines of code you can immediately access company information. The example below shows how to use the SDK to fetch company data for a search query:
const { Handelsregister } = require('handelsregister');
// Initialize client (API key from env var or passed directly)
const client = new Handelsregister(); // automatically uses HANDELSREGISTER_API_KEY
// Fetch company information (search by name + location)
const companyData = await client.fetchOrganization('KONUX GmbH München');
console.log(companyData.name); // e.g. "KONUX GmbH"
console.log(companyData.status); // e.g. "active"
console.log(companyData.registrationNumber); // e.g. "HRB 30065"
You instantly receive key basic information—perfect for a quick overview of a company. In the example we search for “KONUX GmbH München” and output the name, status, and register number of the company found. Of course, instead of a company name you can include other criteria such as location or register court.
Example 2: Object-oriented usage
If you prefer working with object instances, the SDK provides a practical class interface. Using the Company class you can treat each firm as an object with properties and methods:
const { Company } = require('handelsregister');
// Instantiate a Company object with search term and optional features
const company = new Company('OroraTech GmbH München'); // API key used internally
// Basic information
console.log(`Name: ${company.name}`); // Company name
console.log(`Register number: ${company.registerNumber}`); // e.g. "HRB 251311"
console.log(`Status: ${company.status}`); // "active" or "inactive"
console.log(`Address: ${company.address}`); // Full address
// Management information
for (const person of company.currentRelatedPersons) {
console.log(`Manager: ${person.name} – Role: ${person.role.en.long}`);
}
// Financial data (most recent year)
if (company.latestFinancialKPI) {
const kpi = company.latestFinancialKPI;
console.log(`Revenue (${kpi.year}): ${kpi.revenue}`);
console.log(`Employees (${kpi.year}): ${kpi.employees}`);
}
Here we create a Company object for OroraTech GmbH München. The object exposes properties such as name, register number, status, or formatted address. Lists like currentRelatedPersons and pastRelatedPersons let you easily retrieve current or former managing directors. Financial data are structured—revenue or head-count per year—and accessible via methods like latestFinancialKPI or getFinancialKPIByYear().
This object-oriented approach is handy when accessing the same company data repeatedly or working with several firms in parallel. The SDK handles the queries in the background while you work with clean, readable objects.
Example 3: Batch processing & data enrichment
When processing large numbers of records at once, the SDK can save enormous time. The built-in enrich method lets you automatically enrich a list of companies with register data instead of querying each one individually.
Suppose you have a CSV file of firms you want to augment with current register info—you could do:
// Example: 'companies.csv' with columns "company_name" and "city"
await client.enrich({
filePath: 'companies.csv',
inputType: 'csv',
queryProperties: {
company_name: 'name', // use CSV column 'company_name' as search name
city: 'location' // use CSV column 'city' as search location
},
snapshotDir: './snapshots', // optional: store intermediate results
params: {
features: ['related_persons', 'financial_kpi'] // request extra data
}
});
The SDK reads every entry in companies.csv, fetches current company data for each row, and writes the enriched results back (by default into a new file). queryProperties configures which input fields should be used as search parameters (here name and city). In this way you can automatically supplement large company lists with up-to-date financial and management data without querying each firm manually. Thanks to snapshotting, interrupted runs resume where they left off—ideal for reliable batch jobs.
Features and properties at a glance
Wondering which data points are available? Each request lets you enable features to specify which extra information you want (by default the API returns core data such as name, address, register entry, etc.):
| Feature flag | Description |
|---|---|
related_persons |
Management and executive information |
financial_kpi |
Financial KPIs (revenue, number of employees, etc.) |
balance_sheet_accounts |
Balance-sheet data (assets/liabilities from annual reports) |
profit_and_loss_account |
P&L data (income/expenses from annual reports) |
publications |
Official announcements (register publications) |
The Company class also provides numerous properties for easy access to individual data fields. Some examples:
// Basic information
company.name // Company name
company.entityId // Unique ID (UUID)
company.status // Active/inactive status
company.legalForm // Legal form (e.g. "GmbH")
company.registerNumber // Commercial register number
// Address
company.address // Full address as a single string
company.street // Street
company.postalCode // Postal code
company.city // City/registered office
// Management
company.currentRelatedPersons // Current management/executives
company.pastRelatedPersons // Former management
company.getRelatedPersonsByRole('Geschäftsführer') // Filter persons by role
// Financial data
company.financialKPIs // Financial KPIs (all available years)
company.latestFinancialKPI // Financial KPIs for the newest year
company.getFinancialKPIByYear(2023) // Financial KPIs for a specific year
// Documents
await company.fetchDocument('shareholders_list', 'company.pdf') // e.g. download shareholders' list
As you can see, these properties give direct access to nearly all key company information—from addresses and register details to financial figures and management personnel. Integration into your own apps is hassle-free: the data arrive parsed and structured, ready for immediate processing.
Why is it worth using?
With the Commercial Register Node.js SDK you save significant time and effort when automating data from the German Commercial Register. Instead of digging through unstructured PDFs or building your own interfaces, you can rely on a well-documented, robust library. You get access to current management data, financial KPIs, and many other company details—through a single, easy-to-use API.
For projects in data analytics, business intelligence, or workflow automation this package is a real asset. You can query hundreds of companies in seconds and feed the results straight into your applications. That greatly simplifies reporting, market monitoring, or background research. By abstracting away the complex official interfaces into simple method calls you can focus on implementing your business logic while the SDK does the heavy lifting.
Licence and outlook
The Node.js SDK is released under the MIT Licence, giving you maximum flexibility in your own projects. As an open-source project it thrives on community input—feel free to check out the source code on GitHub and don’t hesitate to open issues or submit pull requests. We look forward to your feedback and welcome any contributions!
Questions or need help getting started? Take a look at the README and documentation on GitHub or contact us directly. Together with the developer community we aim to improve the package continuously and tailor it even better to your needs.
The handelsregister.ai team wishes you every success trying it out!