API Documentation

Access CS2 server data programmatically with our comprehensive REST API. Get server lists, detailed information, filters, and location data.

Getting Started

The CS2Browser.net API provides access to comprehensive CS2 server data including:

  • Real-time server information and player counts
  • Advanced filtering by location, gamemode, ping, and more
  • Historical player count data and statistics
  • Geographical location data for ping calculations

Base URL

https://cs2browser.net

Advanced Search Features

Multi-tag Search

Use commas to require ALL terms:

surf,beginner

NOT Operator

Use ! to exclude servers:

surf,!combat

Regex Support

Full regex patterns supported:

^Community.*Server$

IP Filtering

Search by IP ranges:

192.168.0.1

API Endpoints

GET/api/location

Get client location information

Description

Returns the geographical location data based on the client's IP address. Used for calculating ping estimates and regional filtering.

Responses

200Location data retrieved successfully
{
  "lat": 40.7128,
  "lon": -74.006
}
403Method not allowed - only GET requests accepted
{
  "error": "Method not allowed"
}
GET/api/filters

Get available filter options

Description

Returns all available continents, countries, maps, and game versions that can be used for filtering servers. Each option includes the number of servers available.

Responses

200Filter options retrieved successfully
{
  "continents": {
    "eu": "Europe (1245)",
    "na": "North America (892)",
    "as": "Asia (654)"
  },
  "countries": {
    "us": {
      "name": "United States (456)",
      "continent": "na",
      "count": 456
    },
    "de": {
      "name": "Germany (234)",
      "continent": "eu",
      "count": 234
    }
  },
  "maps": {
    "de_dust2": "de_dust2 (123)",
    "de_mirage": "de_mirage (98)"
  },
  "versions": {
    "1.38.6.8": "1.38.6.8 (5432)",
    "1.38.6.7": "1.38.6.7 (234)"
  }
}
403Method not allowed
{
  "error": "Method not allowed"
}
GET/api/servers

Get server list with filtering and pagination

Description

Returns a paginated list of CS2 servers with comprehensive filtering options. Supports gamemode filtering, geographical filtering, ping filtering, player count filtering, and text search. The pages are having 50 items.

Parameters

page
querynumberOptional

Page number for pagination (0-based)

Example: 0
gamemode
querystringOptional

Filter by specific gamemode slug. Available slugs: zombie-escape, surf, bunnyhop, kz, deathmatch, retake, public, awp, aim, jailbreak, zombiemod, pistol-retake, arena, prophunt, scoutzknivez, ttt, minigames, 1v1, gungame, 5v5, combat-surf, hns, only-knife, deathrun, football, warcraft, maniac, duels, fight-yard, execute

Example: surf
server_name
querystringOptional

Search in server name, tags, or IP. Supports regex, comma-separated AND search, and NOT operator (!)

Example: surf,!combat
show_continents
querystringOptional

Comma-separated list of continents to include

Example: eu,na
hide_continents
querystringOptional

Comma-separated list of continents to exclude

Example: as,af
show_countries
querystringOptional

Comma-separated list of country codes to include

Example: us,de,gb
hide_countries
querystringOptional

Comma-separated list of country codes to exclude

Example: cn,ru
show_maps
querystringOptional

Comma-separated list of map names to include

Example: de_dust2,de_mirage
hide_maps
querystringOptional

Comma-separated list of map names to exclude

Example: de_aztec
show_versions
querystringOptional

Comma-separated list of game versions to include

Example: 1.38.6.8,1.38.6.7
hide_versions
querystringOptional

Comma-separated list of game versions to exclude

Example: 1.38.6.5
show_pings
querystringOptional

Comma-separated list of ping thresholds to include (≤ value)

Example: 50,100
hide_pings
querystringOptional

Comma-separated list of ping thresholds to exclude (> value)

Example: 150
hide_empty_servers
querybooleanOptional

Hide servers with 0 players

Example: 1
show_full_servers
querybooleanOptional

Include servers at max capacity

Example: 1
servers
querystringOptional

Comma-separated list of specific server IDs to retrieve

Example: 123,456,789
player_sort
querystringOptional

Sort by player count

Example: desc
ping_sort
querystringOptional

Sort by ping

Example: asc

Responses

200Server list retrieved successfully
{
  "servers": [
    {
      "server_id": 123,
      "hostname": "Example Surf Server",
      "address": "192.168.1.1:27015",
      "map": "surf_mesa",
      "players_count": 24,
      "max_players": 32,
      "bots_count": 0,
      "secure": true,
      "version": "1.38.6.8",
      "tags": "surf,beginner",
      "country": "us",
      "lat": 40.7128,
      "lon": -74.006,
      "real_players": 24
    }
  ],
  "total_count": 1542
}
403Method not allowed
{
  "error": "Method not allowed"
}
GET/api/server

Get detailed server information

Description

Returns detailed information about a specific server including current players and player count history.

Parameters

server_id
querynumberRequired

Unique server identifier

Example: 123
mode
querystringOptional

Histogram time range: 1 (24h), 2 (7d), 3 (30d)

Example: 1

Responses

200Server details retrieved successfully
{
  "server_info": {
    "server_id": 123,
    "hostname": "Example Surf Server",
    "address": "192.168.1.1:27015",
    "map": "surf_mesa",
    "players_count": 24,
    "max_players": 32,
    "bots_count": 0,
    "secure": true,
    "version": "1.38.6.8",
    "tags": "surf,beginner",
    "country": "us",
    "lat": 40.7128,
    "lon": -74.006
  },
  "players": [
    {
      "Name": "PlayerName",
      "Score": 1500,
      "Duration": 3600
    }
  ],
  "player_histogram": {
    "2024-01-01 10:00:00": 15,
    "2024-01-01 11:00:00": 20,
    "2024-01-01 12:00:00": 24
  }
}
403Method not allowed
{
  "error": "Method not allowed"
}

Need Help?

Have questions about the API? Contact us for support.