Skip to content

Instantly share code, notes, and snippets.

@PButcher
Last active December 27, 2018 03:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save PButcher/059b2edd04d7fa516965ac9bd799eae7 to your computer and use it in GitHub Desktop.
Save PButcher/059b2edd04d7fa516965ac9bd799eae7 to your computer and use it in GitHub Desktop.
[TC] Gaming API Schema - v2.0.0
{
"version": "2.0.0",
"apis": [
{
"name": "CityDriving Statistics API",
"description": "Access a wide range of CityDriving server and player statistics.",
"path": "/citydriving",
"api_wide_queries": [
{
"query": "key",
"description": "API Key",
"type": "string",
"required": true
},
{
"query": "prettyprint",
"description": "Output in human readable format",
"type": "boolean",
"required": false,
"default": 0
}
],
"apis": [
{
"name": "Live Statistics API",
"path": "/live",
"endpoints": [
{
"name": "Server Status API",
"description": "Gives details such as online status, track code, track name and the number of allowed and connected users.",
"path": "/status",
"methods": ["GET"],
"queries": [
{
"query": "server",
"description": "Server ID",
"type": "string",
"required": true,
"options": [
"all", "one", "two", "three", "events", "training"
]
}
]
}
]
},
{
"name": "User Profile API",
"path": "/profile",
"endpoints": [
{
"name": "User Profile API",
"description": "Access all of a user's profile details and statistics.",
"path": "/get",
"methods": ["GET"],
"queries": [
{
"query": "username",
"description": "A Live for Speed username",
"type": "string",
"required": true
},
{
"query": "id",
"description": "[TC] User ID",
"type": "number",
"required": true,
"alt_required": true
},
{
"query": "stats",
"description": "Additional statistics",
"type": "boolean",
"required": false,
"default": 0
},
{
"query": "cars",
"description": "Cars owned by a user",
"type": "boolean",
"required": false,
"default": 0
},
{
"query": "licenses",
"description": "Licenses held by a user",
"type": "boolean",
"required": false,
"default": 0
},
{
"query": "upgrades",
"description": "Upgrades installed on a user's cars",
"dependency": "cars",
"type": "boolean",
"required": false,
"default": 0
},
{
"query": "properties",
"description": "Additional items and properties owned by a user",
"type": "boolean",
"required": false,
"default": 0
}
]
},
{
"name": "InSim UI Options API",
"description": "Access a user's InSim UI options. Only options that have been changed from the default values are returned.",
"path": "/getopts",
"methods": ["GET"],
"queries": [
{
"query": "username",
"description": "A Live for Speed username",
"type": "string",
"required": true
},
{
"query": "id",
"description": "[TC] User ID",
"type": "number",
"required": true,
"alt_required": true
}
]
}
]
},
{
"name": "Statistics API",
"path": "/stats",
"api_wide_queries": [
{
"query": "rows",
"description": "Number of rows to fetch",
"type": "number",
"required": false,
"range": {
"min": 1,
"max": 1000
},
"default": 20
},
{
"query": "skip",
"description": "Number of rows to skip/offset",
"type": "number",
"range": {
"min": 1,
"max": 1000
},
"required": false,
"default": 20
}
],
"endpoints": [
{
"name": "Users Online",
"description": "Get basic details of all users who are currently online on a [TC] CityDriving server.",
"path": "/online",
"methods": ["GET"],
"queries": [
{
"query": "server",
"description": "Server ID",
"type": "string",
"required": false,
"options": [
"all", "one", "two", "three"
],
"default": "all"
}
]
},
{
"name": "Gumball",
"description": "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.",
"path": "/gumball",
"methods": ["GET"]
},
{
"name": "Top Distance",
"description": "The top distance API can return any range of the top 1000 users with the highest total driven distance.",
"path": "/distance",
"methods": ["GET"]
},
{
"name": "Top Money",
"description": "The top money API can return any range of the top 1000 users with the most money.",
"path": "/money",
"methods": ["GET"]
},
{
"name": "Top Wealth",
"description": "The top wealth API can return any range of the top 1000 users with the most money and assets (wealth).",
"path": "/wealth",
"methods": ["GET"]
},
{
"name": "Cop Experience",
"description": "The cop experience API can return any range of the top 1000 users with the highest cop experience.",
"path": "/cop_xp",
"methods": ["GET"]
},
{
"name": "Robber Experience",
"description": "The robber experience API can return any range of the top 1000 users with the highest robber experience.",
"path": "/robber_xp",
"methods": ["GET"]
},
{
"name": "Roleplay Points",
"description": "The roleplay points API can return any range of the top 1000 users with the highest number of roleplaying points (RP).",
"path": "/rp",
"methods": ["GET"]
},
{
"name": "Last Tickets",
"description": "The last tickets API can return any range of the latest 1000 issued fines.",
"path": "/last_tickets",
"methods": ["GET"]
},
{
"name": "Top Crashers",
"description": "The top crashers API can return any range of the top 1000 with the most heavy contacts.",
"path": "/last_tickets",
"methods": ["GET"]
},
{
"name": "Newest Players",
"description": "The newest players API can return any range of the newest 1000 players.",
"path": "/new_players",
"methods": ["GET"]
},
{
"name": "Badges & Licenses",
"description": "Get all users who have a certain badge/license.",
"path": "/badge",
"methods": ["GET"],
"queries": [
{
"query": "badge",
"description": "Badge/License ID",
"type": "string",
"required": true,
"options": [
"cop", "tow", "med", "race", "tc", "recruit", "tct", "csr", "6s", "rdsr", "so"
],
"default": "all"
}
]
},
{
"name": "[TC] CityDriving Members",
"description": "Get a list of [TC] CityDriving admins.",
"path": "/tcmembers",
"methods": ["GET"]
},
{
"name": "[TC] CityDriving Admins by Level",
"description": "Get a list of [TC] CityDriving admins by their admin level. ",
"path": "/admins",
"methods": ["GET"],
"queries": [
{
"query": "level",
"description": "[TC] Admin Level",
"type": "number",
"required": false,
"options": [
1, 2, 3, 4
],
"default": 1
}
]
},
{
"name": "[TC] Racing Members",
"description": "Get a list of [TC] Racing members.",
"path": "/tcrmembers",
"methods": ["GET"]
}
]
},
{
"name": "CityDriving Vehicle API",
"description": "Access all of a user's profile details and statistics.",
"path": "/carinfo",
"api_wide_queries": [
{
"query": "key",
"description": "API Key",
"type": "string",
"required": true
},
{
"query": "prettyprint",
"description": "Output in human readable format",
"type": "boolean",
"required": false,
"default": 0
}
],
"endpoints": [
{
"name": "Vehicle API",
"description": "Access all of a user's profile details and statistics.",
"path": "/",
"methods": ["GET"],
"queries": [
{
"query": "vin",
"description": "Vehicle ID Number",
"type": "string",
"required": true
},
{
"query": "preowners",
"description": "Get list of previous owners",
"type": "boolean",
"required": false,
"default": 0
},
{
"query": "upgrades",
"description": "Upgrades installed on this car",
"type": "boolean",
"required": false,
"default": 0
}
]
}
]
},
{
"name": "AutoMarket API",
"path": "/market",
"endpoints": [
{
"name": "Get Current Listings",
"description": "The AutoMarket API returns all available cars on the CityDriving AutoMarket or all available cars of a certain type.",
"path": "/getlist",
"methods": ["GET"],
"queries": [
{
"query": "type",
"description": "LFS Car Code",
"type": "string",
"required": true,
"options": [
"UF1", "XFG", "XRG", "XRT", "RB4", "FXO", "LX4", "LX6", "RAC", "FZ5", "UFR", "XFR", "MRT"
]
},
{
"query": "upgrades",
"description": "Upgrades installed on the cars",
"type": "boolean",
"required": false,
"default": 0
}
]
}
]
}
]
},
{
"name": "Public Server Status JSON API",
"description": "Publically acessible server statuses. This request indexes players by InSim PLID (inside the players object) and returns all currently connected clients. It is designed for use with local InSim applications.",
"path": "/json",
"endpoints": [
{
"name": "Server Status: CityDriving One",
"description": "Status for CityDriving One",
"path": "/server_one.json",
"methods": ["GET"]
},
{
"name": "Server Status: CityDriving Two",
"description": "Status for CityDriving Two",
"path": "/server_two.json",
"methods": ["GET"]
},
{
"name": "Server Status: CityDriving Three",
"description": "Status for CityDriving Three",
"path": "/server_three.json",
"methods": ["GET"]
},
{
"name": "Server Status: CityDriving Four",
"description": "Status for CityDriving Four",
"path": "/server_four.json",
"methods": ["GET"]
}
]
},
{
"name": "Discord Status API",
"description": "Access all users who are currently on the [TC] Gaming public Discord server.",
"path": "/discord_status",
"api_wide_queries": [
{
"query": "key",
"description": "API Key",
"type": "string",
"required": true
},
{
"query": "prettyprint",
"description": "Output in human readable format",
"type": "boolean",
"required": false,
"default": 0
}
],
"endpoints": [
{
"name": "Discord Status API",
"description": "Access all users who are currently on the [TC] Gaming public Discord server.",
"path": "/",
"methods": ["GET"]
}
]
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment