Skip to content

peteraraujo/articapi-client

Repository files navigation

Artic API Client

Kotlin Gradle License MavenCentral Github

Display Image

Features

  • Fetch data from the Artic API
  • Fully documented.
  • Complete Artic HTTP API integration. All fields, endpoints and parameters are supported.
  • Follows Artic Api's structure.
  • Powered by KTor.
  • Kotlin Multiplatform support.
    • Current platforms:
      • JVM (works on Android)
      • JS
      • Linux
      • Windows Native
  • Unit tested.

Installation

Artic API Client is available on Maven Central. To add it to your project, include the dependency below.

build.gradle.kts

implementation("com:peteraraujo.articapi:articapi-client:1.0.1")

// If using toml libs:
implementation(libs.articapi.client)

build.gradle

implementation 'com:peteraraujo.articapi:articapi-client:1.0.1'

// If using toml libs:
implementation(libs.articapi.client)

libs.versions.toml

[versions]
articapiclient = "1.0.1"

[libraries]
articapi-client = { module = "com:peteraraujo.articapi:articapi-client", version.ref = "articapiclient" }

Check complete versioning and dependencies information on the project's GitHub Wiki.

Versioning

The following chart shows the versions of Artic Api Client dependencies.

Artic API Client Kotlin KTor
1.0.1 2.0.0 2.3.11

Usage

Getting a service

There is a service per resource. For example, Artwork service:

val artworkService = ArtworkService()

Using a service

Each field has its own endpoints. Services are "resource specific", so each has certain functions depending on the endpoints available to it.
Note: service functions are suspend.
For example, when using ArtworkService, you'll have access to artwork-specific endpoints:

val artworkService = ArtworkService()

val getByIdResult = artworkService.getById(id = 3)
val getArtworks = artworkService.getItems(limit = 2)
val searchArtworks = artworkService.search(search = "Paris")
val getArtworkManifest = artworkService.getArtworkManifest(id = 3)

Check complete documentation on the project's GitHub Wiki.

Contributing and Issues

If you encounter any issues or have found an error in this project, please file an issue. I appreciate your feedback and will do my best to address the problem promptly. Also, contributions are welcome to this project. If you're interested in contributing, please check out the Code of Conduct for more details on how to get started and the expected standards from all contributors.

Future Features

  • Add support on other platforms, like Apple's platforms.

Acknowledgments

  • The Artic (api.artic.edu) team for providing an amazing server API.

Contact

If you have any questions or suggestions, feel free to contact me.