Getting Started
Quick start
Get started with SteamApis v2 by obtaining your API key and making your first API request.
Acquire your Steam ID and API key
To get started with SteamApis, sign in using your Steam account. Once signed in, go to your SteamApis Settings page to retrieve your SteamID64 and your API key. The API key is essential for accessing all API endpoints.
Authentication
In v2, your API key must be passed via the x-api-key request header. As a fallback, you can also pass it as a key query parameter.
index.js
const API_KEY = '1nqNbqP5JYQ9Lpw5nATfKumaxN0';
const response = await fetch('https://api.steamapis.com/v2/steam/users/76561198038526790', {
headers: {
'x-api-key': API_KEY
}
});
const data = await response.json();
console.log(data);
Response format
All v2 endpoints return responses in a standard envelope format:
Success response:
response.json
{
"success": true,
"response": {
// endpoint-specific data
}
}
Error response:
error.json
{
"success": false,
"error": {
"name": "BadRequestError",
"message": "NOT_FOUND",
"meta": null
}
}
HTTP status codes
All API responses are returned in JSON format. Check the HTTP status code to determine if your request was successful:
- 200 OK - the request was successful.
- 400 Bad Request - the request could not be understood or was missing required parameters.
- 401 Unauthorized - missing or invalid API key.
- 403 Forbidden - access denied. Your account may not have sufficient balance or permissions.
- 404 Not Found - the requested resource was not found.
- 429 Too Many Requests - rate limit exceeded.
- 500 Internal Server Error - something went wrong on our end.
Error codes
When a request fails, the error response includes a message field to help identify the issue:
| Message | HTTP Status | Description |
|---|---|---|
MISSING_API_KEY | 403 | No API key provided in the request header or query parameter |
INVALID_API_KEY | 403 | The provided API key is not valid |
ACCESS_DENIED | 403 | Your API key has been disabled |
INSUFFICIENT_BALANCE | 400 | Free tier limit reached or account has no balance |
NOT_FOUND | 400 | The requested resource was not found |
INVALID_PARAMS | 400 | Invalid or malformed parameters |
INTERNAL_ERROR | 500 | Something went wrong on our end |