Users API Reference
Access and manage FACEIT user data through these endpoints.
Base URL
https://open.faceit.com/data/v4
Authentication
All API requests must include your API key in the Authorization header:
Authorization: Bearer your-api-key
Endpoints
GET
/players/{player_id}
Get detailed information about a specific player.
Parameters
Name | Type | Required | Description |
---|---|---|---|
player_id | string | Yes | The ID of the player |
Example Request
curl -H "Authorization: Bearer your-api-key" \
https://open.faceit.com/data/v4/players/player-id-here
Example Response
{
"player_id": "example-id",
"nickname": "PlayerOne",
"avatar": "https://assets.faceit.com/avatar.jpg",
"country": "US",
"games": [
"cs2",
"dota2"
],
"game_skill_levels": {
"cs2": 10,
"dota2": 8
},
"settings": {
"language": "en"
},
"stats": {
"matches_played": 1500,
"win_rate": 55.5
}
}
GET
/players
Search for players based on various criteria.
Query Parameters
Name | Type | Required | Description |
---|---|---|---|
nickname | string | No | Search by player nickname |
game | string | No | Filter by game (e.g., cs2) |
country | string | No | Filter by country code (ISO 3166-1) |
Example Request
curl -H "Authorization: Bearer your-api-key" \
"https://open.faceit.com/data/v4/players?nickname=playerone&game=cs2&country=US"
Example Response
{
"items": [
{
"player_id": "player-1",
"nickname": "PlayerOne",
"country": "US",
"games": [
"cs2"
],
"skill_level": 10
},
{
"player_id": "player-2",
"nickname": "PlayerOneTwo",
"country": "US",
"games": [
"cs2"
],
"skill_level": 8
}
],
"start": 0,
"end": 2,
"total_count": 2
}
Node.js Example
Here's how to use the Users API with our Node.js client:
const FaceitAPI = require('faceit-api-client');
async function getPlayerInfo() {
const client = new FaceitAPI('your-api-key');
try {
// Get player details
const player = await client.players.getById('player-id');
console.log('Player details:', player);
// Search for players
const searchResults = await client.players.search({
nickname: 'playerone',
game: 'cs2'
});
console.log('Search results:', searchResults);
} catch (error) {
console.error('Error:', error);
}
}