Class: Corporation

Corporation

An api adapter that provides functions for accessing various details for a corporation specified by id via functions in the corporation ESI endpoints. This only includes the non-authenticated corporation end points.

You should not usually instantiate this directly as its constructor requires an internal api instance. This does not include functions that require a character's authorization.


new Corporation(agent, corporationId)

Create a new Corporation for the given agent provider and specific corporationId.

Parameters:
Name Type Description
agent ESIAgent

The agent used to generate web requests

corporationId Number

The corporation id that is used for all requests

Methods


history()

Get a list of all the alliances a corporation has been a member of. This route is cached for up to 3600 seconds.

This makes an HTTP GET request to /corporations/{corporation_id}/alliancehistory/. The route version is v1.

On success, this resolves to alliance history for the given corporation. An example result is:

[
  {
    "alliance": {
      "alliance_id": 99000006,
      "is_deleted": false
    },
    "record_id": 23,
    "start_date": "2016-10-25T14:46:00Z"
  }
]
Returns:

A Promise that resolves to the parsed JSON of the response.

Type
Promise.<Array.<Object>>

icon()

Get the icon urls for a corporation. This route is cached for up to 3600 seconds.

This makes an HTTP GET request to /corporations/{corporation_id}/icons/. The route version is v1.

On success, this resolves to urls for icons for the given corporation id and server. An example result is:

{
  "px128x128": "https://imageserver.eveonline.com/Corporation/1000010_128.png",
  "px256x256": "https://imageserver.eveonline.com/Corporation/1000010_256.png",
  "px64x64": "https://imageserver.eveonline.com/Corporation/1000010_64.png"
}
Returns:

A Promise that resolves to the parsed JSON of the response.

Type
Promise.<Object>

info()

Public information about a corporation. This route is cached for up to 3600 seconds.

This makes an HTTP GET request to /corporations/{corporation_id}/. The route version is v3.

On success, this resolves to public data about a corporation. An example result is:

{
  "alliance_id": 434243723,
  "ceo_id": 180548812,
  "corporation_description": "This is a corporation description, it's basically just a string",
  "corporation_name": "C C P",
  "creation_date": "2004-11-28T16:42:51Z",
  "creator_id": 180548812,
  "faction": "",
  "member_count": 656,
  "tax_rate": 0.256,
  "ticker": "-CCP-",
  "url": "http://www.eveonline.com"
}
Returns:

A Promise that resolves to the parsed JSON of the response.

Type
Promise.<Object>

loyaltyOffers()

Return a list of offers from a specific corporation's loyalty store. This route expires daily at 11:05.

This makes an HTTP GET request to /loyalty/stores/{corporation_id}/offers/. The route version is v1.

On success, this resolves to a list of offers. An example result is:

[
  {
    "isk_cost": 0,
    "lp_cost": 100,
    "offer_id": 1,
    "quantity": 1,
    "required_items": [
      {
        "quantity": 0,
        "type_id": 0
      }
    ],
    "type_id": 123
  }
]
Returns:

A Promise that resolves to the parsed JSON of the response.

Type
Promise.<Array.<Object>>