Get Game Ticket Stats
A call to API_GetTicketData
in this manner will retrieve ticket stats for a game, targeted by that game's unique ID.
HTTP Request
GET
https://retroachievements.org/API/API_GetTicketData?g=1
Query Parameters
Name | Required? | Description |
---|---|---|
y | Yes | Your web API key. |
g | Yes | The target game ID. |
f | Set to 5 if you want ticket data for unofficial achievements. | |
d | Set to 1 if you want deep ticket metadata in the response's Tickets array. |
Client Library
ts
import { buildAuthorization, getTicketData } from "@retroachievements/api";
// First, build your authorization object.
const username = "<your username on RA>";
const webApiKey = "<your web API key>";
const authorization = buildAuthorization({ username, webApiKey });
// Then, make the API call.
const gameTicketStats = await getTicketData(authorization, { gameId: 1 });
kotlin
val credentials = RetroCredentials("<username>", "<web api key>")
val api: RetroInterface = RetroClient(credentials).api
val response: NetworkResponse<GetGameTicketStats.Response, ErrorResponse> = api.getGameTicketStats(
gameId = 14402
)
if (response is NetworkResponse.Success) {
// handle the data
val gameTicketStats: GetGameTicketStats.Response = response.body
} else if (response is NetworkResponse.Error) {
// if the server returns an error it be found here
val errorResponse: ErrorResponse? = response.body
// if the api (locally) had an internal error, it'll be found here
val internalError: Throwable? = response.error
}
Response
json
{
"GameID": 14402,
"GameTitle": "Dragster",
"ConsoleName": "Atari 2600",
"OpenTickets": 0,
"URL": "https://retroachievements.org/game/14402/tickets"
}
json
{
"gameId": 14402,
"gameTitle": "Dragster",
"consoleName": "Atari 2600",
"openTickets": 0,
"url": "https://retroachievements.org/game/14402/tickets"
}