NAV
shell

Introduction

swap.gg API

Welcome to the official documentation for market.swap.gg!

The base URLs for all swap.gg requests are:

Disclaimer

ON ANY CIRCUMSTANCES DO NOT SHARE YOUR API KEY WITH ANYONE! THIS WILL MOST LIKELY RESULT GIVING AWAY FULL ACCESS TO YOUR SWAP.GG ACCOUNT!

Except as expressly provided for herein, the swap.gg API documentation and all related components and information are provided by swap.gg on an "as is" and "as available" basis without any warranties of any kind, and we expressly disclaim any and all warranties, whether express or implied, including the implied warranties of merchantability, title, fitness for a particular purpose, and non-infringement. You acknowledge that we do not warrant that the swap.gg API will be uninterrupted, timely, secure or error-free. All other market.swap.gg Terms still apply.

Implementation

Here is a brief list of the things to know about our API, as explained in more detail in the following sections.

Authentication

Shell

curl "api_endpoint_here"
  -H "Authorization: api_key"

swap.gg uses API keys to allow access to the API. You can get your swap.gg API key at your settings page. 2FA has to be activated on your swap.gg account before you can generate an API key.

swap.gg expects the API Key to be set in the Authorization header:

Authorization: ad4625ae-8c9e-4c3b-8854-b4b649a0182d

Versioning

We version our API to support forward and backward compatibility. This means that new implementations don't affect applications which depend on our API. The API version you target is defined the first time you make an API request. Every time we make backward-incompatible changes to our API, we simply release a new version. To avoid affecting your applications, we don't modify your version until you're ready to upgrade.

The version is on the second sub-path of the URL. For example: /v1/sales/list

Pagination

When requesting data from endpoints that contain more than one object, you can supply a skip and limit to paginate through the results. Think of it as a page 1, 2, 3... system but you control the number of results per page, and the page to start from. Appended to each response will be the pagination metadata.

Body Parameters

Name Type Description
limit integer Optional. A limit on the number of objects to be returned, between 1 and 100. Defaults to 25.
skip integer Optional. Skips over the specified number of items, between 0 and 2000. Defaults to 0.

Output

Name Type Description
more boolean Indicates if there is more data available.
total string Total number of results found.

Responses

Every response has the same structure.

Name Type Description
time integer The servers current timestamp in milliseconds.
status string Status Code
result any The result of the request.
pagination object Pagination Output Object
error object Not always present, but usually present when status is INVALID_INPUT. This will contain the reason why your request has been declined.

Rate Limiting

swap.gg implements rate limiting to stop users abusing the service. Exceeding your rate limit will result in requests receiving a 429 Too Many Requests response until your reset time is reached.

It is highly recommended you architect your app to check for the X-RateLimit headers below and the 429 Too Many Requests HTTP response code to ensure you are not making too many requests, or continuing to make requests after a 429 code is repeatedly returned. Users who continue to send requests despite a 429 response could potentially have their credentials revoked.

Optimize your requests

You should always plan to minimize requests and cache API responses. If your usage is excessive we shall reach out to discuss ways of optimizing, but our aim is to never restrict legitimate use of the API.

Response Codes

Here is a list of the most common HTTP response codes you will see while using the API.

Response Code Meaning
200 OK - Your request was successful.
204 No Content - Request was successful and there was no data to be returned.
400 Bad request - Server cannot process the request due to malformed syntax or invalid request message framing.
401 Unauthorized - Your API key token is incorrect.
403 Forbidden - You do not have permission to perform the requested action.
404 Not Found - The resource requested could not be found.
405 Method Not Allowed - The method of your request is incorrect.
406 Not Acceptable - You supplied or requested an incorrect Content-Type.
410 Gone - The requested resource is no longer available.
422 Unprocessable Entity - The request was well formed but unable to be followed due to semantic errors.
429 Too Many Requests - You have made too many requests, inspect headers for reset time.
500 Internal Server Error - We had a problem with our server.
503 Service Unavailable - We're temporarily offline for maintenance.

Status Codes

These are all status codes which may be defined in the response object status property:

Status Meaning
OK Everything is ok.
INTERNAL_ERROR Error on our side.
DATABASE_ERROR Unable to connect to database.
STEAM_ERROR Unable to connect to the Steam network.
PAYMENT_ERROR Unable to create payment.
BOT_UNAVAILABLE Bot required to complete operation is currently unavailable.
TEMPORARILY_DISABLED This operation is currently temporarily disabled, please try again later.
INVALID_INPUT Malformed request.
NOT_AUTHENTICATED You are not authenticated.
INSUFFICIENT_BALANCE You don't have enough funds to complete this operation.
INVALID_TRADELINK Invalid trade link has been set under your account.
INVALID_TWOFACTOR Two Factor token provided is invalid.
INVALID_STATE Unable to complete operation due to invalid state of object.
EMAIL_ADDRESS_REQUIRED No email address has been set under your account.
ACCOUNT_LOCKED Your account has been locked, create a support ticket for more information.
PAYMENT_LIMIT_REACHED You have reached your limit for that specific payment method.
RESTRICTED_ACCOUNT Your account does not have the required information (email address, billing information completed).
PENDING_TRADE_OFFER You already have a pending Steam trade offer.
PENDING_PAYOUT You already have a pending payout request.
MAXIMUM_CART_ITEMS Maximum cart items. Your cart is full.
SECURITY_BLOCK For security reasons we cannot process this operation.
MAX_PRICE_LIMIT The prices you tried to set for an item is too high.
CODE_NOT_FOUND Gift code not found.
TICKET_NOT_FOUND Ticket not found.
NO_ITEMS_FOUND Items requested are not available.
INVALID_API_KEY The API key you supplied is invalid.
TWOFACTOR_INPUT This operation requires your current two factor authentication token.
RATE_LIMIT You have been doing that action too frequently, try again later.

Contact

If you spot any errors within the swap.gg documentation, have feedback on how we can make it easier to follow or simply want to discuss how to integrate with our systems, feel free to reach out anytime via info@swap.gg.

User

Get Account Balance

Example request

curl --request GET \
  --url https://market-api.swap.gg/v1/user/balance \
  --header 'Authorization: ad4625ae-8c9e-4c3b-8854-b4b649a0182d'

Example response

{
    "status": "OK",
    "result": {
        "balance": 2338,
        "withdrawableBalance": 2338
    }
}

GET /v1/user/balance

This call returns your available and pending balance of your swap.gg account.

Output

Parameter Type Note
balance integer Your total account balance.
withdrawableBalance integer Balance eligible for payout.

Get Basic Account Details

Example request

curl --request GET \
  --url https://market-api.swap.gg/v1/user/me \
  --header 'Authorization: ad4625ae-8c9e-4c3b-8854-b4b649a0182d'

Example response

{
    "status": "OK",
    "result": {
        "userId": "94353915-f7a2-4a9a-9e5f-ff1f7d9b1f98",
        "username": "Heartz | market.swap.gg",
        "bonus": true,
        "avatar": "https://steamcdn-a.swap.gg/steamcommunity/public/images/avatars/32/327e24a4605a7cf6e2d9308b55493061f426b345_full.jpg",
        "tosAccepted": true,
        "permissions": [],
        "verified": false,
        "locked": false,
        "commission": 5,
        "payout": {
            "SEPA": {
                "linked": false
            }
        },
        "billing": {
            "firstName": "-",
            "lastName": "-",
            "address_1": "-",
            "city": "-",
            "postalCode": "-",
            "country": "-",
            "region": "-",
            "address_2": "-"
        },
        "localization": {
            "currency": "EUR"
        },
        "emailAddress": "example@gmail.com",
        "tradeLink": "https://steamcommunity.com/tradeoffer/new/?partner=123456789&token=abcde_fg",
        "status": {
            "api": false,
            "twoFactor": true
        },
        "restricted": {
            "basic": true,
            "billing": true
        }
    }
}

GET /v1/user/me

This call returns your basic account details from swap.gg.

Output

Parameter Type Note
userId string Unique ID of your swap.gg account.
username string Username of your Steam account.
bonus boolean true if your username contains "swap.gg". This will lower your sales fee.
avatar string Avatar of your Steam account.
verified boolean swap.gg account verification.
locked boolean swap.gg account locked.
commission integer Sales fee that will be used on your next item listings.

Get Account Summary

Example request

curl --request GET \
  --url https://market-api.swap.gg/v1/user/summary \
  --header 'Authorization: ad4625ae-8c9e-4c3b-8854-b4b649a0182d'

Example response

{
    "status": "OK",
    "result": {
        "itemsSold": {
            "count": 136,
            "totalValue": 17997
        },
        "purchases": {
            "count": 61,
            "totalValue": 2330
        },
        "listedItems": {
            "count": 638,
            "totalValue": 328036
        }
    }
}

GET /v1/user/summary

This call returns your account summary, the total amount of items you have sold etc.

The result is cached for 2 hours.

Output

Parameter Type Note
itemsSold object Information about the amount of items sold.
purchases object Information about the purchases you made.
listedItems object Information about your listed items.

Get Active Steam Trade Offers

Example request

curl --request GET \
  --url https://market-api.swap.gg/v1/user/tradeoffers \
  --header 'Authorization: ad4625ae-8c9e-4c3b-8854-b4b649a0182d'

Example response

{
    "status": "OK",
    "result": {
        "items": [{
            "tradeId": "d6ac916d-19ca-48a5-b94e-2bffb1607c24",
            "username": "SWAP.GG #0027 [MARKET]",
            "tradeOfferId": "3810109329"
        }]
    }
}

GET /v1/user/tradeoffers

This call returns all active Steam trade offers.

If the state of the Steam trade does not change within 5 minutes after we have sent it to you, the trade will be cancelled and any items will be returned back to your on-site inventory.

Output

Parameter Type Note
items array-object
   tradeId string Internal trade ID connected to this Steam trade offer.
   username string Username of the bot sending you the Steam trade offer.
   tradeOfferId string Steam Trade Offer ID. Use this to verify the trade on Steam.

Example request

curl --request POST \
  --header 'Authorization: ad4625ae-8c9e-4c3b-8854-b4b649a0182d' \
  --header "Content-type: application/json" -d '{"tradeLink": "https://steamcommunity.com/tradeoffer/new/?partner=123456789&token=msFvL_dX"}' \
  --url 'https://market-api.swap.gg/v1/user/tradelink'

Example response

{
    "status": "OK"
}

POST /v1/user/tradelink

This call will update your Steam trade link used to send trade offers. The owner of the Steam trade link has to be the same as the Steam account used to login on swap.gg.

Output

Parameter Type Note
tradeLink string Steam Trade Link.

Pricing

Get Lowest List Prices

Example request

curl --request GET \
  --url 'https://market-api.swap.gg/v1/pricing/lowest?appId=730'

Example response

{
    "status": "OK",
    "result": {
        "StatTrak™ AK-47 | Redline (Field-Tested)": {
            "price": 2200,
            "quantity": 1,
            "link": "https://market.swap.gg/item/csgo/stat-trak-ak-47-redline-field-tested"
        },
        "Nova | Polar Mesh (Battle-Scarred)": {
            "price": 2,
            "quantity": 1,
            "link": "https://market.swap.gg/item/csgo/nova-polar-mesh-battle-scarred"
        },
        "AWP | Neo - Noir(Field - Tested)": {
            "price": 3424,
            "quantity": 1,
            "link": "https://market.swap.gg/item/csgo/awp-neo-noir-field-tested"
        }
    }
}

GET /v1/pricing/lowest

This call will return a list of items with their lowest price on market.swap.gg. This request is cached for 1 minute.

Query Parameters

Name Description
appId Steam App ID.

Output

Parameter Type Note
{marketName} object Price data for this specific item name.
   price string Lowest price.
   quantity string Total item quantity.
   link string Direct link to the lowest listing.

Buy Orders

Create Buy Orders

Example request

curl --request POST \
  --url https://market-api.swap.gg/v1/buyorders \
  --header 'Authorization: ad4625ae-8c9e-4c3b-8854-b4b649a0182d' \
  --header "Content-type: application/json" -d '{"items":[{"appId":"730","marketName":"AK-47 | Bloodsport (Field-Tested)","price":2142,"quantity":1}]}' \

Example response

{
    "status": "OK",
    "result": {
        "orderIds": ["eLcKoReNk"]
    }
}

POST /v1/buyorders

This call will create buy orders for multiple items. Buy orders are executed immediately if an eligible item becomes available given your buy order price. Funds are not reserved to fulfill pending buy orders but will automatically be cancelled if your account has insufficient funds to execute a buy order.

Body Parameters

Parameter Type Note
items array-object
   appId string App ID.
   marketName string Item name.
   quantity string Number of buy orders to create at this price.
   price string The price at which you want to purchase.

Output

Parameter Type Note
orderIds array-string List of orderId's that have been created.

Get My Active Buy Orders

Example request

curl --request GET \
  --url 'https://market-api.swap.gg/v1/buyorders' \
  --header 'Authorization: ad4625ae-8c9e-4c3b-8854-b4b649a0182d'

Example response

{
    "status": "OK",
    "result": [{
        "orderId": "Ou27uqbBA",
        "appId": "252490",
        "marketName": "Punishment Mask",
        "price": 45000,
        "totalCost": 0,
        "quantity": {
            "remaining": 1,
            "max": 1
        }
    }, {
        "orderId": "MU240XPz4",
        "appId": "252490",
        "marketName": "Big Grin",
        "price": 18000,
        "totalCost": 0,
        "quantity": {
            "remaining": 1,
            "max": 1
        }
    }]
}

GET /v1/buyorders

This call will return a list of your active buy orders.

Output

Parameter Type Note
* array-object -
   orderId string ID belonging to this buy order.
   appId string App ID.
   marketName string Item name.
   price string Price for each item.
   totalCost integer Amount already used to fulfill buy order.
   quantity object -
      remaining integer Remaining items until fulfilled.
      max integer Max quantity to purchase.

Cancel Buy Orders

Example request

curl --request DELETE \
  --url 'https://market-api.swap.gg/v1/buyorders' \
  --header 'Authorization: ad4625ae-8c9e-4c3b-8854-b4b649a0182d' \
  --header "Content-type: application/json" -d '{"orderIds": ["MU240XPz4"]}'

DELETE /v1/buyorders

This call will cancel your provided buy orders.

Body Parameters

Parameter Type Value
orderIds array-string ID's belonging to the buy order.

Cancel All Buy Orders

Example request

curl --request DELETE \
  --url 'https://market-api.swap.gg/v1/buyorders/all' \
  --header 'Authorization: ad4625ae-8c9e-4c3b-8854-b4b649a0182d'

DELETE /v1/buyorders/all

This call will cancel all your active buy orders. If you list your item for the maxPrice, it will be sold within 5 minutes (as long as the buy order is not cancelled within this time period).

Summarize Buy Orders

Example request

curl --request GET \
  --url 'https://market-api.swap.gg/v1/buyorders/summary?appId=730'

Example response

{
    "status": "OK",
    "result": {
        "Spectrum 2 Case": {
            "maxPrice": 5,
            "minPrice": 3,
            "quantity": 23
        }
    }
}

GET /v1/buyorders/summary

This call will return a summary of buy orders for a given appId. Results include your own buy orders, where applicable.

Query Parameters

Name Description
appId Steam App ID.

Output

Parameter Type Note
{marketName} object Price data for this specific item name.
   maxPrice integer Highest active buy order.
   minPrice integer Lowest active buy order.
   quantity integer Total quantity of active buy orders.

Inventory

Browse Inventory Items

Example request

curl --request POST \
  --header 'Authorization: ad4625ae-8c9e-4c3b-8854-b4b649a0182d' \
  --header "Content-type: application/json" -d '{"filters":{"status":2},"pagination":{limit: 25, "skip": 0}}' \
  --url 'https://market-api.swap.gg/v1/inventory/browse'

Example response

{
    "status": "OK",
    "result": [{
        "meta": {
            "RARITY": "Common",
            "TYPE": "Tool",
            "HERO": "Other"
        },
        "itemId": "8363c8fd-be2a-45ad-8736-6610a5491a98",
        "userId": "94353915-f7a2-4a9a-9e5f-ff1f7d9b1f98",
        "appId": "570",
        "contextId": "2",
        "marketName": "2014 Player Card Pack",
        "lock": "2019-11-22T17:49:56.888Z",
        "image": "-9a81dlWLwJ2UUGcVs_nsVtzdOEdtWwKGZZLQHTxDZ7I56KW1Zwwo4NUX4oFJZEHLbXT7Q1GK5gNqhpPSAOCF7X56N_fUkRxNwdWpL6aOwZj2L2aKTsQvti3koTYw_Sga-OFlG8G65cjiLvDoY2kjQPl-hY_Y2-nJIaRbEZgNh2wHvfK",
        "assetId": "17814627663",
        "commodity": false,
        "color": "D2D2D2",
        "status": 0,
        "groupId": "28110c7772dc8039e10d0a5709adc600cde6d1cd",
        "suggestedPrice": 25
    }],
    "pagination": {
        "more": false,
        "total": 2
    }
}

POST /v1/inventory/browse

This call returns all items that are currently in your inventory on your swap.gg account.

Body Parameters

Parameter Type Note
filters object Browse Filter Object.
pagination object Pagination Output Object.

Output

Parameter Type Note
* array-object Array containing Item Object.

Withdraw Item to Steam Inventory

Example request

curl -- request POST \
  --header 'Authorization: ad4625ae-8c9e-4c3b-8854-b4b649a0182d' \
  --header "Content-type: application/json" -d '{"items":[{"groupId":"204874c88b3e1e5104eb6e211bc640a348533b11","quantity":1}]}' 
  --url'https://market-api.swap.gg/v1/inventory/withdraw'

Example response

{
    "status": "OK",
    "result": {
        "tradeIds": ["eb0fd2b7-b41d-4452-95ac-1eab8fd9137c"],
        "itemIds": ["G288wsuCQD"]
    }
}

POST /inventory/withdraw

Allows you to withdraw an item from your on-site inventory to your Steam inventory.

Body Parameters

Parameter Type Value
items array-object
   groupId string Group ID of the item.
   quantity string Quantity.

Output

Parameter Type Note
tradeIds array-string List of tradeId's that will handle your withdraw request.
itemIds array-string List of itemId's that have been successfully added to the withdraw queue.

Cart

List Items from Cart

Example request

curl --request POST \
  --url 'https://market-api.swap.gg/v1/cart/list' \
  --header 'Authorization: ad4625ae-8c9e-4c3b-8854-b4b649a0182d' \
  --header "Content-type: application/json" -d '{"groupId": "12f89ae54c333916b620bf2e4544b1581481b4ff", "quantity": 1}'

Example response

{
    "status": "OK",
    "result": {
        "items": [{
            "meta": {
                "INSPECT_LINK": "steam://rungame/730/76561202255233023/+csgo_econ_action_preview%20S76561199003735772A18662269728D16592998548809995457",
                "TYPE": "Sniper Rifle",
                "WEAPON": "AWP",
                "COLLECTION": "The Arms Deal Collection",
                "RARITY": "Covert",
                "EXTERIOR": "Factory New",
                "NAME_TAG": "s e x y 420",
                "FLOAT": {
                    "o": 0.00658246,
                    "r": 0.08228074
                },
                "PAINT_INDEX": 51,
                "PAINT_SEED": 49
            },
            "itemId": "bWbyLwt8a2",
            "userId": "ipxDQRFsa",
            "appId": "730",
            "contextId": "2",
            "marketName": "AWP | Lightning Strike (Factory New)",
            "url": "awp-lightning-strike-factory-new",
            "lock": "2020-05-26T07:00:00.000Z",
            "image": "-9a81dlWLwJ2UUGcVs_nsVtzdOEdtWwKGZZLQHTxDZ7I56KU0Zwwo4NUX4oFJZEHLbXH5ApeO4YmlhxYQknCRvCo04DEVlxkKgpot621FAZt7P_BdjVW4tW4k7-KgOfLP7LWnn8fu5In27GYod2l21Gx-xU5MGDzddCRdw83Y1DW-VS3wu291JS76Z7PnWwj5Hc0AjJzVA",
            "assetId": "18662269728",
            "commodity": false,
            "color": "D2D2D2",
            "steamId": "76561199003735772",
            "status": 2,
            "groupId": "2a1a7fc0bda0ea8018edb0fde13108f8771d0b4d",
            "sale": {
                "saleId": "FXnBTaUF0S",
                "price": 11925,
                "date": "2020-05-19T06:36:45.982Z"
            },
            "steamPrice": 16449,
            "suggestedPrice": 11920
        }],
        "removedItems": 0
    }
}

GET /v1/cart/items

This call will return all items in your cart.

Every time you request this endpoint, we will check if all items are still available in your cart. removedItems > 0 means that items you had in your cart have been sold to another user or have been delisted.

Output

Parameter Type Note
items array-object Array containing Item Object
removedItems integer Amount of items that have been removed from your cart with this call.

Add Item to Cart

Example request

curl --request POST \
  --header 'Authorization: ad4625ae-8c9e-4c3b-8854-b4b649a0182d' \
  --header "Content-type: application/json" -d '{"appId": "440", "marketName": "Refined Metal", "quantity": 1}' \
  --url 'https://market-api.swap.gg/v1/cart/add'

Example response

{
    "status": "OK",
    "result": {
        "saleIds": ["BCNjc5HGT"]
    }
}

POST /v1/cart/add

This call will add items to your cart.

Body Parameters

Parameter Type Note
appId string App ID.
marketName string Item name.
quantity integer Quantity.
options object Add item to cart options.

Output

Parameter Type Note
saleIds array-string List of of saleId's that have been added to your cart.

Remove Item from Cart

Example request

curl --request POST \
  --header 'Authorization: ad4625ae-8c9e-4c3b-8854-b4b649a0182d' \
  --header "Content-type: application/json" -d '{"saleIds": ["BCNjc5HGT"]}' \
  --url 'https://market-api.swap.gg/v1/cart/remove'

Example response

{
    "status": "OK"
}

POST /v1/cart/remove

This call will remove items from your cart.

Body Parameters

Parameter Type Note
saleIds array-string List of saleId's you wish to remove.

Sales

Browse Items for Sale

Example request

curl --request POST \
  --header 'Authorization: ad4625ae-8c9e-4c3b-8854-b4b649a0182d' \
  --header "Content-type: application/json" -d '{"filters": {"appId": "730"}}' \
  --url 'https://market-api.swap.gg/v1/sales/browse'

Example response

{
    "status": "OK",
    "result": [{
        "meta": {
            "INSPECT_LINK": "steam://rungame/730/76561202255233023/+csgo_econ_action_preview%20S76561198975763539A17318220081D7270499338498393531",
            "TYPE": "Rifle",
            "WEAPON": "AK-47",
            "COLLECTION": "The Falchion Collection",
            "RARITY": "Covert",
            "EXTERIOR": "Factory New",
            "FLOAT": {
                "o": 0.0697576,
                "r": 0.0697576
            },
            "PAINT_SEED": 39
        },
        "itemId": "aa5f3ec1-4dab-4e81-bdd9-58f66ac687e6",
        "userId": "94353915-f7a2-4a9a-9e5f-ff1f7d9b1f98",
        "appId": "730",
        "contextId": "2",
        "marketName": "AK-47 | Aquamarine Revenge (Factory New)",
        "url": "ak-47-aquamarine-revenge-factory-new",
        "lock": "2019-12-14T10:00:00.000Z",
        "image": "-9a81dlWLwJ2UUGcVs_nsVtzdOEdtWwKGZZLQHTxDZ7I56KU0Zwwo4NUX4oFJZEHLbXH5ApeO4YmlhxYQknCRvCo04DEVlxkKgpot7HxfDhjxszJemkV09-5gZKKkPLLMrfFqWdY781lxLuW8Njw31Dn8xc_YTqmJ4DDJFM2ZwqE_ATtx-u7g8C5vpjOzHM263E8pSGKJ1XuG9M",
        "assetId": "17318220081",
        "commodity": false,
        "color": "D2D2D2",
        "status": 2,
        "groupId": "b57a2371367201ca9449568da58da87c6d5b5aec",
        "sale": {
            "saleId": "bylAJ3i4u",
            "price": 3122
        },
        "suggestedPrice": 4408,
        "stacked": false
    }, {
        "meta": {
            "INSPECT_LINK": "steam://rungame/730/76561202255233023/+csgo_econ_action_preview%20S76561198979683448A17309414184D2468234284752133895",
            "TYPE": "Knife",
            "WEAPON": "Huntsman Knife",
            "COLLECTION": "The Huntsman Collection",
            "RARITY": "Covert",
            "EXTERIOR": "Factory New",
            "FLOAT": {
                "o": 0.00848014,
                "r": 0.1060018
            },
            "PAINT_SEED": 636
        },
        "itemId": "e59321d9-f53e-4b4e-a31b-f1af036aa69c",
        "userId": "d020b2ad-f3d5-4a54-96cb-d166bd34052f",
        "appId": "730",
        "contextId": "2",
        "marketName": "★ Huntsman Knife | Doppler (Factory New)",
        "url": "huntsman-knife-doppler-factory-new",
        "lock": "2019-12-12T10:00:00.000Z",
        "image": "-9a81dlWLwJ2UUGcVs_nsVtzdOEdtWwKGZZLQHTxDZ7I56KU0Zwwo4NUX4oFJZEHLbXH5ApeO4YmlhxYQknCRvCo04DEVlxkKgpovbSsLQJfx_LLZTRB7dCJlY20k_jkI7fUhFRB4MRij7r--YXygED6qUVkNW_3IYCXdAc4ZwvZ8wTql-3vgcTq7cnOnXM1siUj537UnBblgQYMMLKO8np86Q",
        "assetId": "17309414184",
        "commodity": false,
        "color": "8650AC",
        "status": 2,
        "groupId": "5902ce17a4a21a4e9d2952573307f679addda37d",
        "sale": {
            "saleId": "pVtfAqZc",
            "price": 14000
        },
        "suggestedPrice": 19930,
        "stacked": false
    }],
    "pagination": {
        "more": false,
        "total": 2
    }
}

POST /v1/sales/browse

This call will return a list of items that are currently for sale.

Body Parameters

Parameter Type Note
filters object Browse Filter Object
pagination object Pagination Output Object

Output

Parameter Type Note
* array-object Array containing Item Object

Purchase Items

Example request

curl --request POST \
  --header "Content-type: application/json" -d '{"saleIds":["ANljqpTL"]]}' \
  --url 'https://market-api.swap.gg/v1/sales/purchase'

Example response

{
    "status": "OK",
    "result": {
        "saleIds": ["ANljqpTL"],
        "purchaseAmount": 3
    }
}

POST /v1/sales/purchase

This call will purchase items and place them in your swap.gg inventory.

Body Parameters

Parameter Type Note
saleIds array-string List of saleIds you would like to purchase.

Output

Parameter Type Note
saleIds array-string List of saleIds that have been successfully purchased.
purchaseAmount integer Total purchase amount. This amount has been deducted from your balance.

List Item for Sale

Example request

curl --request POST \
  --header 'Authorization: ad4625ae-8c9e-4c3b-8854-b4b649a0182d' \
  --header "Content-type: application/json" -d '{"items":["groupId": "6f20b835927fb466888d4100f256b10fc7cb60db", "quantity": 2, "price": 121]}' \
  --url 'https://market-api.swap.gg/v1/sales/list'

Example response

{
    "status": "OK",
    "result": {
        "items": [{
            "groupId": "6f20b835927fb466888d4100f256b10fc7cb60db",
            "quantity": 2,
            "price": 121
        }]
    }
}

POST /v1/sales/list

This call will list your items for sale.

Body Parameters

Parameter Type Note
items array-object
   groupId string Group ID of the item you would like to list for sale.
   quantity integer Quantity of items you would like to sell.
   price integer Price you would wish to sell your item for in EUR cents. This is the price that the buyer will have to pay.

Output

Parameter Type Note
items array-object
   groupId string Group ID of the item you would like to list for sale.
   quantity string Quantity that has been listed for sale.
   price string Price you have set, as confirmation.

Update Item Sale Price

Example request

curl --request PUT \
  --header 'Authorization: ad4625ae-8c9e-4c3b-8854-b4b649a0182d' \
  --header "Content-type: application/json" -d '{"items":["groupId": "6f20b835927fb466888d4100f256b10fc7cb60db", "quantity": 2, "price": 121]}' \
  --url 'https://market-api.swap.gg/v1/sales/list'

Example response

{
    "status": "OK",
    "result": {
        "items": [{
            "groupId": "6f20b835927fb466888d4100f256b10fc7cb60db",
            "quantity": 2,
            "price": 121
        }]
    }
}

PUT /v1/sales/list

This call will update the price of items which are already listed for sale.

Body Parameters

Parameter Type Note
items array-object
   groupId string Item Group ID you would like to list for sale.
   quantity integer Quantity of items you would like to sell.
   price integer Price you would wish to sell your item for in EUR cents. This is the price that the buyer will have to pay.

Output

Parameter Type Note
items array-object
   groupId string Group ID of the item.
   quantity string Quantity that has been listed for sale.
   price string Price you have set, as confirmation.

Delist Item

Example request

curl --request PUT \
  --header 'Authorization: ad4625ae-8c9e-4c3b-8854-b4b649a0182d' \
  --header "Content-type: application/json" -d '"items": [{"groupId": "6f20b835927fb466888d4100f256b10fc7cb60db", "quantity": 2}]' \
  --url 'https://market-api.swap.gg/v1/sales/delist'

Example response

{
    "status": "OK",
    "result": {
        "items": [{
            "groupId": "468364e25dc7a31e8ff842652762bc7dfb249bb0",
            "itemIds": ["C3DBW@zr"]
        }]
    }
}

POST /v1/sales/delist

This call will delist your items. These items will be returned back to your swap.gg inventory.

Body Parameters

Parameter Type Value
items array-object
   groupId string Group ID you would like to delist.
   quantity integer Quantity of items you would like to delist.

Output

Parameter Type Note
items
   groupId string Group ID that has been delisted.
   itemIds array-string Array of each item ID that has been delisted.

List Items from Steam inventory

Example request

curl --request POST \
  --header 'Authorization: ad4625ae-8c9e-4c3b-8854-b4b649a0182d' \
  --header "Content-type: application/json" -d '{"appId":"440","items":[{"assetId":"8025490053","price":128}]}' \
  --url 'https://market-api.swap.gg/v1/sell/create'

Example response

{
    "status": "OK"
}

POST /v1/sell/create

This call will send a Steam trade offer for the requested items. Once the trade offer has been accepted on Steam, it will be listed for the specified price on our market.

Body Parameters

Parameter Value
appId App ID.
items List of items you wish to list for sale.
   assetId string
   price integer

Payout

You can request payouts to the provided payment provider using our API. Please note that before you can automate any payouts, you have to manually create a single payout on your account page before implementing this in your application.

Request payout

Example request

curl --request POST \
  --url https://market-api.swap.gg/v1/payout \
  --header 'Authorization: ad4625ae-8c9e-4c3b-8854-b4b649a0182d' \
  --header "Content-type: application/json" -d '{"method":"SEPA","amount":1000}'

Example response

{
    "status": "OK",
    "result": {}
}

POST /v1/payout

This call will request a payout to the given payment provider.

Body Parameters

Parameter Type Value
method string Payment Provider. Possible values: STRIPE and PAYONEER.
amount integer Amount you wish to withdraw in EUR cents.

Screenshots

Our screenshot endpoint makes it possible to request in-game screenshots of CS:GO items.

Get Screenshots

Example request

curl --request GET \
  --url https://market-api.swap.gg/v1/screenshot \
  --header 'Authorization: ad4625ae-8c9e-4c3b-8854-b4b649a0182d'

Example response

{
    "status": "OK",
    "result": [{
        "marketName": "M4A4 | 龍王 (Dragon King) (Factory New)",
        "inspectLink": "steam://rungame/730/76561202255233023/+csgo_econ_action_preview S76561198192312418A2747453919D12431147341567346720",
        "state": "IN_QUEUE",
        "itemInfo": {}
    }]
}

GET /v1/screenshot

This call will return all your requested screenshots. Do not rely on this to find your screenshots, use your own database. This list will clear every time your session expires.

Output

Parameter Type Note
* array-object Array containing Screenshot Item Object

Create Screenshot

Example request

curl --request POST \
  --url https://market-api.swap.gg/v1/screenshot \
  --header 'Authorization: ad4625ae-8c9e-4c3b-8854-b4b649a0182d' \
  --header "Content-type: application/json" -d '{"inspectLink": "steam://rungame/730/76561202255233023/+csgo_econ_action_preview S76561198138412842A12187319128D16286958449143967340"}' \

Example response

{
    "status": "OK",
    "result": {
        "marketName": "M4A4 | 龍王 (Dragon King) (Factory New)",
        "inspectLink": "steam://rungame/730/76561202255233023/+csgo_econ_action_preview S76561198192312418A2747453919D12431147341567346720",
        "state": "IN_QUEUE",
        "itemInfo": {}
    }
}

POST /v1/screenshot

This call will add your request to the screenshot queue. If this inspect link has already been generated, it's state will be COMPLETED and the imageLink will be set.

You can also use the screenshot:ready websocket event to get notified once the screenshot is ready.

Body Parameters

Parameter Type Note
inspectLink string CS:GO inspect link.

Output

Parameter Type Note
* object Screenshot Item Object

Vouchers

Vouchers are codes that you can provide to your users.

Get Active Voucher Codes

Example request

curl --request GET \
  --header 'Authorization: ad4625ae-8c9e-4c3b-8854-b4b649a0182d' \
  --url https://market-api.swap.gg/v1/vouchers/codes

Example response

{
    "status": "OK",
    "result": {
        "total": 4,
        "items": [{
            "code": "D7HH-A447-VEFH-CB1K",
            "note": "-",
            "value": 50,
            "state": 0,
            "purchaseDate": "2019-11-28T23:13:05.926Z"
        }, {
            "code": "4F9R-HHSO-DQZ6-MDVZ",
            "note": "-",
            "value": 50,
            "state": 0,
            "purchaseDate": "2019-11-28T23:13:05.926Z"
        }, {
            "code": "IC0T-2L5S-0FDT-O07F",
            "note": "Giveaway",
            "value": 50,
            "state": 0,
            "purchaseDate": "2019-11-28T23:13:05.926Z"
        }, {
            "code": "6FL3-S31D-97RG-XHKN",
            "note": "-",
            "value": 50,
            "state": 0,
            "purchaseDate": "2019-11-28T23:13:05.926Z"
        }]
    }
}

POST /v1/vouchers/codes

This call returns all active codes that you have purchased and haven't been activated yet.

Body Parameters

Parameter Type Note
sort object Sort Object
pagination object Pagination Output Object

Output

Parameter Type Note
total integer Total amount of voucher codes.
items array-object
   code string Unique code that can be used to activate this voucher.
   note string Additional note.
   value integer Amount which will be added to the user who activates the code.
   purchaseDate date Purchase date of the voucher code.

Purchase Voucher Codes

Example request

curl --request POST \
  --header 'Authorization: ad4625ae-8c9e-4c3b-8854-b4b649a0182d' \
  --header "Content-type: application/json" -d '{"value":10,"quantity":1}' \
  --url https://market-api.swap.gg/v1/vouchers/purchase

Example response

{
    "status": "OK",
    "result": {
        "codes": ["TQHV-I386-C5I1-AVSS"]
    }
}

POST /v1/vouchers/purchase

This call will purchase voucher codes.

Body Parameters

Parameter Type Value
note string Additional note.
quantity string Quantity (max. 100 per request).
value string Value of individual voucher.

Output

Parameter Type Note
codes array-string List of codes.

WebSocket

Example connection

let io = require('socket.io-client');
let request = require('request-promise');

let socket = io('https://market-ws.swap.gg/');

socket.on('connect', () => {
    request({
        method: 'GET',
        url: '/v1/user/websocket',
        headers: {
            Authorization: 'ad4625ae-8c9e-4c3b-8854-b4b649a0182d'
        }
    }).then((response) => {
        let data = response.data;

        if (data.status === 'OK') {
            let result = data.result;

            socket.emit('auth', result.token);
            // From this point, you will start receiving account related notifications
        }
    });
});

Our WebSocket service makes it possible to instantly be notified about events on your account such as item sales etc.

You can connect using the socket.io client: https://market-ws.swap.gg/

Events

Name Description
item:state State of an item has changed (sold, delisted etc).
user:notification A notification has been sent to you.
user:ready A notification to let you know that something has changed on your account.
screenshot:ready A notification once the screenshot is ready. Contains inspectLink and imageLink.

Get WebSocket Token

Example request

curl --request GET \
  --url https://market-api.swap.gg/v1/user/websocket \
  --header 'Authorization: ad4625ae-8c9e-4c3b-8854-b4b649a0182d'

Example response

{
    "status": "OK",
    "result": {
        "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE1NzU2NTI1NDAsImRhdGEiOiI5NDM1MzkxNS1mN2EyLTRhOWEtOWU1Zi1mZjFmN2Q5YjFmOTgiLCJpYXQiOjE1NzU2NTI1MzV9.Ixib0l2jklFTo6wWEzVQO1vJMQE-ZTVyYm-wSMwbEt8"
    }
}

GET /v1/user/websocket

This call returns an authentication token which is required to authenticate with our WebSocket server. This JWT token expires after 10 minutes.

Output

Parameter Type Note
token string Token that should be provided to our WebSocket to authenticate yourself.

Schemas

Browse Filter Object

These values can be used to filter out items that are currently for sale.

{
    "appId": "730",
    "search": "AK-47",
    "sort": "DISCOUNT",
    "price_min": 500,
    "price_max": 1000,
    "wear_min": 0.06,
    "wear_max": 0.85,
    "lock_min": 1,
    "lock_max": 6,
    "weapon": "AK-47",
    "hero": "Bane",
    "slot": "Taunt",
    "unusual_effect": "Smoking",
    "exterior": ["Minimal Wear", "Field-Tested"],
    "quality": ["Strange", "Genuine"],
    "collection": "The Arms Deal 3 Collection",
    "origin": "2017 Invitational Crate",
    "rarity": ["Mil-Spec Grade", "High Grade"],
    "type": "Uncommon Helmet Skin",
    "category": "Armor",
    "misc": "Sticker",
    "misc_t": "StatTrak"
}

Global Properties

Name Type Description
appId string Steam App ID of the item. Defaults to 730.
userId string User ID of the owner of the items.
marketName string Exact market name match.
search string Fuzzy search on items, including stickers and other item metadata. This query supports optional operators.
sort string Possible values: EXPENSIVE_FIRST, DISCOUNT, CHEAPEST_FIRST, BEST_DEALS, LOWEST_WEAR, HIGHEST_WEAR, LOWEST_LOCK, HIGHEST_LOCK. Defaults to BEST_DEALS.
price_min integer Minimum sale price.
price_max integer Maximum sale price.
exterior array-string Array of allowed exteriors.
quality array-string Array of allowed qualities.
collection string Exact match of collection value.
origin string Exact match of origin value.
rarity array-string Array of allowed rarities.
type string Exact match of type value.
category string Exact match of category value.
misc array-string Array of meta options for the item to include.
misc_t array-string Array of meta options for the item to exclude.

Counter-Strike: Global-Offensive (App ID: 730)

Name Type Description
lock_min integer Minimum trade lock in days.
lock_max integer Maximum trade lock in days.
weapon string Weapon type. AK-47, M4A4 etc.
paint_seed integer Paint seed of the item.
wear_min integer Minimum wear/float value.
wear_min integer Maximum wear/float value.
sticker_1 string Fuzzy search sticker. Sticker position NOT respected.
sticker_2 string Fuzzy search sticker. Sticker position NOT respected.
sticker_3 string Fuzzy search sticker. Sticker position NOT respected.
sticker_4 string Fuzzy search sticker. Sticker position NOT respected.

DotA 2 (App ID: 570)

Name Type Description
hero string Exact match of hero name.
slot string Exact match of slot name.

Team Fortress 2 (App ID: 440)

Name Type Description
unusual_effect string Exact match of unusual effect.

Item Object

Every item has it's own unique details.

{
    "meta": {
        "INSPECT_LINK": "steam://rungame/730/76561202255233023/+csgo_econ_action_preview%20S76561198975763539A17318219952D16881222788342078519",
        "TYPE": "Knife",
        "WEAPON": "Karambit",
        "RARITY": "Covert",
        "EXTERIOR": "Factory New",
        "NAME_TAG": "swap.gg <3",
        "FLOAT": {
            "o": 0.06894432,
            "r": 0.861804
        },
        "PAINT_SEED": 808
    },
    "itemId": "e1853b5b-6f4c-48a7-8b60-b04131df477a",
    "userId": "94353915-f7a2-4a9a-9e5f-ff1f7d9b1f98",
    "groupId": "f97f3a71026baf57f6132da5b7024fd7aec9136a",
    "appId": "730",
    "contextId": "2",
    "marketName": "★ Karambit | Doppler (Factory New)",
    "url": "karambit-doppler-factory-new",
    "lock": "2019-12-14T10:00:00.000Z",
    "image": "-9a81dlWLwJ2UUGcVs_nsVtzdOEdtWwKGZZLQHTxDZ7I56KU0Zwwo4NUX4oFJZEHLbXH5ApeO4YmlhxYQknCRvCo04DEVlxkKgpovbSsLQJf2PLacDBA5ciJlY20k_jkI7fUhFRB4MRij7r--YXygED6-EtrNmihLYaXIQ83Nw6C-1C6k-zvgMO7up7NmHs2uykl43fYnUG3hQYMMLINmYZu2g",
    "assetId": "17318219952",
    "commodity": false,
    "color": "8650AC",
    "status": 2,
    "sale": {
        "saleId": "ovyMVUhU",
        "price": 28500
    },
    "suggestedPrice": 40464
}

Properties

Name Type Description
itemId string Unique ID of the item.
userId string User ID of the item owner.
groupId integer Hash that makes it possible to stack items.
appId string Steam App ID of the item.
contextId string Steam Context ID of the item.
marketName string Item name.
url string marketName as RFC 3986 compliant slug.
lock date Date item will get out of trade lock.
image string Image tag for Steam CDN.
assetId string Steam Asset ID of the item.
commodity string Steam commodity item.
color string Hex color of item.
status integer Item status value.
sale object Sale Object.
suggestedPrice integer Suggested price for the item.
meta object Metadata Item Object.

Sale Object

Information about the item sale.

{
    "saleId": "ovyMVUhU",
    "price": 28500
}

Properties

Name Type Description
saleId string Unique ID of the sale.
price integer Price of the item. This is the price the buyer has to pay in order to become owner of the item.

Metadata Item Object

Items from different games can contain different details about the uniqueness of an item.

{
    "INSPECT_LINK": "steam://rungame/730/76561202255233023/+csgo_econ_action_preview%20S76561198975763539A17318219952D16881222788342078519",
    "TYPE": "Knife",
    "WEAPON": "Karambit",
    "RARITY": "Covert",
    "EXTERIOR": "Factory New",
    "NAME_TAG": "swap.gg <3",
    "FLOAT": {
        "o": 0.06894432,
        "r": 0.861804
    },
    "PAINT_SEED": 808
}

Properties

Name Type Description
INSPECT_LINK string Steam Item Inspect Link.
TYPE string Item type.
EXTERIOR string Item exterior (Factory New, Minimal Wear etc.).
WEAPON string Weapon type name.
NAME_TAG string Value of the name tag applied to item.
FLOAT object o is the overall float. r is the relative float to the minimum and maximum possible float of the skin.
PAINT_SEED string Item paint seed.
SCREENSHOT string The item's screenshot ID. Image: https://s.swap.gg/{SCREENSHOT}.jpg.

Sort Object

Sort Object used to sort the results.

{
    "field": "price",
    "order": "desc"
}

Properties

Name Type Description
field string Field you wish to sort on.
order integer Possible values: asc, desc. Defaults to desc.

Screenshot Item Object

{
    "marketName": "M4A4 | 龍王 (Dragon King) (Factory New)",
    "inspectLink": "steam://rungame/730/76561202255233023/+csgo_econ_action_preview S76561198192312418A2747453919D12431147341567346720",
    "state": "IN_QUEUE",
    "itemInfo": {}
}

Properties

Name Type Description
marketName string Item name.
inspectLink string Inspect link you have provided to us.
imageLink string URL to generated image.
state string IN_QUEUE, COMPLETED or FAILED.
itemInfo string Information about item.