CNRV API
Ce contenu nâest pas encore disponible dans votre langue.

Introduction
The CNRV server provides two types of APIs:
- Official CnR V API - A web API for getting server status and player information
- FiveM Server API - Direct server endpoints for detailed server information
Official CnR V API
The official API provides server status and player information through web endpoints.
Server Status
Get All Servers Status
curl https://api.gtacnr.net/cnr/servers
Response:
[ { "Id": "EU2", "Players": 34, "MaxPlayers": 100, "QueuedPlayers": 0, "LastHeartbeatDateTime": "2025-03-24T17:05:12.1049978Z" }, { "Id": "US1", "Players": 91, "MaxPlayers": 100, "QueuedPlayers": 0, "LastHeartbeatDateTime": "2025-03-24T17:05:06.7868125Z" }, { "Id": "US2", "Players": 24, "MaxPlayers": 100, "QueuedPlayers": 0, "LastHeartbeatDateTime": "2025-03-24T17:05:09.8976388Z" }, { "Id": "EU1", "Players": 99, "MaxPlayers": 100, "QueuedPlayers": 0, "LastHeartbeatDateTime": "2025-03-24T17:05:06.5222571Z" }]
Example Usage
Get Total Players Across All Servers
curl https://api.gtacnr.net/cnr/servers | jq '[.[].Players] | add'
Response:
248
Find Least Populated Server
curl https://api.gtacnr.net/cnr/servers | jq 'min_by(.Players) | {Id, Players}'
Response:
{ "Id": "US2", "Players": 24}
Check Server Status
curl https://api.gtacnr.net/cnr/servers | jq '.[] | select(.Id == "EU1") | {Id, Players, MaxPlayers, IsFull: (.Players >= .MaxPlayers)}'
Response:
{ "Id": "EU1", "Players": 99, "MaxPlayers": 100, "IsFull": false}
Player Information
Get Players for a Specific Server
curl https://api.gtacnr.net/cnr/players?serverId=EU1
Response:
[ { "Uid": "072D51B8FA964658AE9BBCA0B7766FA9", "Username": { "Username": "[CBĆP] Baldy", "Timestamp": "2025-03-23T21:39:10.9279399+00:00" } }, { "Uid": "usr-9E7353VT1USbrY8wy-d-Mg", "Username": { "Username": "[CBĆP] KETTAMA", "Timestamp": "2025-03-24T14:55:53.7320299+00:00" } }]
Example Usage
Get Player Count for a Specific Server
curl https://api.gtacnr.net/cnr/players?serverId=EU1 | jq '. | length'
Response:
2
Find Players by Username Pattern
curl https://api.gtacnr.net/cnr/players?serverId=EU1 | jq '.[] | select(.Username.Username | contains("CBĆP")) | .Username.Username'
Response:
"[CBĆP] Baldy""[CBĆP] KETTAMA"
Get Most Recent Player Join
curl https://api.gtacnr.net/cnr/players?serverId=EU1 | jq 'max_by(.Username.Timestamp) | {Username: .Username.Username, JoinTime: .Username.Timestamp}'
Response:
{ "Username": "[CBĆP] KETTAMA", "JoinTime": "2025-03-24T14:55:53.7320299+00:00"}
FiveM Server API
The FiveM server also exposes direct endpoints that provide detailed server information:
https://eu.gtacnr.net:30121/info.json
- Server information and configurationhttps://eu.gtacnr.net:30121/players.json
- List of currently connected players
Server Information API
The /info.json
endpoint provides detailed information about the server configuration, including:
- Server version and build
- Server rules and configuration
- Available resources
- In-game time
- Server variables
Example Usage
Get Server Time
curl -v https://eu.gtacnr.net:30121/info.json -k | jq '.vars.Time'
Response:
"Friday 16:22"
Get Server Name
curl -v https://eu.gtacnr.net:30121/info.json -k | jq '.vars.sv_projectName'
Response:
"^4Cops and Robbers V EU #2 HARDCORE"
Get Server Description
curl -v https://eu.gtacnr.net:30121/info.json -k | jq '.vars.sv_projectDesc'
Response:
"Hardcore CnR V Gameplay â 20% Bonus Money â No Name Tags â No Radar Blips â Reduced Health and Armor â Longer Healing Times"
Players API
The /players.json
endpoint provides information about currently connected players, including:
- Player names (these are usernames configured in FiveM, not the CnR V character name)
- Player IDs
- Ping values
Example Usage
Get List of Connected Players
curl -v https://eu.gtacnr.net:30121/players.json -k | jq
Response:
[ { "endpoint": "127.0.0.1", "id": 130, "identifiers": [], "name": "xBytez", "ping": 42 }, { "endpoint": "127.0.0.1", "id": 128, "identifiers": [], "name": "Mihaaawk", "ping": 69 }]
Count Number of Players
curl -v https://eu.gtacnr.net:30121/players.json -k | jq '. | length'
Response:
2
Get Player Names Only
curl -v https://eu.gtacnr.net:30121/players.json -k | jq '.[].name'
Response:
"xBytez""Mihaaawk"