CREST market data

This has been out for a while, but I’ve now got something public ( https://www.fuzzwork.co.uk/market/viewer2/ ) out there, I thought I’d write some words.

Of all the things which have happened in my CSM term, the availability of ‘live’ market data is one of the ones I’m happiest about. It might not seem like a big step, but we now have access to data directly from Tranquility, in a way that has a very low cache time. (I’m expecting some future ones to be even smaller, but that’s more specific data) It’s been a long time coming, and is a step towards removing the ‘requirement’ for the grey area of cache scraping. (Along with the dgmExpressions table being added to the SDE). Grey areas are bad, because they lead people to push the boundaries, and I don’t want to see someone banned for that.

But enough electioneering (Vote for me! 🙂 ), I thought I’d write a little about what it’s doing. I had help in the form of Capt Out’s Crest Explorer which gave me a head start, rather than needing to implement the core ‘Log into the SSO’ bit. After that, it’s just a matter of:

  • Grab the region list. (filtering out the Wormholes)
  • Grab the base market groups.
  • Wait for the user to click something
    • If it’s a market group, grab that specific group, and loop through it for direct children
    • If it’s an item, if a region is selected, grab buy and sell orders, before cramming them into tables
    • If it’s a region, grab the region data for where to get buy and sell order data

That’s pretty much it. There are some twiddly bits (like languages) but the rest of it is just AJAX calls, and looping through the result sets for display. I’d hope the code is fairly simple to understand (if you know any javascript/jquery) but if you have any questions, feel free to throw them my way.

https://github.com/fuzzysteve/CREST-Market-Viewer for the source. MIT licensed.