Statistics API
The endpoint for the statistics API is: /citydriving/stats
API Index
We currently offer the following statistics APIs:
API
Documentation
Users Online
Gumball
Top Distance
Top Money
Top Wealth
Cop Experience
Robber Experience
Roleplay Points
Last Tickets
Top Crashers
Newest Players
Badges & Licenses
[TC] Training Team Members
[TC] CityDriving Members
[TC] CityDriving Admins by Level
[TC] Racing Members
[TC] Gaming Members
API-Wide Optional Parameters
All statistics API requests default to 20 rows of returned data. Certain applications may require more rows or a range of rows. For this reason all statistics API requests can utilise the rows
and skip
parameters. With these parameters, you can request any range of rows in the top 1000 total records.
Name
Expected Value
Default Value
rows
{integer} : Number of rows to request: 1-1000
20
skip
{integer} : Number of rows to skip/offset: 1-1000
-
prettyprint
{integer} : Use pretty print: 0 | 1
-
Examples
Request first 50 records: rows=50
Request records 60 to 80: skip=60
Request records 100 to 200: skip=100&rows=100
Users Online
The users online API gives you basic details of all users who are online on a [TC] CityDriving server.
ENDPOINT: /citydriving/stats/online
Mandatory Parameters
Name
Expected Value
key
{string} : API Key
server
{string}: one | two | three | all
Optional Parameters
See API-Wide Optional Parameters.
Example
REQUEST: ?key=YOUR_KEY&server=all
This request usually returns all connected users on a given CityDriving server. This example only shows one user for brevity. The default range is 20 users.
RESPONSE:
Gumball
The Gumball API gives you access to a separate table comprising entries into the current Gumball event. Records are ordered by a user's position in the overall Gumball standings. This API will return an empty array if the event is not currently running.
ENDPOINT: /citydriving/stats/gumball
Mandatory Parameters
Name
Expected Value
key
{string} : API Key
Optional Parameters
See API-Wide Optional Parameters.
Example
REQUEST: ?key=YOUR_KEY
This request returns all users currently entered into a Gumball event. This example only shows one user for brevity. The default range is 20 users.
RESPONSE:
Top Distance
The top distance API can return any range of the top 1000 users with the highest total driven distance. The default range is 20.
ENDPOINT: /citydriving/stats/distance
Mandatory Parameters
Name
Expected Value
key
{string} : API Key
Optional Parameters
See API-Wide Optional Parameters.
Example
REQUEST: ?key=YOUR_KEY
This request usually returns all connected users on all CityDriving servers. This example only shows one user for brevity.
RESPONSE:
Top Money
The top money API can return any range of the top 1000 users with the most money. The default range is 20.
ENDPOINT: /citydriving/stats/money
Mandatory Parameters
Name
Expected Value
key
{string} : API Key
Optional Parameters
See API-Wide Optional Parameters.
Example
REQUEST: ?key=YOUR_KEY
This example only shows one user for brevity.
RESPONSE:
Top Wealth
The top wealth API can return any range of the top 1000 users with the most money and assets (wealth). The default range is 20.
ENDPOINT: /citydriving/stats/wealth
Mandatory Parameters
Name
Expected Value
key
{string} : API Key
Optional Parameters
See API-Wide Optional Parameters.
Example
REQUEST: ?key=YOUR_KEY
This example only shows one user for brevity.
RESPONSE:
Cop Experience
The cop experience API can return any range of the top 1000 users with the highest cop experience. The default range is 20.
ENDPOINT: /citydriving/stats/cop_xp
Mandatory Parameters
Name
Expected Value
key
{string} : API Key
Optional Parameters
See API-Wide Optional Parameters.
Example
REQUEST: ?key=YOUR_KEY
This example only shows one user for brevity.
RESPONSE:
Robber Experience
The robber experience API can return any range of the top 1000 users with the highest robber experience. The default range is 20.
ENDPOINT: /citydriving/stats/robber_xp
Mandatory Parameters
Name
Expected Value
key
{string} : API Key
Optional Parameters
See API-Wide Optional Parameters.
Example
REQUEST: ?key=YOUR_KEY
This example only shows one user for brevity.
RESPONSE:
Roleplay Points
The roleplay points API can return any range of the top 1000 users with the highest number of roleplaying points (RP). The default range is 20.
ENDPOINT: /citydriving/stats/rp
Mandatory Parameters
Name
Expected Value
key
{string} : API Key
Optional Parameters
See API-Wide Optional Parameters.
Example
REQUEST: ?key=YOUR_KEY
This example only shows one user for brevity.
RESPONSE:
Last Tickets
The last tickets API can return any range of the latest 1000 issued fines. The default range is 20.
ENDPOINT: /citydriving/stats/last_tickets
Mandatory Parameters
Name
Expected Value
key
{string} : API Key
Optional Parameters
See API-Wide Optional Parameters.
Example
REQUEST: ?key=YOUR_KEY
This example only shows one ticket for brevity.
RESPONSE:
Top Crashers
The top crashers API can return any range of the top 1000 with the most 'heavy contacts'. The default range is 20.
ENDPOINT: /citydriving/stats/crashers
Mandatory Parameters
Name
Expected Value
key
{string} : API Key
Optional Parameters
See API-Wide Optional Parameters.
Example
REQUEST: ?key=YOUR_KEY
This example only shows one user for brevity.
RESPONSE:
Newest Players
The newest players API can return any range of the newest 1000 players. The default range is 20.
ENDPOINT: /citydriving/stats/new_players
Mandatory Parameters
Name
Expected Value
key
{string} : API Key
Optional Parameters
See API-Wide Optional Parameters.
Example
REQUEST: ?key=YOUR_KEY
This example only shows one user for brevity.
RESPONSE:
Badges & Licenses
Get all users who have a certain license. The default range is 20.
ENDPOINT: /citydriving/stats/badge
Mandatory Parameters
Name
Expected Value
key
{string} : API Key
badge
{string} : Badge Name (See list of values below)
Optional Parameters
See API-Wide Optional Parameters.
List of Badges & Licenses
These are the most common values for badge
.
Name
Value Code
COP
cop
TOW
tow
MED/RES
med
RACE
race
[TC] CityDriving Admin
tc
[TC] CityDriving Recruit
recruit
[TC] Trainer
tct
[CSR] Member
csr
6Speed Member
6s
[RDSR] Member
rdsr
SO Member
so
Example
REQUEST: ?key=YOUR_KEY&badge=cop
This example lists COP badges and only shows one user for brevity.
RESPONSE:
[TC] Training Team Members
Get a list of training team members. The default range is 20 so you may need to use a higher value for the rows
parameter.
ENDPOINT: /citydriving/stats/trainer_level
Mandatory Parameters
Name
Expected Value
key
{string} : API Key
Optional Parameters
See API-Wide Optional Parameters.
Trainer Levels
The levels key refers to a trainer's basic rank within the team:
Rank
Level
Leader
1
Trainer
2
Assistant
3
Civillian Assistant
4
Example
REQUEST: ?key=YOUR_KEY
This example only shows one user for brevity.
RESPONSE:
[TC] CityDriving Members
Get a list of [TC] CityDriving admins. The default range is 20 so you may need to use a higher value for the rows
parameter.
ENDPOINT: /citydriving/stats/tcmembers
Mandatory Parameters
Name
Expected Value
key
{string} : API Key
Optional Parameters
See API-Wide Optional Parameters.
Example
REQUEST: ?key=YOUR_KEY
This example only shows one user for brevity.
RESPONSE:
[TC] CityDriving Admins by Level
Get a list of [TC] CityDriving admins by their admin level. The default range is 20 so you may need to use a higher value for the rows
parameter.
ENDPOINT: /citydriving/stats/admins
Mandatory Parameters
Name
Expected Value
key
{string} : API Key
level
{string} : Admin Level (See list of values below)
Optional Parameters
See API-Wide Optional Parameters.
Admin Levels
The levels key refers to an admin's basic rank within the team. Use the following levels as values for the level
parameter:
Rank
Level
Leader/Server Control/Chief Constable/CCiT
1
Inspector/Supervisor
2
Constable
3
Constable in Probation
4
Example
REQUEST: ?key=YOUR_KEY
This example only shows one user for brevity.
RESPONSE:
[TC] Racing Members
Get a list of [TC] Racing members. The default range is 20 so you may need to use a higher value for the rows
parameter.
ENDPOINT: /citydriving/stats/tcrmembers
Mandatory Parameters
Name
Expected Value
key
{string} : API Key
Optional Parameters
See API-Wide Optional Parameters.
Admin Levels
The levels key refers to an admin's basic rank within the team.
Rank
Level
[TC] Team Leader/[TC] Racing Manager
1
[TC] Racing Driver
2
Example
REQUEST: ?key=YOUR_KEY
This example only shows one user for brevity.
RESPONSE:
[TC] Gaming Members
Get a list of [TC] Gaming members. Note that the returned list currently only includes members who have been explicitly given a [TC] Gaming admin level and not those who have inherited [TC] Gaming membership by being a full member of [TC] CityDriving or [TC] Racing. The default range is 20 so you may need to use a higher value for the rows
parameter.
ENDPOINT: /citydriving/stats/tcgmembers
Mandatory Parameters
Name
Expected Value
key
{string} : API Key
Optional Parameters
See API-Wide Optional Parameters.
Admin Levels
The levels key refers to an admin's basic rank within the team.
Rank
Level
[TC] Team Leader
1
[TC] Gaming Member
2
Example
REQUEST: ?key=YOUR_KEY
This example only shows one user for brevity.
RESPONSE:
Last updated
Was this helpful?