User:Drakken Keisterbane/CREST

From EVE University Wiki
< User:Drakken Keisterbane
Revision as of 03:03, 18 March 2014 by Drakken Keisterbane (talk | contribs) (Finshed the market endpoint.)
Jump to: navigation, search
This page is a work in progress.

This article or section is in the process of an expansion or major restructuring. You are welcome to assist in its construction by editing it as well.
If this article or section has not been edited in several days, please remove this template.

TODO

  • Explain each endpoint in detail.
  • Polish explanation on API usage.
  • Try to provide code examples/applications for each endpoint.

CREST

Carbon REST, or CREST, is a RESTful HTTP API that was created to allow developers read and write access to parts of the Eve Online universe. As of the writing of this article, it allows access to some public information about New Eden. Even the access we have now, however, is quite useful for many applications in game.

Usage

In general, you make a GET request to the target URL for the server that you wish to get information for, along with an endpoint which specifies what information you actually want. You then sift through the result that you get back to grab the information you want, assuming that you made the request correctly.

A correct response will return JSON code similar to the code below. [This] particular example is similar to result code you would get if you made a GET request to get some market data on some item.

An incorrectly formatted request will usually yield a 404 - Resource Not Found or similar error.


Entry point URLs and endpoints can be found below.

Entry Points & Endpoints

The entry point URL for GET requests to the Tranquility server (TQ), the one which we all use, is:


http://public-crest.eveonline.com


The entry point URL for GET requests to the Singularity server (Sisi), the test server, is:


http://public-crest.sisi.testeveonline.com


The CREST API has seven endpoints that can be used to obtain data on various aspects of the game. These are listed below, along with instructions for use and possible applications:

Tournaments

Endpoint: /tournaments/

Possible Applications: TODO

Districts

Endpoint: /districts/

Possible Applications: TODO

Killmails

Endpoint: /killmails/<kill_id>/<hash>

Possible Application: TODO

Incursions

Endpoint: /incursions/

Possible Applications: TODO

Alliances

Endpoint(s): /alliances/ and /alliances/<alliance_id>

Possible Applications: TODO

Market

Endpoint: /market/<region_id>/types/<type_id>/history/

Usage: This endpoint returns records of high/low and average prices of the item that matches <type_id> for the region which matches <region_id> for all days since a year from the day before you made the request. There is no system-wise or station wise options for the market endpoint at this time. Note that the records on items for the day which the request was made are populated with information for the previous day, as the API only allows you to get real data from the day before the day you made the request and before.

The result code contains the following JSON variables:

  • totalCount_str: The totalCount_str variable contains the amount of entries that are available for the item in question, as a string. (Ex: "totalCount_str":"353")
  • items: The items variable contains the actual JSON Array of entries of the item's market data. This is usually what you want to grab information from when you access this endpoint. This array contains X amount of entries, where X = totalCount. Each entry has seven variables, which are listed below:
    • avgPrice: The avgPrice variable contains the average price of the item you looked for for the date that is contained within this entry's date variable.
    • date: The date variable contains the date for which the information in that particular entry is relevant. In other words, the value of avgPrice is the actual average price for the item you looked for on the date noted by the date variable. It is in the format yyyy-MM-ddThh:mm:ss, where hh:mm:ss is always 00:00:00 Eve Time (UTC).
    • highPrice: The highPrice variable, as its name suggests, contains the value of the highest price the item you looked for achieved on the date for which the entry is relevant.
    • lowPrice: The lowPrice variable, as its name suggests, contains the value of the lowest price the item you looked for achieved on the date for which the entry is relevant.
    • orderCount: The orderCount variable represents the total amount of orders (buy and sell) for the item you looked for on the date for which this entry is relevant.
    • orderCount_str: The value represented by the orderCount variable, as a string.
    • volume: The volume variable represents the total volume (items moved, bought and sold) for the item you looked for on the date for which this entry is relevant.
    • volume_str: The value represented by the volume variable, as a string.


Possible Applications: Possible applications for this endpoint include market analysis to predict movement of item(s). With some work, you can predict when an item will be at it's lowest value over a period of time, invest in said item and then sell when the item is highest. The aforementioned is just an example of what you can do.