Skip to main content

Market board

marketBoard() asks for what the market board currently shows for an item: the listings, the most recent sales and prices calculated from them.

MarketBoardResponse response = rest.marketBoard()
.world(Worlds.europe().light().odin)
.itemsIds(5057)
.listingsLimit(10)
.complete();

for (Listing listing : response.listings()) {
System.out.println(listing.price().pricePerUnit() + " gil from " + listing.retainer().name());
}

Where​

Pick exactly one place. A second call throws an IllegalStateException.

MethodData from
world(World)One world.
dataCenter(DataCenter)Every world of a data center.
region(Region)Every world of a region.

Get the objects from Worlds, for example Worlds.europe().light().odin. See Worlds.

Which item​

itemsIds(Integer...) and itemsIds(Collection<Integer>) take item ids. items(Item...) and items(Collection<Item>) take Item objects, for example from an earlier response.

A request takes exactly one item. More than one item, or none, throws an IllegalArgumentException; setting the item a second time throws an IllegalStateException. Universalis answers requests for several items with a different response, which this version does not cover.

Options​

All options are optional.

MethodUniversalis parameterDefaultWhat it does
listingsLimit(int)listingsall listingsHow many listings to return.
historyLimit(int)entries5How many recent sales to return.
highQuality()hq=trueboth qualitiesOnly high quality listings and sales.
normalQuality()hq=falseboth qualitiesOnly normal quality listings and sales.
highQuality(boolean)hqboth qualitiestrue is highQuality(), false is normalQuality().
historyTime(Duration)entriesWithinno limitOnly sales within this time before now. Sent in seconds.
statsTime(Duration)statsWithin7 daysThe time before now that prices and sale velocity are calculated over. Sent in milliseconds.
fields(String...)fieldsall fieldsOnly these fields, named as Universalis names them, for example listings.pricePerUnit. Fields left out are empty, zero or null in the response.

historyTime and statsTime throw an IllegalArgumentException for a negative duration.

The response​

MarketBoardResponse holds:

FieldTypeWhat it is
item()ItemThe item.
world(), dataCenter(), region()World, DataCenter, RegionThe place you asked for. The other two are null.
lastUploadTime()InstantWhen data for this item was last uploaded.
listings()List<Listing>The current listings.
recentHistory()List<Sale>The most recent sales.
currentAveragePrice()QualityIndicator<Float>Average price of the current listings.
averagePrice()QualityIndicator<Float>Average price of the sales in the stats time.
minPrice(), maxPrice()QualityIndicator<Integer>Lowest and highest price of the current listings.
saleVelocity()QualityIndicator<Float>Average sales per day in the stats time.
stackSizeHistogram()QualityIndicator<Map<Integer, Integer>>How many listings there are per stack size.
worldUploadTimes()Map<World, Instant>When data was last uploaded per world. Empty for a single world.
listingsCount(), recentHistoryCount()intHow many listings and sales Universalis has, also beyond the limits you set.
unitsForSale(), unitsSold()intThe units in all listings and in all sales.
hasData()booleanWhether Universalis has any data for the item.

A QualityIndicator splits a value by quality: general() covers both, normalQuality() and highQuality() one each.

A Listing holds the price() (pricePerUnit, quantity, total), the retainer() (id, name, city), the creator() of crafted items, meta() (hq, crafted, stainId, materia), the world(), tax(), lastReviewTime(), listingId(), sellerId() and onMannequin().

A Sale holds hq(), the price(), the timestamp(), onMannequin(), the world() and the buyerName().