Documentation
Back to Docs

Getting Started

This guide will help you make your first API request in just a few minutes.

1. Create an Account

To use the CS2Cap API, you need to create an account and generate an API key. Sign up for a free account to get started.

2. Generate an API Key

Once logged in, navigate to your account settings and generate a new API key. Keep this key secure and never share it publicly.

Your API key will look like:

cs2cap_live_xxxxxxxxxxxxxxxxxxxx

3. Make Your First Request

Use your API key to authenticate requests. Include it in the Authorization header:

cURL
curl -X GET "https://api.cs2cap.com/v1/items" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json"

4. Handle the Response

The API returns JSON responses. Here's an example response from the items endpoint:

Response (200 OK)
{
  "data": [
    {
      "id": "ak47-redline-ft",
      "name": "AK-47 | Redline",
      "wear": "Field-Tested",
      "rarity": "Classified",
      "lowest_ask": 14.52,
      "highest_bid": 13.80,
      "volume_24h": 1247
    }
  ],
  "meta": {
    "total": 1543,
    "limit": 20,
    "offset": 0
  }
}

Response Structure

All API responses follow a consistent structure:

  • dataContains the requested resource(s)
  • metaContains pagination and metadata
  • errorContains error details (only on error responses)

Error Handling

When an error occurs, the API returns an appropriate HTTP status code and error message:

Response (401 Unauthorized)
{
  "error": {
    "code": "unauthorized",
    "message": "Invalid or missing API key"
  }
}