Introduction
Welcome to the docs for the Steam Collector web API. These endpoints allow you to track and analyze the vast item store and economy features we’ve implemented in a machine readable way.
At the moment there’s no formal lib implementing this API but it’s simple enough that it should be readily usable with any client lib.
Changelog
- 2021-11-18
- Listing refactor and associated changes for
CreateListing
to allow passing assetid, and associated changes to expose lowdown data inGetListing
output. - Breaking change: The
name
arg is no longer accepted. Prefer eitherslug
orassetid
. - Lowdowns: Now exposed through API and listing ajax. Condensed metadata we use for inventory-level viewer stuff.
- Breaking change: The
slug
field in output that had it has been moved tolowdown.slug
- General consistency changes to make error output more stable. Still returning 400s and 500s when we should be returning 200s and error JSON. But this will be fixed as we add more methods / flesh things out.
- Listing refactor and associated changes for
- 2021-10-24
- Initial release
Key auth
All requests require an API key and arguments are passed to API methods consistent with their HTTP method. See examples to the side for more info.
If the method reads data (GET)
curl "https://steamcollector.com/api/interface/method?key=APIKEY"
If the method writes data (POST)
curl "https://steamcollector.com/api/interface/method"
-d key=APIKEY
Listings
Get All Listings
curl 'https://steamcollector.com/api/economy/listings?key=APIKEY&slug=440-the-cloak-and-dagger'
The above command returns JSON structured like this:
{
"chunk": 0,
"listings": [
{
"id": "1afaa1bbb10cc3a71e8b",
"lowdown": {
"wikiUrl": "http://wiki.teamfortress.com/scripts/itemredirect.php?id=60&lang=en_US",
"market_name": "The Cloak and Dagger",
"name": "The Cloak and Dagger",
"slug": "440-the-cloak-and-dagger",
"quality": "Unique",
"icon": "fWFc82js0fmoRAP-qOIPu5THSWqfSmTELLqcUywGkijVjZULUrsm1j-9xgEIUwsUXA_qvSp8n8nyDvqzBOESnN974JQBiWA_kgd4YbrjNW41c1aSUaEKDKFipVu-WSFj7JQzUIHup-wEeRKv6tVDBt05jw",
"name_color": "7D6D00"
},
"blurb": "devtest",
"price": {
"440-mann-co-supply-crate-key": 1,
"440-refined-metal": 2
},
"user_id": "76561198014028523",
"created_at": 1637326762,
"updated_at": 1637326957,
"user_name": "Lagg",
"trade_url": "https://steamcommunity.com/tradeoffer/new/?partner=53762795&token=iAhn3FIO"
}
]
}
Return all listings sorted by post date. Optionally filtering by various params.
HTTP Request
GET https://steamcollector.com/api/economy/listings?key=APIKEY
Query Parameters
Parameter | Default | Description |
---|---|---|
chunk | 0 | Which chunk to return. This is roughly equivalent to pages but 0-based and subject to change. |
user_id | null | If given, filters listings to those only posted by the given ID64. |
slug | null | If given, only return listings made for this item. |
Get Single Listing
curl 'https://steamcollector.com/api/economy/listing?id=1afaa1bbb10cc3a71e8b&key=APIKEY'
The above command returns JSON structured like this:
{
"id": "1afaa1bbb10cc3a71e8b",
"lowdown": {
"wikiUrl": "http://wiki.teamfortress.com/scripts/itemredirect.php?id=60&lang=en_US",
"market_name": "The Cloak and Dagger",
"name": "The Cloak and Dagger",
"slug": "440-the-cloak-and-dagger",
"quality": "Unique",
"icon": "fWFc82js0fmoRAP-qOIPu5THSWqfSmTELLqcUywGkijVjZULUrsm1j-9xgEIUwsUXA_qvSp8n8nyDvqzBOESnN974JQBiWA_kgd4YbrjNW41c1aSUaEKDKFipVu-WSFj7JQzUIHup-wEeRKv6tVDBt05jw",
"name_color": "7D6D00"
},
"blurb": "devtest3",
"price": {
"440-mann-co-supply-crate-key": 1,
"440-refined-metal": 2
},
"user_id": "76561198014028523",
"created_at": 1637329413,
"updated_at": 1637329413,
"user_name": "Lagg",
"trade_url": "https://steamcommunity.com/tradeoffer/new/?partner=53762795&token=iAhn3FIO"
}
Return a single listing with the given ID.
HTTP Request
GET https://steamcollector.com/api/economy/listing?id=ID&key=APIKEY
Query Parameters
Parameter | Default | Description |
---|---|---|
id | required | The listing ID to lookup. |
Create Listing
curl "https://steamcollector.com/api/economy/createlisting"
-d key=APIKEY
-d slug=440-the-cloak-and-dagger
-d blurb=devtest3
-d type=sell
-d price_ref=2
-d price_key=1
The above command returns JSON structured like this:
{
"id": "1afaa1bbb10cc3a71e8b",
"lowdown": {
"wikiUrl": "http://wiki.teamfortress.com/scripts/itemredirect.php?id=60&lang=en_US",
"market_name": "The Cloak and Dagger",
"name": "The Cloak and Dagger",
"slug": "440-the-cloak-and-dagger",
"quality": "Unique",
"icon": "fWFc82js0fmoRAP-qOIPu5THSWqfSmTELLqcUywGkijVjZULUrsm1j-9xgEIUwsUXA_qvSp8n8nyDvqzBOESnN974JQBiWA_kgd4YbrjNW41c1aSUaEKDKFipVu-WSFj7JQzUIHup-wEeRKv6tVDBt05jw",
"name_color": "7D6D00"
},
"blurb": "devtest3",
"price": {
"440-mann-co-supply-crate-key": 1,
"440-refined-metal": 2
},
"user_id": "76561198014028523",
"created_at": 1637326762,
"updated_at": 1637326762
}
Create new classified ad.
HTTP Request
POST https://steamcollector.com/api/economy/createlisting
Query Parameters
Parameter | Default | Description |
---|---|---|
slug | required if no assetid | Item to create listing for. This is the slug format we use internally. |
assetid | required if no slug | Asset ID to create listing for. This specific class instance will be used for the lowdown and the asset ID included. |
type | required | Kind of listing to create. Currently either buy or sell |
blurb | required | Message for the classified post |
price_ref | required if no USD | Asking price in refined |
price_key | required if no USD | Asking price in keys |
price_usd | required if no ref or key | Asking price in USD |
Update Listing
curl "https://steamcollector.com/api/economy/listing"
-d key=APIKEY
-d id=1afaa1bbb10cc3a71e8b
-d "blurb=I want about tree fiddy now"
-d price_usd=3.50
The above command returns JSON structured like this:
{
"id": "1afaa1bbb10cc3a71e8b",
"lowdown": {
"wikiUrl": "http://wiki.teamfortress.com/scripts/itemredirect.php?id=60&lang=en_US",
"market_name": "The Cloak and Dagger",
"name": "The Cloak and Dagger",
"slug": "440-the-cloak-and-dagger",
"quality": "Unique",
"icon": "fWFc82js0fmoRAP-qOIPu5THSWqfSmTELLqcUywGkijVjZULUrsm1j-9xgEIUwsUXA_qvSp8n8nyDvqzBOESnN974JQBiWA_kgd4YbrjNW41c1aSUaEKDKFipVu-WSFj7JQzUIHup-wEeRKv6tVDBt05jw",
"name_color": "7D6D00"
},
"blurb": "I want about tree fiddy now",
"price": {
"usd": 3.5
},
"user_id": "76561198014028523",
"created_at": 1637326762,
"updated_at": 1637327042
}
Edit existing listing.
HTTP Request
POST https://steamcollector.com/api/economy/listing
Query Parameters
Parameter | Default | Description |
---|---|---|
id | required | Listing to edit |
blurb | existing | Message for the classified post |
price_ref | existing | Asking price in refined |
price_key | existing | Asking price in keys |
price_usd | existing | Asking price in USD |
Currencies are still mutually exclusive, but using keys/ref to replace usd and vice-versa works as expected.
Delete Listing
curl "https://steamcollector.com/api/economy/deletelisting"
-d key=APIKEY
-d id=1afaa1bbb10cc3a71e8b
The above command returns JSON structured like this:
{
"deleted_id": "1afaa1bbb10cc3a71e8b"
}
Delete the given listing.
HTTP Request
POST https://steamcollector.com/api/economy/deletelisting
URL Parameters
Parameter | Description |
---|---|
id | Listing to delete |
Errors
Request Level
Request level errors are communicated using semantic HTTP codes.
HTTP Code | Meaning |
---|---|
400 | Bad Request – Invalid request, note that this is different from method-level validation errors. |
401 | Unauthorized – Invalid API key |
403 | Forbidden – Key has insufficient perms for this request |
404 | Not Found – API method not found |
429 | Too Many Requests – Rate limited |
500 | Internal Server Error – Internal error |
503 | Service Unavailable – Maintenance downtime |
Method Level
Method level errors - like a listing price value being invalid - are communicated via the standard error object like the one off to the side.
{
"error": "Argument validation error",
"errorCode": 2,
"errorData": {"price[usd]":"Need a price between 0.01 and 15000"}
}
This object describes the error along with a general/stable code for the category of the error if there is one available.
errorData
is an optional field for extended context info depending on API method.
Error Code | Meaning |
---|---|
0 | Success, if you see this there’s a bug somewhere. Please report it. |
1 | General error |
2 | Argument validation error. Arg(s) given didn’t pass sanity/constraint check. See errorData |