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
Name | Required? | Description |
---|---|---|
y | Yes | Your web API key. |
a | Yes | The 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
}