Skip to content

Market VPSBot API Documentation ​

Welcome to the official documentation for the Market VPSBot API. This API allows you to programmatically browse items, execute purchases, track trades, and manage your wallet on market.vpsbot.io.

Base URL

All API requests use the base URL:

https://market.vpsbot.io/api

Getting Started ​

Before using the API, you'll need to:

  1. Get your API key for authentication
  2. Understand the available endpoints and their parameters
  3. Implement the API using the provided code examples

API Overview ​

Items API ​

Browse and purchase items on the marketplace:

  • List all items for sale with optional game filtering
  • Search items by market hash name or market ID
  • Buy items directly by asset ID or by name
  • Check item availability before purchasing
  • View recently sold items

Trades API ​

Track your trade history:

  • Filter trades by date range, custom IDs, or trade IDs
  • Paginate through large result sets
  • Monitor trade statuses and errors

Wallet API ​

Manage your project wallet:

  • Check current available balance
  • View frozen (held) balance

Deprecated API Backward Compatibility ​

For users migrating from the deprecated API, we provide a fully backward-compatible API layer:

Response Format ​

Every native API response uses the same envelope:

FieldTypePresentDescription
successbooleanAlwaystrue when the request did what you asked, false otherwise
codestringWhen success is falseMachine-readable error code. Branch on this field
errorstringWhen success is falseHuman-readable description, for display and logs. Do not parse it
dataobject | arrayOn success when the endpoint returns a result, and on a validation errorThe result of the call (its shape is documented per endpoint). On a validation error — the list of invalid fields

A successful response has no code:

json
{
  "success": true,
  "data": { ... }
}

Other formats

The Deprecated API Backward Compatibility layer keeps the deprecated API format. Everything below applies to the rest of the API.

Business Refusal — HTTP 200 ​

The request is valid, but it cannot be carried out: the item is already sold, the price changed, the balance is too low, and so on. The action does not go through, and your balance is left as it was. The response is HTTP 200 with success: false, a machine-readable code and a human-readable error:

json
{
  "success": false,
  "code": "price_changed",
  "error": "Price mismatch: listing price does not match the offered price"
}

Each endpoint lists its business codes: purchases, hold purchases, hold cancel and withdraw, purchase cancel, sell trades. The one exception is purchase cancel: its refusals keep their documented HTTP statuses (404 / 409).

Validation Error — HTTP 400 ​

The request body or query is invalid: a field is missing or has a wrong type or value, or none of the alternative fields was sent. The response is HTTP 400 with code: "validation_failed", and data lists the invalid fields. A body that is not a JSON object answers invalid_payload instead, see Common Codes:

json
{
  "success": false,
  "code": "validation_failed",
  "error": "Validation error",
  "data": [
    {
      "field": "trade_url",
      "code": "required",
      "message": "must have required property 'trade_url'"
    }
  ]
}
FieldTypeDescription
data[].fieldstringPath to the invalid field: trade_url, a nested a.b, an array element items[0].price
data[].codestringWhat is wrong with the field (see below)
data[].messagestringHuman-readable explanation
Field codeMeaning
requiredThe field is missing
required_without_allNone of several alternative fields was sent; every alternative is listed
required_withoutNeither of two alternative fields was sent; both are listed
typeThe value has the wrong type
oneofThe value is not one of the allowed values
min / maxThe number, string length or array size is below the minimum / above the maximum
gtThe number must be greater than the limit
patternThe string does not match the expected pattern
uuid, date-time, uri, …The string is not in the named format

New field codes may be added; treat an unfamiliar one as an invalid value.

System Failure — HTTP 500 ​

The server could not process the request:

json
{
  "success": false,
  "code": "internal_error",
  "error": "Internal server error"
}

Retry later. If the failure persists, contact support.

Common Codes ​

These error codes can come from any endpoint. Business codes are listed on each endpoint's page.

codeHTTPMeaning
validation_failed400The request is invalid; data lists the invalid fields
invalid_payload400The body of an endpoint that takes one is missing or is not a JSON object: it is empty, malformed JSON, an array, a string, a number or null. The same code answers a body sent with an unsupported Content-Type and a body that is too large. No data
unauthorized401The API key is missing or invalid. For API key management: the session is missing or has expired. See Access Control
forbidden403The call is not allowed with these credentials: the account does not have the project role, or an API key was used to create or delete API keys. See Access Control
not_found404The resource or the URL does not exist. An unsupported HTTP method on an existing path answers the same way
conflict409The request conflicts with the current state of the resource
rate_limited429Too many requests, see Rate Limits
internal_error5xxThe server failed to process the request

Handling Responses ​

Check success, then branch on code

  1. Check success first. A successful response has no code.
  2. When it is false, branch on code — not on the error text, and not on the HTTP status alone: a business refusal answers HTTP 200.
  3. Treat an unknown code as a generic failure: new codes may be added.

With axios's default settings, HTTP 4xx / 5xx responses throw (the envelope is in err.response.data), while a business refusal resolves like a success. Check success on every response:

js
const { data } = await client.post('/items/buy', {
  asset_id: '30000000001',
  game_id: 730,
  trade_url: 'https://steamcommunity.com/tradeoffer/new/?partner=XXXXX&token=YYYYY',
  price: 1245,
  custom_id: 'order-001'
});

if (!data.success) {
  switch (data.code) {
    case 'price_changed':
      // refresh the price and retry
      break;
    case 'insufficient_balance':
      // top up the balance
      break;
    default:
      throw new Error(`Purchase refused: ${data.code} (${data.error})`);
  }
}

Rate Limits ​

Some endpoints are rate-limited per user. When rate-limited, responses include headers:

HeaderDescription
X-RateLimit-LimitMaximum requests allowed per window
X-RateLimit-RemainingRemaining requests in current window

Exceeding the rate limit returns HTTP 429 Too Many Requests.

Support ​

If you encounter any issues or have questions, contact our support team via Telegram.

Need help? Contact our support team