API Documentation - Auctionator/Auctionator GitHub Wiki
This API is stable and no breaking changes are anticipated.
Current API (2020 onwards)
Set callerID
to a string of the name of your add-on.
-- Returns the last scanned price for an item identified by itemID
-- Returns the price in coppers, or nil if one wasn't found
-- callerID: string
-- itemID : number
Auctionator.API.v1.GetAuctionPriceByItemID(callerID, itemID)
-- Returns the last scanned price for an item identified by itemLink
-- Returns the price in coppers, or nil if one wasn't found
-- callerID: string
-- itemLink: string
Auctionator.API.v1.GetAuctionPriceByItemLink(callerID, itemLink)
-- Searches for an array of search terms and displays the results
-- Search terms MUST NOT include " or ; in them
-- The auction house MUST be open.
-- callerID: string
-- terms : string[]
Auctionator.API.v1.MultiSearch(callerID, terms)
-- Searches for an array of search terms and displays ONLY the
-- results whose names exactly match a complete search term
-- Search terms MUST NOT include " or ; in them
-- The auction house MUST be open.
-- callerID: string
-- terms : string[]
Auctionator.API.v1.MultiSearchExact(callerID, terms)
-- Searches for an array of extended search terms and displays the results
-- See below for the search terms format.
-- The auction house MUST be open.
-- callerID: string
-- terms : table of tables
Auctionator.API.v1.MultiSearchAdvanced(callerID, terms)
-- Adds a function to be called when the price database
-- updates e.g after a full scan or search.
-- (Added 2020-12-10)
-- callerID: string
-- callback: function
Auctionator.API.v1.RegisterForDBUpdate(callerID, callback)
-- Returns the estimated value of the materials that result
-- from disenchanting this item, identified by itemID
-- Returns the price in coppers, or nil if none calculated
-- (Added 2021-11-10)
-- callerID: string
-- itemID : number
Auctionator.API.v1.GetDisenchantPriceByItemID(callerID, itemID)
-- Returns the estimated value of the materials that result
-- from disenchanting this item, identified by itemLink
-- Returns the price in coppers, or nil if none calculated
-- (Added 2021-11-10)
-- callerID: string
-- itemLink : number
Auctionator.API.v1.GetDisenchantPriceByItemLink(callerID, itemLink)
-- Returns the last seen purchase price for an item at a vendor
-- identified by itemID
-- Returns the price in coppers, or nil if one wasn't found
-- (Added 2022-07-22)
-- callerID: string
-- itemID : number
Auctionator.API.v1.GetVendorPriceByItemID(callerID, itemID)
-- Returns the last seen purchase price for an item at a vendor
-- identified by itemLink
-- Returns the price in coppers, or nil if one wasn't found
-- (Added 2022-07-22)
-- callerID: string
-- itemLink: string
Auctionator.API.v1.GetVendorPriceByItemLink(callerID, itemLink)
Examples
For the "Amazing Thing" add-on to get the price of monelite ore by item ID:
local monelitePrice = Auctionator.API.v1.GetAuctionPriceByItemID("Amazing Thing", 152512)
And to get the same price by using an item link:
local petPrice = Auctionator.API.v1.GetAuctionPriceByItemLink(
"Amazing Thing",
"\124cffffffff\124Hitem:152512::::::::120:::::\124h[Monelite Ore]\124h\124r"
)
To run a search for multiple transmog items, for example, use
Auctionator.API.v1.MultiSearch(
"Amazing Thing",
{
"Alabaster",
"Bloodfist",
"Boulderfist",
}
)
Advanced Search Terms
This is for:
Auctionator.API.v1.MultiSearchAdvanced(callerID, terms)
Each term is of the form:
{
searchString = "something", -- a string, mandatory, the search term same rules as the basic terms in MultiSearch and MultiSearchExact
isExact = true/false, -- a boolean, optional, specifies to use an exact search for the searchString
tier = 1/2/3, -- a number, optional, only 1, 2 or 3 will do anything and correspond to DF crafting qualities 1, 2 and 3 for reagents
quality = 8, -- a number, optional, corresponding to the values in Enum.ItemQuality
quantity = 5 -- a number, optional, number of the reagents to pre-select for purchasing from the search results for this term
}
Old API (retired in 2020) and replacements
Atr_GetSellValue(itemRef) --> Removed, no replacement
Atr_GetAuctionBuyout(itemRef) --> Auctionator.API.v1.GetAuctionPriceBy[ItemID/ItemLink]
Atr_SearchAH(shoppingListName, itemsToInsert, searchCategory)
--> Use MultiSearch. Category search and shopping list functionality removed.
Atr_RegisterFor_DBupdated(cbFunc) --> Auctionator.API.v1.RegisterForDBUpdate
Future API additions
With sufficient demand:
Auctionator.API.v1.CreateShoppingList(shoppingListName)
Auctionator.API.v1.DeleteShoppingList(shoppingListName)
Auctionator.API.v1.DoesListExist(shoppingListName)
Auctionator.API.v1.ClearShoppingList(shoppingListName)
Auctionator.API.v1.AddToShoppingList(shoppingListName, terms)