Skip to content

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

NameRequired?Description
zYesYour username.
yYesYour web API key.
gYesThe target game ID.
fSet to 5 if you want ticket data for unofficial achievements.
dSet 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/ticketmanager.php?g=14402"
}
json
{
  "gameId": 14402,
  "gameTitle": "Dragster",
  "consoleName": "Atari 2600",
  "openTickets": 0,
  "url": "https://retroachievements.org/ticketmanager.php?g=14402"
}

Source

RepoURL
RAWebhttps://github.com/RetroAchievements/RAWeb/blob/master/public/API/API_GetTicketData.php
api-jshttps://github.com/RetroAchievements/api-js/blob/main/src/ticket/getTicketData.ts
api-kotlinhttps://github.com/RetroAchievements/api-kotlin/blob/main/src/main/kotlin/org/retroachivements/api/RetroInterface.kt

Released under the MIT license.