Skip to content

NadirHaciyev/steamwebapi-trade-bot

Repository files navigation

Steamwebapi Trade Bot

Wrapper created for Steamwebapi

License Total Downloads Latest Release

This library provides convenient access to the Steamwebapi REST API from TypeScript or JavaScript.

To learn how to use the Steamwebapi API, check out our API Reference and Documentation.

Table of Contents

Installation

pnpm add steamwebapi-trade-bot
# or
npm install steamwebapi-trade-bot
# or
yarn add steamwebapi-trade-bot

Usage

To use this wrapper, you first need to obtain an API key from the Steam Web API. Follow these steps to get your API key:

  1. Go to the Steam Web API Key Page.
  2. Log in with your Steam account. If you do not have an account, you will need to create one.
  3. Fill in the required information to request an API key. This key will be necessary to access the Steam Web API.

The code below shows how to get started using the Steamwebapi Trade Bot API.

import Trade from "steamwebapi-trade-bot";

// Create instance by providing API Key
const trade = new Trade("STEAMWEBAPI_API_KEY");

// Get Trade Offers
async function main() {
  const offers = await trade.getOffers({ /* options */ });

  console.log(offers.data);
}

main();

Config Defaults

You can specify config defaults that will be applied to every request.

Custom instance defaults

// Set config defaults when creating the instance
const trade = new Trade("STEAMWEBAPI_API_KEY", { assetid: "ASSET_ID" });

// Override per-request:
await trade.getOffers({ assetid: "NEW_ASSET_ID" });

Global trade defaults

trade.defaults.assetid = "ASSET_ID";
trade.defaults.steamcommunityapikey = "STEAM_COMMUNITY_API_KEY";

Examples

For more examples check the examples directory.

Contributing

Contributions to this project are welcome! If you encounter a bug or have a feature request, feel free to open an issue. Pull requests with improvements or new features are also appreciated.

License

This API wrapper is licensed under the MIT License.