Skip to content

Get Achievement Ticket Stats

A call to API_GetTicketData in this manner will retrieve ticket stats for an achievement, targeted by that achievement's unique ID.

HTTP Request

GET

https://retroachievements.org/API/API_GetTicketData?a=9

Query Parameters

NameRequired?Description
yYesYour web API key.
aYesThe target achievement ID to fetch ticket stats for.

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 achievementTicketStats = await getTicketData(authorization, {
  achievementId: 12345,
});
kotlin
val credentials = RetroCredentials("<username>", "<web api key>")
val api: RetroInterface = RetroClient(credentials).api

val response: NetworkResponse<GetAchievementTicketStats.Response, ErrorResponse> = api.getAchievementTicketStats(
    achievementId = 12345
)

if (response is NetworkResponse.Success) {
    // handle the data
    val achievementTicketStats: GetAchievementTicketStats.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
{
  "AchievementID": 284759,
  "AchievementTitle": "The End of The Beginning",
  "AchievementDescription": "Receive the Package from the King of Baron and begin your quest to the Mist Cavern",
  "URL": "https://retroachievements.org/ticketmanager.php?a=284759",
  "OpenTickets": 1
}
json
{
  "achievementId": 284759,
  "achievementTitle": "The End of The Beginning",
  "achievementDescription": "Receive the Package from the King of Baron and begin your quest to the Mist Cavern",
  "url": "https://retroachievements.org/ticketmanager.php?a=284759",
  "openTickets": 1
}

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.