Skip to main content

Item Info And Prices

com.n3plugins.sdk.items owns read-side item metadata and market quote helpers. Use this page for ItemInfoApi, ItemInfo, PricesApi, and PriceQuote. Inventory clicks, item-on-target actions, and drops remain documented on Inventory And Item Actions.

note

Market Alcher strategy, target selection, budgeting, retry pricing, and buy limits are plugin-local behavior. The shared SDK exposes metadata and quotes only.

ItemInfoApi

ItemInfoApi resolves RuneLite item definitions into stable SDK snapshots.

Optional<ItemInfo> natureRune = ItemInfoApi.get(ItemID.NATURE_RUNE);

Optional<ItemInfo> fromComp = ItemInfoApi.fromComposition(itemId, composition);

Methods:

  • get(itemId) - looks up item metadata by id through the configured RuneLite ItemManager; returns empty for non-positive ids, missing manager, unavailable definitions, or runtime lookup failures.
  • fromComposition(itemId, composition) - builds an ItemInfo from an existing RuneLite ItemComposition; returns empty when the composition is null.
  • setItemManagerForTesting(itemManager) - installs or clears the test ItemManager.

get(...) currently depends on the injected ItemManager; tests can install one with setItemManagerForTesting(...).

ItemInfo

ItemInfo is an immutable item-definition snapshot with:

  • getItemId()
  • getName()
  • getHighAlchPrice()
  • getGePrice()
  • isStackable()
  • isMembers()
  • isGeTradeable()
  • getNoteId()
  • getLinkedNoteId()

High-alchemy and RuneLite guide prices are OptionalInt values. Non-positive composition prices are exposed as empty optionals.

PricesApi

PricesApi reads the OSRS Wiki five-minute market endpoint and parses quote payloads into SDK snapshots.

Map<Integer, PriceQuote> prices = PricesApi.fetchFiveMinutePrices();
Optional<PriceQuote> natureRune = PricesApi.fetchFiveMinutePrice(ItemID.NATURE_RUNE);

Map<Integer, PriceQuote> parsed = PricesApi.parseFiveMinutePrices(rawJson);

Methods:

  • fetchFiveMinutePrices() - fetches and parses the OSRS Wiki /5m endpoint, caching the raw endpoint response for five minutes in the default client.
  • fetchFiveMinutePrice(itemId) - returns one quote from fetchFiveMinutePrices().
  • parseFiveMinutePrices(json) - parses a raw Wiki JSON payload into an immutable item-id-to-quote map.
  • setClientForTesting(client) - installs a custom price client, or restores the default Wiki client when passed null.

fetchFiveMinutePrices(), fetchFiveMinutePrice(...), and parseFiveMinutePrices(...) throw IOException when the endpoint cannot be fetched or the JSON cannot be parsed. Rows without a positive average high price or high-price volume are skipped.

PriceQuote

PriceQuote is an immutable five-minute quote with:

  • getItemId()
  • getAverageHighPrice()
  • getHighPriceVolume()
  • getFetchedAt()

averageHighPrice and highPriceVolume are optional because the Wiki endpoint can omit either field. fetchedAt is set when the payload is parsed or fetched.