# CreatorAPI server SDK 0.2.0 This installable ESM JavaScript/TypeScript package follows the deployed CreatorAPI contracts as of 2026-10-11. Node 18+; no runtime dependencies. It is a self-hosted preview, NOT published to npm. No full OnlyFansAPI parity is claimed. The archived private 0.1.0 candidate had positional methods and undeployed features; 0.2.0 deliberately uses named input objects and response envelopes. ## Install Download the versioned package from [CreatorAPI](https://creator-api.com/tools/sdk/creatorapi-client-0.2.0.tgz), then: ```bash npm install ./creatorapi-client-0.2.0.tgz ``` ```javascript import {CreatorApi} from "@creatorapi/client"; const api = new CreatorApi({apiKey: process.env.CREATORAPI_API_KEY}); const accounts = await api.listAccounts(); const report = await api.getProfitability( {account: "YOUR_ACCOUNT", year: 2026, month: 8}, {wait: true, timeoutMs: 360000} ); console.log(report.data); ``` Every response is {status, data, pending, retryAfterSeconds}. The API JSON body remains under data; e.g. monthly report fields are at result.data.data. Monetary values remain decimal strings. Null profit means unknown inputs, not zero. Only OF and Fansly profitability is enabled; no projected net/milestone/referral equivalence is claimed. ## Tracking ```javascript const transactions = await api.getTrackingTransactions({ account: "YOUR_ONLYFANS_ACCOUNT", campaign_id: "NATIVE_CAMPAIGN_ID", date_start: "2026-09-01T00:00:00Z", date_end: "2026-10-01T00:00:00Z", limit: 100, offset: 0 }, {wait: true, timeoutMs: 360000}); ``` Native tracking uses date_start/date_end, unlike analytics start_date/end_date. The SDK rejects unknown field names instead of silently dropping dates. Native campaign reports are OnlyFans-only; existing fan purchases can be read without a new purchase. Historical click identity may be null and campaigns can overlap. ## Exports ```javascript const catalog = await api.listExportDatasets({platform: "fansly"}); const created = await api.createExport({ account: "YOUR_FANSLY_ACCOUNT", dataset: "chat_messages", fmt: "csv", max_rows: 100, params: {chat_id: "CHAT_ID"} }); const job = await api.waitForExport(created.data.id); if (job.data.status !== "completed") throw new Error("Export did not complete"); const file = await api.downloadExport(job.data.id); console.log(file.data.byteLength); // Only if you intend to remove this terminal export, with a full-scope key: // await api.deleteExport({job_id: job.data.id}); ``` Consult the current dataset catalog for exact per-platform parameter names before creation. CSV/JSONL/XLSX/data ZIP are supported; media archives remain disabled. Download uses the configured API origin and key, not an arbitrary server-returned URL. Default byte cap 64 MiB; override maxBytes deliberately for larger exports. Job waits return failed/cancelled terminal jobs without recreating or retrying them. The SDK does not delete jobs automatically. ## Safety and polling Keys stay on your server. HTTPS is required except loopback development. Redirects, malformed JSON, unsafe paths and oversized responses are refused. Requests have a total deadline covering headers AND body; AbortSignal also cancels waits. Timeouts/429/5xx and network failures do NOT retry. In particular, an ambiguous nativeWrite result must be investigated before any repeat. wait:true is allowed only on getProfitability, getProfitabilityBatch, getProfitabilityHistory, getTrackingTransactions and getTrackingSpenders. It repeats only after HTTP202 and honors Retry-After. Batch profitability is a read-only POST, not a mutation. Generic request/nativeWrite/createExport never poll or replay. waitForExport polls GET for the supplied job only; aborting a local wait does NOT cancel server-side work. No idempotent-send guarantee, browser connection SDK, profile database, screening dataset, CDN upload job helper or Fanvue reconciliation is advertised by this package. Native adapters expose transport, not evidence that every native operation works. ## Automation packages Download [n8n 0.2.0](https://creator-api.com/tools/sdk/n8n-nodes-creatorapi-0.2.0.tgz), [Zapier 0.2.0](https://creator-api.com/tools/sdk/creatorapi-zapier-0.2.0.tgz) and [SHA-256 checksums](https://creator-api.com/tools/sdk/checksums-0.2.0.json). Verify each local archive hash against the checksum manifest before installation. For a self-hosted n8n development instance, install the n8n archive into its custom-nodes directory, restart that instance, then add a CreatorAPI API-key credential. For Zapier, unpack the archive into an isolated developer app with zapier-platform-core, run the platform validation and test commands, and deploy to your own account only after review. Neither action has been performed on a hosted customer instance. Self-hosted n8n and Zapier preview archives provide the same 33 named operations. Optional JSON fields accept valid JSON, e.g. events: ["messages.new"]. Outputs include status, pending and retryAfterSeconds. For pending reports, branch to a Wait/Delay step and repeat the same READ operation; never repeat createExport. Use getExport for queued/running export jobs. Hosted workflows, Make modules, marketplace approval and registry publication are NOT verified or performed. Official comparison sources: [OnlyFansAPI SDK](https://github.com/onlyfansapi/onlyfansapi-typescript-sdk), [profitability](https://docs.onlyfansapi.com/api-reference/analytics-financial/get-profitability). CreatorAPI uses X-API-Key and its own wire contract; this is not a drop-in replacement.