FaB Counter API
Public read-only REST API powered by Firebase Realtime Database. Access live game data for streaming overlays, integrations, and custom tools.
Base URLhttps://fabcounterprod-default-rtdb.europe-west1.firebasedatabase.app
Overview
The FaB Counter API exposes your live game state as a simple read-only JSON feed.
Every user has a unique endpoint at
/users/{userId}.json that updates in real-time as
the FaB Counter app is used. No API key is required for read access — just fetch the URL.
Authentication
All endpoints listed here are publicly readable with no authentication required.
Your user ID is shown in the FaB Counter web app after you log in. Replace
test with
your own user ID in the endpoint URL to access your personal data.
Endpoints
GET
/users/{userId}.json
Fetch live game data for a user
►
Parameters
userId
path
Your unique user ID shown in the FaB Counter web app. Use
test to try the demo account.
Example Response
200
application/json
"data": {
"Image1": "enigma",
"Image2": "fai",
"P1": 40,
"P2": 40,
"Timer": 0
},
"webdata": {
"name1": "Name1",
"name2": "Name2",
"round": "2",
"stage": "Swiss",
"wins1": "1",
"wins2": "1"
},
"webhook": {
"end": 1754467459000,
"start": 1676552202000
}
GET
/users/heroes.json
Fetch hero name → image key mapping
►
Parameters
No parameters — returns the full hero mapping object.
Response Schema
Returns a JSON object where each key is a hero display name and the value is the
corresponding image key used in the
data.Image1 / data.Image2 fields
and in the asset URL /Assets/{key}.jpg.
Schemas
data
Live game state updated by the FaB Counter mobile app.
| Field | Type | Description | Example |
|---|---|---|---|
| Image1 | string | Image key for player 1's hero. Use with the asset URL pattern. | "enigma" |
| Image2 | string | Image key for player 2's hero. | "fai" |
| P1 | number | Current life total for player 1. Default is 40. | 40 |
| P2 | number | Current life total for player 2. Default is 40. | 40 |
| Timer | number | UTC epoch (seconds) marking the timer end time. 0 means no active timer. See Timer Calculation. |
1700000000 |
webdata
Tournament metadata set via the FaB Counter website.
| Field | Type | Description | Example |
|---|---|---|---|
| name1 | string | Display name for player 1. | "Name1" |
| name2 | string | Display name for player 2. | "Name2" |
| round | string | Current tournament round number. | "2" |
| stage | string | Tournament stage or format (e.g. Swiss, Top 8). | "Swiss" |
| wins1 | string | Number of wins for player 1 in the current match. | "1" |
| wins2 | string | Number of wins for player 2 in the current match. | "1" |
webhook
Subscription period for the user's access to the service.
| Field | Type | Description | Example |
|---|---|---|---|
| start | number | UTC epoch in milliseconds when the user's subscription began. | 1676552202000 |
| end | number | UTC epoch in milliseconds when the user's subscription expires. If the current time exceeds this value the user no longer has active access. | 1754467459000 |
Timer Calculation
The Timer field in
data holds a UTC epoch in seconds representing
when the round ends. It equals the round start time plus the chosen format duration (60 or 30 minutes).
To calculate the remaining time:
remainingSeconds = Timer − Math.floor(Date.now() / 1000)
// Timer === 0 → no active timer
// remainingSeconds < 0 → time has expired
Hero Assets
Hero portrait images are publicly available as JPEGs. Use the
Example: https://fabcounter.net/Assets/enigma.jpg
The full list of valid image keys is available in the heroes.json endpoint.
Image1 / Image2
key from the data object to build the URL:
https://fabcounter.net/Assets/{imageKey}.jpg
Example: https://fabcounter.net/Assets/enigma.jpg
The full list of valid image keys is available in the heroes.json endpoint.