Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

API access to market data: Difference between revisions

From EVE University Wiki
Enitin (talk | contribs)
m typo fix
Eonay (talk | contribs)
m Google Sheets Method: - corrected TypeID for "Iron Charge S" in example URLs from 216 to 215 (see https://www.fuzzwork.co.uk/api/typeid.php?typename=Iron%20Charge%20S)
Line 49: Line 49:
The following instructions are for API calls in Google Sheets, but should be readily transferable to other spreadsheet programs (e.g., Excel).
The following instructions are for API calls in Google Sheets, but should be readily transferable to other spreadsheet programs (e.g., Excel).
=== Google Sheets Method ===
=== Google Sheets Method ===
Google Sheets uses the IMPORTXML function to make API calls and process XML. This function requires two parameters, the API URL and the XML field to retrieve. The API URL was constructed above (e.g., https://api.evemarketer.com/ec/marketstat?typeid=216). The XML fields available are described by the Data structure above and are specified by the form //<sell|buy>/<field>. The IMPORTXML function can be used in conjunction with cell functions (e.g., CONCATENATE, INDEX, LOOKUP, etc) to automate the market data retrieval based on cell references.
Google Sheets uses the IMPORTXML function to make API calls and process XML. This function requires two parameters, the API URL and the XML field to retrieve. The API URL was constructed above (e.g., https://api.evemarketer.com/ec/marketstat?typeid=215). The XML fields available are described by the Data structure above and are specified by the form //<sell|buy>/<field>. The IMPORTXML function can be used in conjunction with cell functions (e.g., CONCATENATE, INDEX, LOOKUP, etc) to automate the market data retrieval based on cell references.


'''Examples'''
'''Examples'''


* <nowiki>=importxml("https://api.evemarketer.com/ec/marketstat?typeid=216", "//buy/median") Median buy price for Iron Charge S </nowiki>
* <nowiki>=importxml("https://api.evemarketer.com/ec/marketstat?typeid=215", "//buy/median") Median buy price for Iron Charge S </nowiki>
* <nowiki>=importxml("https://api.evemarketer.com/ec/marketstat?typeid=216&usesystem=30000142", "//sell/min") Minimum sell price for Iron Charge S in Jita </nowiki>
* <nowiki>=importxml("https://api.evemarketer.com/ec/marketstat?typeid=215&usesystem=30000142", "//sell/min") Minimum sell price for Iron Charge S in Jita </nowiki>
* <nowiki>=importxml(CONCATENATE("https://api.evemarketer.com/ec/marketstat?typeid=", A1)), "//sell/volume") Volume of sell orders for the typeid in cell A1</nowiki>
* <nowiki>=importxml(CONCATENATE("https://api.evemarketer.com/ec/marketstat?typeid=", A1)), "//sell/volume") Volume of sell orders for the typeid in cell A1</nowiki>
* <nowiki>=importxml(CONCATENATE("https://api.evemarketer.com/ec/marketstat?",typeid&JOIN(typeid,$B2:B201)), "//sell/median") Median sell price for each typeid provided in cells B2 through B201. Remember that the API limits you to 200 items per call.</nowiki>
* <nowiki>=importxml(CONCATENATE("https://api.evemarketer.com/ec/marketstat?",typeid&JOIN(typeid,$B2:B201)), "//sell/median") Median sell price for each typeid provided in cells B2 through B201. Remember that the API limits you to 200 items per call.</nowiki>