Automatic price updates in Google Sheets for game items?

Hey everyone,

I’m trying to set up a Google Sheet that automatically updates prices for items in an online game. Here’s what I want to do:

  1. Pull the current price of a ‘Mythic Ingot’ from the game’s market.
  2. Update the total cost when I change the quantity.
  3. Calculate related material costs (like ‘Arcane Ore’ and ‘Shadowcoal’).

For example, if one Mythic Ingot costs 14,378 gold, and I need 2, it should show 28,756 gold total.

I’ve already set up formulas for material requirements:

  • 1 Mythic Ingot needs 1 Arcane Ore and 8 Shadowcoal
  • If I input 100 Ingots, it updates to show I need 100 Arcane Ore and 800 Shadowcoal

But I’m stuck on getting live price data into the sheet. Any ideas on how to fetch current prices from the game’s website and use them in calculations?

Thanks for any help!

I’ve tackled a similar challenge for a different game. The key is using Google Sheets’ IMPORTHTML or IMPORTXML functions to fetch data from the game’s market page. You’ll need to inspect the HTML structure of the page to find the right element containing the price.

For example, if the price is in a with class ‘item-price’, your formula might look like:

=IMPORTXML(“https://game-market-url.com”, “//span[@class=‘item-price’]”)

Once you have that working, you can reference the cell with the imported price in your other formulas. Just be aware that excessive requests might get blocked, so use GOOGLEFINANCE() to refresh at set intervals.

As for calculations, sounds like you’ve got a good start. Consider adding error handling for when the import fails, maybe with IFERROR().

As someone who’s been automating game-related spreadsheets for years, I can tell you it’s definitely possible, but there are a few gotchas to watch out for.

First off, the IMPORTXML function mentioned earlier is a solid approach, but game websites often use JavaScript to load prices dynamically. In that case, you might need to look into using Google Apps Script to scrape the data more effectively.

One trick I’ve used is setting up a separate sheet that pulls in all the prices at once, then references those cells in your main calculation sheet. This way, you’re only making one ‘expensive’ operation instead of multiple.

For updating totals based on quantity, you can use simple multiplication formulas. Just make sure to use absolute cell references (with $) for your price cells so you can drag the formula down without issues.

Lastly, don’t forget about error handling. Network issues or changes to the game’s website can break your imports. Use IFERROR() liberally to avoid ‘#N/A’ errors all over your sheet.

hey there! i’ve done something similar for my guild’s crafting sheet. have you tried using the IMPORTJSON function? it’s not built-in, but you can add it as a custom function. works great for pulling data from game APIs if they have one. just remember to cache the results so you don’t hit rate limits!