@firmenakte/api-client

中文文档
2.34.0发布于 2026/11/14TypeScriptCommonJS零依赖近 30 天下载 2380

TypeScript/JavaScript client for the Firmenakte API

原始使用文档
文档目录5 节
  1. Installation
  2. Quick start
  3. v2
  4. Credits and rate limits
  5. Documentation

@firmenakte/api-client

TypeScript/JavaScript client for the Firmenakte API.

Installation

npm install @firmenakte/api-client

or with pnpm:

pnpm add @firmenakte/api-client

Quick start

import { createApiClient } from "@firmenakte/api-client";

const api = createApiClient({
  apiKey: "your-api-key",
  baseUrl: "https://api.firmenakte.at", // optional, defaults to production
  timeoutMs: 10_000, // optional, defaults to 10 seconds
});

// Use the API, e.g. list businesses
const { data } = await api.v1BusinessesList();

The timeout starts separately for every request and also covers reading its response body. Pass an AbortSignal in an endpoint's request parameters when the caller needs to cancel sooner:

const controller = new AbortController();
const request = api.v1BusinessesList(undefined, { signal: controller.signal });
controller.abort();
await request;

v2

The v2 API is the subpath @firmenakte/api-client/v2; the package's root export stays v1. Its client has one method per operation, named by the operation's operationId in the v2 reference:

import { createApiClient, isApiError } from "@firmenakte/api-client/v2";

const client = createApiClient({ apiKey: process.env.FIRMENAKTE_KEY });
const { data: company, response } = await client.getCompany({ path: { id: "fnr:56247t" } });
console.log(company.name, response.headers.get("X-Credits-Charged"));

try {
  await client.getCompany({ path: { id: "fnr:999999x" } });
} catch (error) {
  if (!isApiError(error)) throw error; // no answer: network failure, timeout or abort
  console.log(error.status, error.problem?.detail);
}

Each method takes { path, query, body, headers } as the operation defines them, plus any fetch option such as signal; path parameters are encoded for you. A 2xx answer resolves with { data, request, response }. Anything else rejects with an ApiError: status, the problem JSON as problem, and the response. File downloads (getExportFile, getDocumentContent, getLicenseExtract) take parseAs: "blob" or "stream".

Credits and rate limits

API calls use your account's weekly credits, shared across all its keys. Free includes 50, Starter 500, Business 5,000, and Enterprise an agreed allowance. It resets on Monday at 00:00 UTC. Purchased credits never expire and pay for calls the weekly allowance cannot cover. See credit pricing.

Operations declare x-credit-class in the OpenAPI spec: basic costs 1 credit and expensive costs 3. Charged responses include X-Credits-Charged and X-Credits-Remaining. The client exposes these on the response's headers:

const response = await api.v1BusinessesList();
const charged = response.headers.get("X-Credits-Charged");
const remaining = response.headers.get("X-Credits-Remaining");

Endpoint responses cost credits even for 400 or 404. Authentication failures, 401, requests rejected with 429, and server errors, 5xx, cost no credits. Credit exhaustion returns 429, an error message starting with Credits aufgebraucht, and Retry-After in seconds until Monday 00:00 UTC. The separate burst limit returns Retry-After: 60. A longer wait means credit exhaustion; near Monday, check the error message because the reset can be 60 seconds or less away.

Documentation

Full API reference, authentication, and guides: https://docs.firmenakte.at

版本与发布记录

@firmenakte/api-client 共发布 29 个版本,首次发布于 2026/03/05;过去 12 个月发布了 29 个版本。

版本发布日期距今
2.34.0latest2026/11/14今天
2.33.02026/11/122 天前
2.32.02026/11/123 天前
2.31.02026/11/059 天前
2.30.02026/11/0410 天前
2.29.02026/11/0311 天前

关于 @firmenakte/api-client 的常见问题

@firmenakte/api-client 是什么?

TypeScript/JavaScript client for the Firmenakte API

如何安装 @firmenakte/api-client?

在项目目录运行 npm install @firmenakte/api-client,或使用 pnpm add / yarn add / bun add。

@firmenakte/api-client 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@firmenakte/api-client 支持 ESM 还是 CommonJS?

以 CommonJS 形式发布,可以直接 require();在 ES Module 项目中也可以用 import 引入(Node.js 会把 module.exports 作为默认导出)。

@firmenakte/api-client 可以商用吗?

@firmenakte/api-client 使用 未声明 许可。package.json 没有声明许可证。没有许可证的代码默认保留全部权利,商用前请联系作者或查看仓库中的 LICENSE 文件。以上为概括,不构成法律意见,请以许可原文为准。

@firmenakte/api-client 的下载量有多少?

根据 npm 官方下载统计,@firmenakte/api-client 在 2026/10/15 – 2026/11/13 这 30 天内被下载 2,380 次,日均约 79 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@firmenakte/api-client 还在维护吗?

最新版本 2.34.0 发布于 2026/11/14(今天);至今共发布 29 个版本,其中过去 12 个月发布了 29 个;首次发布于 2026/03/05。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。