CLI for the CS2Cap API — query CS2 skin prices, bids, sales, and item data across 40+ marketplaces from your terminal.
cs2cap prices list --name "AK-47 | Redline FT"
cs2cap items search --q "Bayonet" --type weapon --output json
cs2cap providers- Prices — lowest ask listings across all marketplaces
- Bids — highest buy orders
- Sales — recent sales history per item
- Items — search/filter the CS2 item catalog
- Providers — list all supported marketplace providers
- Batch lookups — query multiple items at once by ID or name
- Wear shortcuts —
FT,MW,FN,WW,BSauto-expand in item names - Multiple output formats — table (default) or JSON
- Config file — persist your API key in
~/.cs2cap.yaml - Environment variable overrides —
CS2CAP_API_KEY,CS2CAP_BASE_URL,CS2CAP_OUTPUT - Onboarding — first-run setup guide when no API key is configured
- Go 1.21+ (to build from source)
- A CS2Cap API key (
sk_live_...) — sign up at cs2cap.com
go install github.com/cs2cap/cli/cmd/cs2cap@latestThis produces a cs2cap binary in your $GOPATH/bin or $HOME/go/bin.
git clone https://github.com/cs2cap/cli.git
cd cli
make build
./cs2cap --helpThe first time you run a command without an API key, cs2cap shows an onboarding guide:
cs2cap prices list
# → Welcome to CS2Cap CLI — guides you through setupOnce you have a key:
# Set your API key (or use cs2cap config init)
export CS2CAP_API_KEY=sk_live_your_key_here
# List prices for an item (wear shortcut auto-expands)
cs2cap prices list --name "AK-47 | Redline FT"
# Search for items
cs2cap items search --q "Bayonet" --limit 5
# Get item details
cs2cap items get 42
# List all providers
cs2cap providerscs2cap resolves settings in this order (last wins):
- CLI flags
- Environment variables
- Config file (
~/.cs2cap.yaml) - Built-in defaults
# Interactive setup (writes ~/.cs2cap.yaml)
cs2cap config init
# View current config (key masked)
cs2cap config showExample ~/.cs2cap.yaml:
api_key: sk_live_your_key_here
base_url: https://api.cs2c.app
output: table| Variable | Description | Default |
|---|---|---|
CS2CAP_API_KEY |
API key | — |
CS2CAP_BASE_URL |
API base URL | https://api.cs2c.app |
CS2CAP_OUTPUT |
Output format | table |
| Flag | Short | Description |
|---|---|---|
--api-key |
-k |
API key (overrides config & env) |
--base-url |
API base URL | |
--output |
-o |
Output format: table or json |
--help |
-h |
Help for any command |
Wear abbreviations in --name and --names flags auto-expand:
| Shortcut | Expanded |
|---|---|
FN |
Factory New |
MW |
Minimal Wear |
FT |
Field-Tested |
WW |
Well-Worn |
BS |
Battle-Scarred |
Both FT and (FT) work — both expand to (Field-Tested).
Query current lowest ask prices across marketplaces.
Usage: cs2cap prices list [name] [flags]
API: GET /v1/prices
| Flag | Type | Default | Description |
|---|---|---|---|
--name |
string |
"" |
Exact market hash name (or pass as first arg) |
--item-id |
int |
0 |
Filter by item ID |
--phase |
string |
"" |
Filter by Doppler phase (ruby, sapphire, emerald, black_pearl) |
--providers |
[]string |
nil |
Filter by provider keys (repeat flag: --providers steam --providers buff163) |
--currency |
string |
"USD" |
Quote currency code |
--limit |
int |
20 |
Maximum results |
--offset |
int |
0 |
Result offset for pagination |
Examples:
cs2cap prices list "AK-47 | Redline FT"
cs2cap prices list --item-id 1234 --providers steam --providers buff163
cs2cap prices list "★ Bayonet | Doppler" --phase ruby --currency EUR
cs2cap prices list --output jsonBatch price lookup for multiple items at once.
Usage: cs2cap prices batch [flags]
API: POST /v1/prices/batch
| Flag | Type | Default | Description |
|---|---|---|---|
--items |
[]int |
nil |
Comma-separated item IDs (--items 1,2,3) |
--names |
[]string |
nil |
Comma-separated market hash names (`--names "AK-47 |
Examples:
cs2cap prices batch --items 1,2,3
cs2cap prices batch --names "AK-47 | Redline FT","★ Bayonet | Doppler"Query current highest buy orders across marketplaces.
Usage: cs2cap bids list [name] [flags]
API: GET /v1/bids
| Flag | Type | Default | Description |
|---|---|---|---|
--name |
string |
"" |
Exact market hash name (or pass as first arg) |
--item-id |
int |
0 |
Filter by item ID |
--phase |
string |
"" |
Filter by Doppler phase |
--providers |
[]string |
nil |
Filter by provider keys (repeat flag) |
--currency |
string |
"USD" |
Quote currency code |
--limit |
int |
20 |
Maximum results |
--offset |
int |
0 |
Result offset for pagination |
Examples:
cs2cap bids list "AK-47 | Redline FT"
cs2cap bids list --item-id 1234 --providers steam --providers buff163Batch bid lookup for multiple items at once.
Usage: cs2cap bids batch [flags]
API: POST /v1/bids/batch
| Flag | Type | Default | Description |
|---|---|---|---|
--items |
[]int |
nil |
Comma-separated item IDs (--items 1,2,3) |
--names |
[]string |
nil |
Comma-separated market hash names |
Examples:
cs2cap bids batch --items 1,2,3
cs2cap bids batch --names "AK-47 | Redline FT","★ Bayonet | Doppler"Query recent sales history for an item.
Usage: cs2cap sales list [name] [flags]
API: GET /v1/sales
| Flag | Type | Default | Description |
|---|---|---|---|
--name |
string |
"" |
Exact market hash name (or pass as first arg) |
--item-id |
int |
0 |
Filter by item ID |
--providers |
[]string |
nil |
Filter by sales-capable provider keys (repeat flag) |
--limit |
int |
20 |
Maximum results (capped at 50) |
Examples:
cs2cap sales list "AK-47 | Redline FT"
cs2cap sales list --item-id 1234 --providers steam --limit 10Search or filter the CS2 item catalog.
Usage: cs2cap items search [query] [flags]
API: GET /v1/items
| Flag | Type | Default | Description |
|---|---|---|---|
--q |
string |
"" |
Search query |
--type |
string |
"" |
Filter by item type (weapon, glove, sticker, collectible, agent, key, tool, music_kit, patch, graffiti, name_tag) |
--rarity |
string |
"" |
Filter by rarity name |
--weapon-type |
string |
"" |
Filter by weapon type |
--category |
string |
"" |
Filter by category |
--limit |
int |
20 |
Maximum results |
--offset |
int |
0 |
Result offset for pagination |
Examples:
cs2cap items search "AK-47"
cs2cap items search --type weapon --rarity "Covert"
cs2cap items search --type sticker --limit 50Get detailed information for a single item by ID.
Usage: cs2cap items get <item-id>
API: GET /v1/items/{id}
Returns all available fields including phase, wear range, float values, StatTrak/Souvenir flags, collection, and supply data.
Example:
cs2cap items get 42List all supported marketplace providers and their status.
Usage: cs2cap providers
API: GET /v1/providers
No command-specific flags. Shows each provider's key, code, market type, default currency, supported features (bids, sales), and health status.
Examples:
cs2cap providers
cs2cap providers --output jsonInteractive setup for ~/.cs2cap.yaml. Prompts for your API key and saves the configuration file.
Usage: cs2cap config init
Prompts for confirmation before overwriting an existing config file.
Display the currently active configuration with the API key masked.
Usage: cs2cap config show
Shows config file path, masked API key, base URL, and output format.
Aligned columns with tab-separated values, rendered to the terminal.
Machine-readable output:
cs2cap prices list --name "AK-47 | Redline FT" --output jsonAll prices from the CS2Cap API are returned in minor units (cents). cs2cap automatically divides by 100 for display:
$1,234.56
make build # produces ./cs2cap
make lint # run go vet
make test # run tests
make clean # remove binary
make tidy # clean go.mod dependenciescs2cap has minimal dependencies:
| Package | Purpose |
|---|---|
| spf13/cobra | CLI framework |
| spf13/viper | Configuration management |
| go-yaml/yaml.v3 | YAML config file parsing |
| Go standard library | HTTP client, tabular output (text/tabwriter), JSON encoding |
Full CS2Cap API documentation is available at https://docs.cs2cap.com.
MIT