Guide to setup and use the API to get Steam Guard codes.
Steam Auth API allows you to:
All API endpoints require an API Key in the header.
Login and create your API Key:
Login / Register to Get API Key
Don't have an account? Sign up for free - takes only 1 minute!
Add the API Key to the X-API-Key header of every request:
X-API-Key: YOUR_API_KEY
curl -X GET "http://localhost:5179/api/token/code?token=ABC123" \
-H "X-API-Key: YOUR_API_KEY"
appsettings.json if neededGET /api/token/code?token=YOUR_TOKEN
Get Steam Guard authentication code using token.
GET /api/token/code?token=ABC123
X-API-Key: YOUR_API_KEY
{
"code": "87MYB",
"accountName": "username",
"usageRemaining": 99,
"expiresAt": "2025-10-20T05:14:18Z",
"timestamp": "2025-10-20T04:45:30Z"
}
POST /api/token/import
Import maFile into the system to create tokens.
POST /api/token/import
X-API-Key: YOUR_API_KEY
Content-Type: multipart/form-data
file: [FILE_DATA]
{
"accountId": "abc123",
"accountName": "username",
"ownerToken": "OWNERTOKEN123",
"encrypted": true,
"message": "Import successful!"
}
POST /api/token/create
Create token to get codes with usage limits.
POST /api/token/create
X-API-Key: YOUR_API_KEY
Content-Type: application/json
{
"accountId": "abc123",
"maxUsage": 100,
"expiryMinutes": 60
}
| Name | Type | Required | Description |
|---|---|---|---|
| accountId | string | Yes | Account ID from import |
| maxUsage | number | No | Maximum usage count (default: unlimited) |
| expiryMinutes | number | No | Expiration time in minutes (default: unlimited) |
{
"token": "XYZ789ABC123",
"accountName": "username",
"maxUsage": 100,
"expiresAt": "2025-10-20T06:00:00Z",
"createdAt": "2025-10-20T05:00:00Z"
}
Create a new maFile for Steam accounts without an authenticator.
POST /api/setup/login
Login to Steam to begin the setup process.
POST /api/setup/login
X-API-Key: YOUR_API_KEY
Content-Type: application/json
{
"username": "your_steam_username",
"password": "your_steam_password"
}
{
"sessionId": "abc123",
"status": "waiting",
"message": "Waiting for authentication...",
"requiresEmailCode": true
}
POST /api/setup/verify-email
Enter verification code from Steam email.
POST /api/setup/verify-email
X-API-Key: YOUR_API_KEY
Content-Type: application/json
{
"sessionId": "abc123",
"emailCode": "AB123"
}
POST /api/setup/add-authenticator
Start adding Steam Mobile Authenticator.
{
"status": "awaiting_sms",
"message": "Check EMAIL (subject: 'add an authenticator') for code",
"codeSource": "email_or_sms",
"revocationCode": "R12345"
}
POST /api/setup/finalize
Enter code from email/SMS to complete.
POST /api/setup/finalize
X-API-Key: YOUR_API_KEY
Content-Type: application/json
{
"sessionId": "abc123",
"smsCode": "GQP7D"
}
{
"status": "success",
"accountName": "username",
"revocationCode": "R12345",
"downloadToken": "xyz789",
"downloadUrl": "/api/setup/download?token=xyz789",
"expiresIn": "10 minutes"
}
GET /api/setup/download?token=DOWNLOAD_TOKEN
Download the newly created maFile (token expires in 10 minutes).
POST /api/token/importaccountId and ownerTokenaccountId from step 1POST /api/token/createGET /api/token/code?token=YOUR_TOKENconst API_BASE = 'http://localhost:5179';
const API_KEY = 'YOUR_API_KEY';
// Get code
async function getCode(token) {
const response = await fetch(
`${API_BASE}/api/token/code?token=${token}`,
{
headers: { 'X-API-Key': API_KEY }
}
);
const data = await response.json();
console.log('Code:', data.code);
return data.code;
}
// Usage
const code = await getCode('YOUR_TOKEN_HERE');
curl -X GET "http://localhost:5179/api/token/code?token=YOUR_TOKEN" \
-H "X-API-Key: YOUR_API_KEY"
import requests
API_BASE = 'http://localhost:5179'
API_KEY = 'YOUR_API_KEY'
def get_code(token):
response = requests.get(
f'{API_BASE}/api/token/code',
params={'token': token},
headers={'X-API-Key': API_KEY}
)
return response.json()['code']
# Usage
code = get_code('YOUR_TOKEN_HERE')
print(f'Code: {code}')
<?php
$apiBase = 'http://localhost:5179';
$apiKey = 'YOUR_API_KEY';
$token = 'YOUR_TOKEN_HERE';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "$apiBase/api/token/code?token=$token");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
"X-API-Key: $apiKey"
]);
$response = curl_exec($ch);
$data = json_decode($response, true);
$code = $data['code'];
echo "Code: $code";
?>
API Key is incorrect or missing X-API-Key header.
Solution: Check API Key in appsettings.json.
Token does not exist or has been deleted.
Solution: Create a new token.
Token has exhausted its maxUsage.
Solution: Create a new token with higher maxUsage.