Universalis Java
Universalis Java is a Java client for Universalis, the crowd-sourced market board data of Final Fantasy XIV. It gives you:
- a REST client for prices, sale history, tax rates and statistics,
- a WebSocket client that tells you about new listings and sales as they happen,
- worlds, data centers and regions as Java objects,
- optional item names in English, German, French and Japanese.
The API coverage page lists which parts of the Universalis API the client wraps.
Requirements
| What | Version |
|---|---|
| Java | 21 or newer. The library is compiled for Java 21. |
| SLF4J | The library logs through slf4j-api and brings it. Add an SLF4J binding (for example slf4j-simple or Logback) to see the log output. |
Modules
| Module | What it does |
|---|---|
universalis-rest | The REST client. |
universalis-ws | The WebSocket client. |
universalis-core | Worlds, item names and the shared data types. Both clients bring it. |
universalis | Both clients in one artifact. |
Add the dependency
Universalis Java is published to EldoNexus. Releases are in maven-releases, builds of the main branch in
maven-snapshots. The maven-public repository holds both.
- Gradle (Kotlin DSL)
- Gradle (Groovy)
- Maven
repositories {
maven("https://eldonexus.de/repository/maven-public/")
}
dependencies {
implementation("de.chojo.universalis:universalis:2.1.0")
}
repositories {
maven { url 'https://eldonexus.de/repository/maven-public/' }
}
dependencies {
implementation 'de.chojo.universalis:universalis:2.1.0'
}
<repositories>
<repository>
<id>eldonexus</id>
<url>https://eldonexus.de/repository/maven-public/</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>de.chojo.universalis</groupId>
<artifactId>universalis</artifactId>
<version>2.1.0</version>
</dependency>
</dependencies>
Only need one client? Use universalis-rest or universalis-ws as the artifact instead.
Quick start
Ask for the cheapest high quality listing of an item in a data center:
try (UniversalisRest rest = UniversalisRest.defaultApi()) {
MarketBoardResponse response = rest.marketBoard()
.dataCenter(Worlds.europe().light())
.itemsIds(36113)
.highQuality()
.complete();
System.out.println("Cheapest HQ price: " + response.minPrice().highQuality());
}
Listen to new sales on one world:
UniversalisWs ws = UniversalisWs.getDefault()
.subscribe(Subscriptions.salesAdd().restrict(Worlds.europe().light().odin))
.registerListener(new ListenerAdapter() {
@Override
public void onSalesAdd(SalesAddEvent event) {
System.out.println(event.sales().size() + " sales of item " + event.item().id());
}
})
.build();