Skip to main content

Item Info And Prices

com.n3plugins.sdk.items exposes read-side item metadata and market quote helpers. This API includes ItemInfoApi, ItemInfo, PricesApi, and PriceQuote. The Inventory And Item Actions reference documents inventory clicks, item-on-target actions, and drops.

note

Specific plugin implementations handle target selection, budgeting, pricing strategies, and buy limits. The shared SDK provides only metadata and market quotes.

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, if the manager disappears, definitions drop offline, or runtime lookups fail.
  • fromComposition(itemId, composition): Builds an ItemInfo from an existing RuneLite ItemComposition. Returns empty when the composition evaluates to null.
  • setItemManagerForTesting(itemManager): Installs or clears the test ItemManager.

The get method depends on the injected ItemManager.

ItemInfo

ItemInfo acts as an immutable item-definition snapshot providing:

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

High-alchemy and RuneLite guide prices return as OptionalInt. Non-positive composition prices return empty optionals.

PricesApi

PricesApi reads the OSRS Wiki five-minute market endpoint and parses quotes 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 response for five minutes.
  • fetchFiveMinutePrice(itemId): Retrieves a specific quote from the fetched five-minute prices.
  • parseFiveMinutePrices(json): Parses a raw Wiki JSON payload into an immutable ID-to-quote map.
  • setClientForTesting(client): Configures a custom client or restores the default.

These methods throw IOException on fetch or parse failures. They skip rows lacking a positive average high price or volume.

PriceQuote

PriceQuote represents an immutable five-minute quote containing:

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

The averageHighPrice and highPriceVolume return optional types as the endpoint may omit them. Parsing or fetching populates the fetchedAt field.