Skip to content

Instantly share code, notes, and snippets.

@outworlder
Created October 15, 2010 14:18
Show Gist options
  • Select an option

  • Save outworlder/628252 to your computer and use it in GitHub Desktop.

Select an option

Save outworlder/628252 to your computer and use it in GitHub Desktop.
Eve Central market data query
(use ssax)
(use uri-common)
(use http-client)
(use intarweb)
(determine-proxy
(lambda (uri)
(uri-reference "http://localhost:3128")))
(define (get-market-data item)
(with-input-from-request
(make-request method: 'POST
uri: (uri-reference "http://api.eve-central.com/api/marketstat"))
`((typeid . ,item))
read-string))
#;12> (get-market-data 34)
"<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n\n<!-- Automatically generated data from EVE-Central.com -->\n<!-- This is the new API :-) -->\n\n\n\n<evec_api version=\"2.0\" method=\"marketstat_xml\">\n<marketstat>\n\n\n\n<type id=\"34\">\n\n <all>\n <volume>250789309734.00</volume>\n<avg>10.14</avg>\n<max>19999.00</max>\n<min>0.20</min>\n<stddev>314.99</stddev>\n<median>2.24</median>\n\n </all>\n <buy>\n <volume>140937262376.00</volume>\n<avg>1.80</avg>\n<max>3.00</max>\n<min>0.20</min>\n<stddev>0.45</stddev>\n<median>1.85</median>\n\n </buy>\n <sell>\n <volume>109852047358.00</volume>\n<avg>2.60</avg>\n<max>19999.00</max>\n<min>1.39</min>\n<stddev>364.74</stddev>\n<median>2.31</median>\n\n </sell>\n</type>\n\n\n</marketstat>\n</evec_api>\n"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment