Skip to content


Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time

Cat Fact Client

Type Status
CI pipelines Release Gradle Upgrade Linters

A Client library in Kotlin for

This is the example client library as described in the article link to article.

The library would do a best effort to supply the required number of facts, but it is not guaranteed that the number of facts returned would be the same as the number requested, but only limited by it.


The library can be used as follows:

val client = CatFactFactory.getInstabce(API, objectMapper)
val facts = client.getFacts(3)

Alternatively, you can use the mock version of the library that does not require any network calls:

val client = CatFactFactory.getInstabce(MOCK, objectMapper)
val facts = client.getFacts(3)

Adding the library to your project

The library is available on GitHub Packages, and can be added to your project as follows:

Add to your build.gradle.kts:

repositories {
    maven {
        url = uri("")
        credentials {
            username = project.findProperty("gpr.user")?.toString() ?: System.getenv("GITHUB_ACTOR")
            password = project.findProperty("gpr.key")?.toString() ?: System.getenv("GITHUB_TOKEN")

You can then add the library as a dependency:

dependencies {