Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
13e2d32
chore: Change Version
official-wizard Feb 5, 2025
d97e94b
chore: Change Version
official-wizard Feb 5, 2025
838d48f
Merge remote-tracking branch 'origin/main'
official-wizard Feb 5, 2025
930602e
Merge remote-tracking branch 'origin/main'
official-wizard Feb 8, 2025
bc24438
chore: Change Version
official-wizard Feb 8, 2025
fd48eeb
Merge remote-tracking branch 'origin/main'
official-wizard Dec 20, 2025
8b57b41
feat: add richPresenceMsgDate
official-wizard Dec 20, 2025
2e655c4
feat: add GetGameProgression
official-wizard Dec 20, 2025
ee1601f
feat: add UserTotalPlaytime
official-wizard Dec 20, 2025
5802823
feat: add includeUserAward to getGameInfoAndUserProgress
official-wizard Dec 20, 2025
352e431
feat: add ReleasedAtGranularity
official-wizard Dec 20, 2025
dcc0df1
feat: add offset & count for API_GetGameList
official-wizard Dec 20, 2025
ec1509a
chore: format
official-wizard Dec 20, 2025
15773ed
chore: format
official-wizard Dec 20, 2025
3d41e68
feat: add GetUserSetRequests
official-wizard Dec 20, 2025
c7c04ec
feat: add GetUserSetRequests
official-wizard Dec 20, 2025
a87d9ba
feat: add GetUserGameLeaderboard
official-wizard Dec 20, 2025
5fcb10c
fix: getUserSetRequests response
official-wizard Dec 20, 2025
ed4c345
feat: add getUserSetRequests & getUserGameLeaderboards tests
official-wizard Dec 20, 2025
3cf760f
feat: add releasedAtGranularity
official-wizard Dec 20, 2025
aa7f2f9
feat: add sort to API_GetComments
official-wizard Dec 20, 2025
0d8c701
feat: add Author and AuthorULID
official-wizard Dec 20, 2025
3f198f0
feat: add trueRatio
official-wizard Dec 20, 2025
d228a91
chore: version change
official-wizard Dec 20, 2025
6bcdfb2
chore: change game id to Long
official-wizard Dec 20, 2025
4d42aaa
chore: undo, it's actually an array of game ids
official-wizard Dec 20, 2025
c01d851
chore: make userId optional for getUserGameLeaderboards
official-wizard Dec 20, 2025
102f0a3
docs: update version change
official-wizard Dec 20, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Then add this `api-kotlin` dependency to your `pom.xml` project!
<dependency>
<groupId>com.github.RetroAchievements</groupId>
<artifactId>api-kotlin</artifactId>
<version>1.0.18</version>
<version>1.1.0</version>
</dependency>
```

Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>org.retroachievements</groupId>
<artifactId>api-kotlin</artifactId>
<version>1.0.18</version>
<version>1.1.0</version>

<dependencyManagement>
<dependencies>
Expand Down
48 changes: 43 additions & 5 deletions src/main/kotlin/org/retroachivements/api/RetroInterface.kt
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,20 @@ interface RetroInterface {
@POST("/API/API_GetGameInfoAndUserProgress.php")
suspend fun getGameInfoAndUserProgress(
@Query("u") username: String,
@Query("g") gameId: Long
@Query("g") gameId: Long,
@Query("a") includeUserAward: Int = 0
): NetworkResponse<GetGameInfoAndUserProgress.Response, ErrorResponse>

/**
* A call to this endpoint will retrieve information about the average time to unlock achievements in a game, targeted via its unique ID.
*/
@Mock @MockResponse(body = "/v1/game/GetGameProgression.json")
@POST("/API/API_GetGameProgression.php")
suspend fun getGameProgression(
@Query("i") gameId: Long,
@Query("h") hardcore: Int = 0
): NetworkResponse<GetGameProgression.Response, ErrorResponse>

/**
* A call to this function will retrieve a giver user's completion progress, targeted by their username.
*/
Expand Down Expand Up @@ -205,6 +216,16 @@ interface RetroInterface {
@Query("c") count: Int = 100
): NetworkResponse<GetUsersFollowingMe.Response, ErrorResponse>

/**
* A call to this endpoint will retrieve a given user's set requests, maximum total requests and points until next request.
*/
@Mock @MockResponse(body = "/v1/user/GetUserSetRequests.json")
@POST("/API/API_GetUserSetRequests.php")
suspend fun getUserSetRequests(
@Query("u") userId: String,
@Query("t") all: Int = 0
): NetworkResponse<GetUserSetRequests.Response, ErrorResponse>

/**
* A call to this function will retrieve basic metadata about a game, targeted via its unique ID.
*/
Expand Down Expand Up @@ -291,6 +312,18 @@ interface RetroInterface {
@Query("c") count: Int = 100
): NetworkResponse<GetLeaderboardEntries.Response, ErrorResponse>

/**
* A call to this function will retrieve a given leaderboard's entries, targeted by its ID.
*/
@Mock @MockResponse(body = "/v1/game/GetUserGameLeaderboards.json")
@POST("/API/API_GetUserGameLeaderboards.php")
suspend fun getUserGameLeaderboards(
@Query("i") gameId: Long,
@Query("u") userId: String? = null,
@Query("o") offset: Int = 0,
@Query("c") count: Int = 100
): NetworkResponse<GetUserGameLeaderboard.Response, ErrorResponse>

/**
* A call to this function will retrieve the complete list of all system ID and name pairs on the site.
*
Expand All @@ -315,7 +348,9 @@ interface RetroInterface {
suspend fun getGameList(
@Query("i") consoleId: Long,
@Query("f") shouldOnlyRetrieveGamesWithAchievements: Int = 0,
@Query("h") shouldRetrieveGameHashes: Int = 0
@Query("h") shouldRetrieveGameHashes: Int = 0,
@Query("o") offset: Int = 0,
@Query("c") count: Int = 0
): NetworkResponse<GetGameList.Response, ErrorResponse>

/**
Expand Down Expand Up @@ -438,7 +473,8 @@ interface RetroInterface {
@Query("i") username: String,
@Query("c") count: Int = 10,
@Query("o") offset: Int = 0,
@Query("t") type: Int = 3
@Query("t") type: Int = 3,
@Query("sort") sort: String = "submitted"
): NetworkResponse<GetComments.Response, ErrorResponse>

/**
Expand All @@ -450,7 +486,8 @@ interface RetroInterface {
@Query("i") gameId: Long,
@Query("c") count: Int = 10,
@Query("o") offset: Int = 0,
@Query("t") type: Int = 1
@Query("t") type: Int = 1,
@Query("sort") sort: String = "submitted"
): NetworkResponse<GetComments.Response, ErrorResponse>

/**
Expand All @@ -462,6 +499,7 @@ interface RetroInterface {
@Query("i") achievementId: Long,
@Query("c") count: Int = 10,
@Query("o") offset: Int = 0,
@Query("t") type: Int = 2
@Query("t") type: Int = 2,
@Query("sort") sort: String = "submitted"
): NetworkResponse<GetComments.Response, ErrorResponse>
}
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ class GetGame {
@SerializedName("Released")
val released: String?,

@SerializedName("ReleasedAtGranularity")
val releasedAtGranularity: String?,

@SerializedName("GameTitle")
val gameTitle: String,

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ class GetGameExtended {
@SerializedName("Released")
val released: String?,

@SerializedName("ReleasedAtGranularity")
val releasedAtGranularity: String?,

@SerializedName("IsFinal")
val isFinal: Boolean,

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,13 @@ class GetGameHashes {
data class Result(
@SerializedName("Name")
val name: String,

@SerializedName("MD5")
val md5: String,

@SerializedName("Labels")
val labels: List<String>,

@SerializedName("PatchUrl")
val patchUrl: String?,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ class GetGameInfoAndUserProgress {
@SerializedName("PlayersTotal")
val playersTotal: Int,

@SerializedName("UserTotalPlaytime")
val userTotalPlaytime: Int,

@SerializedName("GuideURL")
val guideUrl: String?,

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,35 +3,54 @@ package org.retroachivements.api.data.pojo.game
import com.google.gson.annotations.SerializedName

class GetGameLeaderboards {

data class Response(
@SerializedName("Count")
val count: Long,

@SerializedName("Total")
val total: Long,

@SerializedName("Results")
val results: List<Leaderboard>,
)

data class Leaderboard(
@SerializedName("ID")
val id: Long,

@SerializedName("RankAsc")
val rankAsc: Boolean,

@SerializedName("Title")
val title: String,

@SerializedName("Description")
val description: String,

@SerializedName("Format")
val format: String,

@SerializedName("TopEntry")
val topEntry: TopEntry,

@SerializedName("Author")
val author: String,

@SerializedName("AuthorULID")
val authorUlid: String
)

data class TopEntry(
@SerializedName("User")
val user: String,

@SerializedName("ULID")
val ulid: String,

@SerializedName("Score")
val score: Long,

@SerializedName("FormattedScore")
val formattedScore: String,
)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
package org.retroachivements.api.data.pojo.game

import com.google.gson.annotations.SerializedName

class GetGameProgression {

data class Response(

@SerializedName("ID")
val id: Int,

@SerializedName("Title")
val title: String,

@SerializedName("ConsoleID")
val consoleId: Int,

@SerializedName("ConsoleName")
val consoleName: String,

@SerializedName("ImageIcon")
val imageIcon: String,

@SerializedName("NumDistinctPlayers")
val numDistinctPlayers: Int,

@SerializedName("TimesUsedInBeatMedian")
val timesUsedInBeatMedian: Int,

@SerializedName("TimesUsedInHardcoreBeatMedian")
val timesUsedInHardcoreBeatMedia: Int,

@SerializedName("MedianTimeToBeat")
val medianTimeToBeat: Int,

@SerializedName("MedianTimeToBeatHardcore")
val medianTimeToBeatHardcore: Int,

@SerializedName("TimesUsedInCompletionMedian")
val timesUsedInCompletionMedian: Int,

@SerializedName("TimesUsedInMasteryMedian")
val timesUsedInMasteryMedian: Int,

@SerializedName("MedianTimeToComplete")
val mediaTimeToComplete: Int,

@SerializedName("MedianTimeToMaster")
val medianTimeToMaster: Int,

@SerializedName("NumAchievements")
val numAchievements: Int,

@SerializedName("Achievements")
val achievements: List<Achievement>
) {
data class Achievement(

@SerializedName("ID")
val id: Int,

@SerializedName("Title")
val title: String,

@SerializedName("Description")
val description: String,

@SerializedName("Points")
val points: Int,

@SerializedName("TrueRatio")
val trueRatio: Int,

@SerializedName("Type")
val type: String?,

@SerializedName("BadgeName")
val badgeName: String,

@SerializedName("NumAwarded")
val numAwarded: Int,

@SerializedName("NumAwardedHardcore")
val numAwardedHardcore: Int,

@SerializedName("TimesUsedInUnlockMedian")
val timesUsedInUnlockMedian: Int,

@SerializedName("TimesUsedInHardcoreUnlockMedian")
val timesUsedInHardcoreUnlockMedian: Int,

@SerializedName("MedianTimeToUnlock")
val medianTimeToUnlock: Int,

@SerializedName("MedianTimeToUnlockHardcore")
val medianTimeToUnlockHardcore: Int
)
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
package org.retroachivements.api.data.pojo.game

import com.google.gson.annotations.SerializedName

class GetUserGameLeaderboard {

data class Response(

@SerializedName("Count")
val count: Int,

@SerializedName("Total")
val total: Int,

@SerializedName("Results")
val results: List<Result>
) {
data class Result(

@SerializedName("ID")
val id: Int,

@SerializedName("RankAsc")
val rankAsc: Boolean,

@SerializedName("Title")
val title: String,

@SerializedName("Description")
val description: String,

@SerializedName("Format")
val format: String,

@SerializedName("UserEntry")
val userEntry: UserEntry
) {
data class UserEntry(

@SerializedName("User")
val user: String,

@SerializedName("ULID")
val ulid: String,

@SerializedName("Score")
val score: Int,

@SerializedName("FormattedScore")
val formattedScore: String,

@SerializedName("Rank")
val rank: Int,

@SerializedName("DateUpdated")
val dateUpdated: String
)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ class GetUserRecentAchievements {
@SerializedName("Points")
val points: Int,

@SerializedName("TrueRatio")
val trueRatio: Int,

@SerializedName("Type")
val type: String?,

Expand Down
Loading