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
Arin Mara (talk | contribs)
m Functional Google Sheets Market Data Spreadsheet no longer works. Deleted.
Salartarium (talk | contribs)
m Eve -> EVE per MoS and name of tool, typos
Line 1: Line 1:
Out-of-game Eve data access is provided by CCP through the [[EVE_Swagger_Interface]]. However, this access method is not convenient for casual use.  Fortunately, third-party services have arisen to provide better access for the casual player. Eve Market data can be accessed through an API provided by [https://api.evemarketer.com/ec/ EVEMarketer]. This service replaces a previous service provided by the defunct Eve Central. EVEMarketer API access methods are very similar to those used by Eve Central, but different enough that previous calls will not work. These API calls can be used in a spreadsheet (e.g., Google Sheets, Excel) to provide programmatic access to Market Data even for casual users.  
Out-of-game EVE data access is provided by CCP through the [[EVE Swagger Interface]]. However, this access method is not convenient for casual use.  Fortunately, third-party services have arisen to provide better access for the casual player. EVE Market data can be accessed through an API provided by [https://api.evemarketer.com/ec/ EVEMarketer]. This service replaces a previous service provided by the defunct EVE Central. EVEMarketer API access methods are very similar to those used by EVE Central but different enough that previous calls will not work. These API calls can be used in a spreadsheet (e.g., Google Sheets, Excel) to provide programmatic access to Market Data even for casual users.  


== API Call construction ==
== API Call construction ==


[https://api.evemarketer.com/ec/ EVEMarketer] provides an endpoint accepting POST or GET methods and returns data in either XML (/marketstat) or JSON (/marketstat/json) formats. The call requires a item identifier (typeID) and has optional parameters to limit data to either a system (usesystem) or a region (regionlimit). A single call can contain up to 200 different items. By default the data returned is XML and for all of Singularity. The following method describes how to use the GET access method. The GET call method produces a URL that can be directly entered into a web browser to provide data without any additional tools or knowledge. Users interested in the POST method, should be able to construct the request given the GET method construction.
[https://api.evemarketer.com/ec/ EVEMarketer] provides an endpoint accepting POST or GET methods and returns data in either XML (/marketstat) or JSON (/marketstat/json) formats. The call requires an item identifier (typeID) and has optional parameters to limit data to either a system (usesystem) or a region (regionlimit). A single call can contain up to 200 different items. By default, the data returned is XML and for all of Singularity. The following method describes how to use the GET access method. The GET call method produces a URL that can be directly entered into a web browser to provide data without any additional tools or knowledge. Users interested in the POST method should be able to construct the request given the GET method construction.


'''GET Examples'''
'''GET Examples'''
Line 19: Line 19:
* [https://www.fuzzwork.co.uk/resources/typeids.csv Fuzzworks hosts a csv containing all typeIDs and item names]
* [https://www.fuzzwork.co.uk/resources/typeids.csv Fuzzworks hosts a csv containing all typeIDs and item names]
* [https://www.fuzzwork.co.uk/tools/api-typename-to-typeid/ Fuzzworks hosts an API lookup for item names]
* [https://www.fuzzwork.co.uk/tools/api-typename-to-typeid/ Fuzzworks hosts an API lookup for item names]
* Most websites providing Eve Market data use typeid to reference the specific examples ([https://evemarketer.com/types/215 Eve Marketer for Iron Charge S])
* Most websites providing EVE Market data use typeid to reference the specific examples ([https://evemarketer.com/types/215 EVE Marketer for Iron Charge S])


=== Obtaining the system and region IDs ===
=== Obtaining the system and region IDs ===
The other two parameters, systemID and regionID are also unique identifiers specifying a singular region or solar system in Eve. There are several ways to access this information. Here are a few:
The other two parameters, systemID and regionID are also unique identifiers specifying a singular region or solar system in EVE. There are several ways to access this information. Here are a few:


* [https://www.adam4eve.eu/info_locations.php Adam4Eve hosts a list]
* [https://www.adam4eve.eu/info_locations.php Adam4EVE hosts a list]
* [https://docs.google.com/spreadsheets/d/1HkBZ_KvCYQeFf3awm91fmoPdHTBWugvVKpcwZUv7gXM Google Docs Spreadsheet]
* [https://docs.google.com/spreadsheets/d/1HkBZ_KvCYQeFf3awm91fmoPdHTBWugvVKpcwZUv7gXM Google Docs Spreadsheet]
* Eve Marketer can specify specific regions or systems. The identifier is available in the url.(Example: [https://evemarketer.com/regions/10000043/types/215 Iron Charge S in Domain])
* EVEMarketer can specify specific regions or systems. The identifier is available in the url.(Example: [https://evemarketer.com/regions/10000043/types/215 Iron Charge S in Domain])
* main trade hubs: Jita usesystem=30000142, Amarr usesystem=30002187, Rens usesystem=30002510, Dodixie usesystem=30002659
* main trade hubs: Jita usesystem=30000142, Amarr usesystem=30002187, Rens usesystem=30002510, Dodixie usesystem=30002659


=== Constructing the GET API Call ===
=== Constructing the GET API Call ===
Once you have a typeid and have chosen your area of interest (all of Eve, system, or region), you can place them into a call:
Once you have a typeid and have chosen your area of interest (all of EVE, system, or region), you can place them into a call:
* <nowiki>Basic call form: https://api.evemarketer.com/ec/marketstat?typeid=<typeid><&regionlimit=<regionid>|&usesystem=<systemid>></nowiki>
* <nowiki>Basic call form: https://api.evemarketer.com/ec/marketstat?typeid=<typeid><&regionlimit=<regionid>|&usesystem=<systemid>></nowiki>
* Example call for Iron Charge S for all Eve data: https://api.evemarketer.com/ec/marketstat?typeid=215
* Example call for Iron Charge S for all EVE data: https://api.evemarketer.com/ec/marketstat?typeid=215
The complete url can then be entered into a standard web browser, see above for further examples.
The complete url can then be entered into a standard web browser, see above for further examples.


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=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.
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 market data retrieval based on cell references.


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