Your first request
Get your API key, request the sell-listing prices of one CS2 item, and confirm that the request succeeded.
In this tutorial, you get the sell-listing prices of one CS2 item. You need a terminal with curl. No SDK is required.
1. Copy your API key
- Sign in at cs.cheap and open the dashboard.
- In Settings, add a real email address if needed, and verify it using the email link.
- Open the overview or the API key section in Settings, reveal the key, and copy it. The first key is issued automatically for an eligible account.
- In Billing, check that you have credits or an active subscription.
Without an active subscription, a successful single-item request normally costs one credit. A wallet top-up alone does not buy credits. See Request costs.
2. Send the request
Run this command in Bash or a compatible shell on your computer or server. Replace replace-with-your-key with the key you copied. Keep the key out of browser code and public repositories.
export CSCHEAP_API_KEY='replace-with-your-key'
curl --get 'https://api.cs.cheap/prices' \
--header "Authorization: Bearer $CSCHEAP_API_KEY" \
--data-urlencode 'app_id=730' \
--data-urlencode 'market_hash_name=AK-47 | Redline (Field-Tested)' \
--data-urlencode 'side=ask' \
--write-out '\nHTTP %{http_code}\n'The command uses these values:
app_id=730selects CS2.market_hash_nameis the exact English item name, including its wear condition.side=askselects sell listings.- The base URL is
https://api.cs.cheap, with no/v1prefix.
3. Check the response
The request succeeded when the output ends with HTTP 200. curl adds that line. It is not part of the JSON.
The JSON contains two parts:
data.marketsis an array of quotes.meta.request_ididentifies your request.
Values and available markets depend on the data at request time.
Fix common failures
| What you see | What to do |
|---|---|
200 with an empty markets array | Remove the side filter and try again. The item may have no sell-listing quotes. |
401 | Copy the current key again. A newly issued key can take time to reach the API. |
402 | Check your credits and the current subscription period in Billing. |
404 | Check the exact item name and the game. This item has no price rows. |
422 | Check the parameter names and values against the command above. |
429 | Wait for the duration in the Retry-After response header. |
For other failures, see API errors. Keep meta.request_id when you ask for help. Never share your key.
Next steps
- Read your price result to find the amount and currency in each quote.
- Batch price queries to query several items.