npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

node-dmarket

v1.0.2

Published

TypeScript wrapper for DMarket API

Readme

DMarket API

A TypeScript wrapper for the DMarket API, allowing you to easily interact with the DMarket trading platform.

Installation

npm install node-dmarket

Usage

import { DMarketService } from "node-dmarket";

// Initialize the API client
const apiKey = "YOUR_API_KEY";
const apiSecret = "YOUR_API_SECRET";
const gameId = "a8db"; // a8db for CS:GO, tf2 for TF2, 9a92 for Dota 2, rust for Rust

const dmarket = new DMarketService(apiKey, apiSecret, gameId);

// Example: Search market items
dmarket
  .searchMarketItems("item name", { limit: 10 })
  .then((res) => {
    console.log("result: ", res);
  })
  .catch((err) => {
    console.log("err: ", err);
  });

Features

  • Full TypeScript support with comprehensive type definitions
  • Handles authentication automatically
  • Support for all major DMarket API endpoints:
    • Marketplace operations
    • Inventory management
    • Trading
    • Account information
    • And more...

API Methods

  • getUserAccount() - /account/v1/user
  • getUserBalance() - /account/v1/balance
  • searchMarketItems(title, params) - /exchange/v1/market/items
  • getLastSales(title, limit) - /trade-aggregator/v1/last-sales
  • getAggregatedPrices(title) - /price-aggregator/v1/aggregated-prices
  • getMarketDepth(title, filters, aggregatedData) - /marketplace-api/v1/market-depth
  • getUserInventoryApi(params) - /marketplace-api/v1/user-inventory
  • syncUserInventory(game) - /marketplace-api/v1/user-inventory/sync
  • depositAssets(assetIds) - /marketplace-api/v1/deposit-assets
  • getDepositStatus(depositId) - /marketplace-api/v1/deposit-status/depositId
  • withdrawAssets(assets, requestId) - /exchange/v1/withdraw-assets
  • getUserItems(params) - /exchange/v1/user/items
  • getUserOffersApi(params) - /marketplace-api/v1/user-offers
  • createUserOffers(offers) - /marketplace-api/v1/user-offers/create
  • editUserOffers(offers) - /marketplace-api/v1/user-offers/edit
  • deleteOffersApi(offers, force) - /exchange/v1/offers
  • getUserClosedOffers(params) - /marketplace-api/v1/user-offers/closed
  • getOffersByTitle(title, limit, cursor) - /exchange/v1/offers-by-title
  • buyOffers(offers) - /exchange/v1/offers-buy
  • getUserTargets(params) - /marketplace-api/v1/user-targets
  • getUserClosedTargets(params) - /marketplace-api/v1/user-targets/closed
  • createTargets(targets) - /marketplace-api/v1/user-targets/create
  • deleteTargets(targetIds) - /marketplace-api/v1/user-targets/delete
  • getTargetsByTitle(title) - /marketplace-api/v1/targets-by-title/gameId/title
  • getCustomizedFees(offerType, limit, offset) - /exchange/v1/customized-fees

License

MIT

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Getting DMarket API Keys

To get your DMarket API keys:

  1. Go to DMarket.com
  2. Log in to your account
  3. Navigate to Settings
  4. Find the Trading API section
  5. Generate your API keys (public and secret keys)

Please refer to the DMarket FAQ for more details.