TSM Web API Update – Specify Data Fields

TSM recently made some changes to the way the TSM Web API functions to hopefully make it more accessible.

Previously, each endpoint provided all of the following fields in its response:

 

[
  {
    "Id": 0,
    "Name": "string",
    "Level": 0,
    "Class": "string",
    "SubClass": "string",
    "VendorBuy": 0,
    "VendorSell": 0,
    "MarketValue": 0,
    "MinBuyout": 0,
    "Quantity": 0,
    "NumAuctions": 0,
    "HistoricalPrice": 0,
    "RegionMarketAvg": 0,
    "RegionMinBuyoutAvg": 0,
    "RegionQuantity": 0,
    "RegionHistoricalPrice": 0,
    "RegionSaleAvg": 0,
    "RegionAvgDailySold": 0,
    "RegionSaleRate": 0
  }
]    

This would cause some issues in some applications, such as Google Sheets, because the data was simply too large. Now you can actually specify which fields you would like returned at the end of your query.

Let’s look at the /item/{region}/{realm} endpoint in Google Sheets as an example.

 

By default, and when no fields are specified then all fields are returned:

http://api.tradeskillmaster.com/v1/item/{region}/{realm}?format=csv&apiKey=<SNIP>

This would return an error that the resource being imported is too large.

 

If you’re only interested in the Item ID, Name, MinBuyout and MarketValue for example, you can now add those specific case-sensitive fields separated by commas at the end of your query:

http://api.tradeskillmaster.com/v1/item/{region}/{realm}?format=csv&apiKey=<SNIP>&fields=Id,Name,MinBuyout,MarketValue

This will return the specified fields in your spreadsheet ready for a VLOOKUP.

 

If you’re unfamilar with the TSM Web API I wrote up a brief introduction on our support knowledgebase:http://support.tradeskillmaster.com/display/KB/TSM+Public+Web+API

These changes and more technical information can be found in the TSM API Documentation:http://api.tradeskillmaster.com/docs/

Leave a Reply

Your email address will not be published. Required fields are marked *

Clef two-factor authentication