Shops

Desert Trader

Access the complete barter stock for the Desert Trader in the Calico Desert, where items are traded for goods rather than gold, using the chainable DesertTraderQuery API.

Quick Start

import { desertTrader } from 'stardew-valley-data'

// Get all desert trader items
const all = desertTrader().get()

// Get permanent (non-rotating) items
const permanent = desertTrader().permanent().get()

// Get items available on Wednesday
const wednesday = desertTrader().byDay('Wednesday').get()

// Get recipe trades only
const recipes = desertTrader().recipes().get()

Type Definition

Each item conforms to the DesertTraderItem interface:

FieldTypeDescription
idstringUnique identifier.
namestringDisplay name of the item received.
descriptionstringIn-game description text.
imagestringPath to the item's image.
tradeItemIdstringID of the item required for the trade.
tradeItemNamestringDisplay name of the trade item.
tradeItemImagestringPath to the trade item's image.
tradeAmountnumberQuantity of the trade item required.
dayDesertTraderDay | undefinedDay of the week when available (undefined for permanent stock).
isRecipeboolean | undefinedWhether this trade yields a recipe.
availabilitystring | undefinedSpecial purchase condition, if any.

DesertTraderDay

type DesertTraderDay =
  | 'Monday'
  | 'Tuesday'
  | 'Wednesday'
  | 'Thursday'
  | 'Friday'
  | 'Saturday'
  | 'Sunday'

Query Methods

DesertTraderQuery extends QueryBase and inherits five terminal methods:

MethodReturnsDescription
get()DesertTraderItem[]Return all results as an array.
first()DesertTraderItem | undefinedReturn the first result.
find(id)DesertTraderItem | undefinedFind an item by exact ID.
findByName(name)DesertTraderItem | undefinedFind an item by name (case-insensitive).
count()numberReturn the number of results.

Filter Methods

MethodReturnsDescription
permanent()DesertTraderQueryFilter to items always in stock (no day restriction).
daily()DesertTraderQueryFilter to day-specific rotating items only.
byDay(day)DesertTraderQueryFilter to all items available on the given day (permanent + that day's rotating item).
recipes()DesertTraderQueryFilter to recipe items only.
byTradeItem(tradeItemId)DesertTraderQueryFilter to items traded for the specified trade item (by item ID).
alwaysAvailable()DesertTraderQueryFilter to items with no special availability condition.

Sort Methods

MethodReturnsDescription
sortByTradeAmount(order?)DesertTraderQuerySort by trade amount. Pass 'asc' (default) or 'desc'.
sortByName(order?)DesertTraderQuerySort alphabetically by name. Pass 'asc' (default) or 'desc'.

Examples

List the daily rotating stock

import { desertTrader } from 'stardew-valley-data'

const days = [
  'Monday',
  'Tuesday',
  'Wednesday',
  'Thursday',
  'Friday',
  'Saturday',
  'Sunday',
]

days.forEach((day) => {
  const items = desertTrader().byDay(day).get()
  console.log(`${day}: ${items.length} items available`)
})

Find all trades requiring a specific item

import { desertTrader } from 'stardew-valley-data'

const omniGeodeTrades = desertTrader().byTradeItem('omni_geode').get()

omniGeodeTrades.forEach((item) => {
  console.log(`${item.tradeAmount}x ${item.tradeItemName} -> ${item.name}`)
})

Get recipes sorted by trade cost

import { desertTrader } from 'stardew-valley-data'

const recipes = desertTrader().recipes().sortByTradeAmount().get()

recipes.forEach((r) => {
  console.log(`${r.name}: ${r.tradeAmount}x ${r.tradeItemName}`)
})
Previous
Casino
Next
Dwarf