Skip to Content
Canonical source of truth stays in the repository docs. This site is the polished presentation layer.
Getting Started

Getting Started

Runtime Requirements

  • Node.js >=20
  • a CSFloat API key for authenticated account routes
  • TypeScript is optional, but the package is designed to be TypeScript-first

Install

npm install csfloat-node-sdk

The package page is:

Configure

Create .env from .env.example:

CSFLOAT_API_KEY=your_api_key_here

Most public read routes still expect you to initialize the SDK with an API key, so treat the key as the normal entrypoint even if your first calls are public listings or schema reads.

Create Your First Client

import { CsfloatSdk } from "csfloat-node-sdk"; const sdk = new CsfloatSdk({ apiKey: process.env.CSFLOAT_API_KEY!, minRequestDelayMs: 1250, maxRetries: 2, retryDelayMs: 250, });

Key CsfloatClientOptions you will care about first:

  • apiKey Required for the normal SDK flow.
  • minRequestDelayMs Opt-in client-side pacing for scanners, bots, or operators.
  • maxRetries, retryDelayMs, maxRetryDelayMs Retry policy for retryable failures.
  • timeoutMs Per-request timeout.
  • fetch, dispatcher Advanced transport customization.

See Transport, Errors, And Metadata for the full option set.

First Useful Calls

import { CsfloatSdk, getPublicMarketPageParams, } from "csfloat-node-sdk"; const sdk = new CsfloatSdk({ apiKey: process.env.CSFLOAT_API_KEY!, }); const rates = await sdk.meta.getExchangeRates(); const listings = await sdk.listings.getListings(getPublicMarketPageParams()); const me = await sdk.account.getMe(); const inventory = await sdk.inventory.getInventory();

First Useful Advanced Calls

If you want a quicker win than wiring multiple calls by hand:

const feeds = await sdk.workflows.getPublicMarketFeeds({ feed_limit: 3, public_page_limit: 10, }); const workspace = await sdk.workflows.getAccountWorkspace({ watchlist_limit: 3, stall_limit: 3, });

If you need low-level response headers and rate-limit context:

const meWithMetadata = await sdk.client.getWithMetadata("me"); console.log(meWithMetadata.meta.status); console.log(meWithMetadata.meta.rateLimit?.remaining);

What The Package Gives You

The package root exports four major layers:

  1. CsfloatSdk The normal entrypoint for application code.
  2. resource helpers on sdk.* account, listings, meta, loadout, history, users, inventory, stall, workflows.
  3. helper modules and constants buy-order builders, market presets, loadout helpers, schema helpers, wear helpers, pagination utilities.
  4. low-level classes and errors CsfloatHttpClient, CsfloatSdkError, isCsfloatSdkError.
  • Public market scan: sdk.listings.getListings() or sdk.workflows.getPublicMarketFeeds()
  • Account dashboard snapshot: sdk.workflows.getAccountWorkspace()
  • Buy-order insight lookup: sdk.workflows.getSingleSkinBuyOrderInsights()
  • Public loadout discovery: sdk.loadout.getDiscoverLoadouts()
  • Exact method-level reference: Resource Reference
  • Helper/preset reference: Helpers, Builders, And Constants
  • Write payload reference: Write Flows And Payloads

Local Verification

npm test npm run check npm run build

For a publish-ready gate:

npm run release:check

If you want to exercise the published CLI after a build or from an installed package:

npx csfloat-node-sdk help
Last updated on