new Character(agent, characterId, token)
Create a new CharacterInfo for the given agent
, targeting the
specific characterId
.
Parameters:
Name | Type | Description |
---|---|---|
agent |
ESIAgent | The agent used to generate web requests |
characterId |
Number | The id used for all character requests |
token |
String | The SSO access token for the character |
- See:
-
- https://esi.tech.ccp.is/latest/#/Character
- https://esi.tech.cpp.is/latest/#/Assets
- https://esi.tech.cpp.is/latest/#/Bookmarks
- https://esi.tech.cpp.is/latest/#/Clones
- https://esi.tech.cpp.is/latest/#/Fittings
- https://esi.tech.cpp.is/latest/#/Killmails
- https://esi.tech.cpp.is/latest/#/Location
- https://esi.tech.ccp.is/latest/#/Planetary_Interaction
- https://esi.tech.ccp.is/latest/#/Skills
- https://esi.tech.ccp.is/latest/#/Wallet
Members
-
autopilot :Autopilot
-
An Autopilot instance linked to this Character.
Type:
-
bookmarks :Bookmarks
-
A Bookmarks instance linked to this Character.
Type:
-
calendar :Calendar
-
A Calendar instance linked to this Character.
Type:
-
colonies :Colonies
-
A Colonies instance linked to this Character.
Type:
-
contacts :Contacts
-
A Contacts instance linked to this Character.
Type:
-
corporation :CharacterCorporation
-
A CharacterCorporation instance linked to this Character.
Type:
-
fittings :Fittings
-
A Fittings instance linked to this Character.
Type:
-
mail :Mail
-
A Mail instance linked to this Character.
Type:
-
structures :Structures
-
A Structures instance linked to this Character.
Type:
-
window :Window
-
A Window instance linked to this Character.
Type:
Methods
-
agentResearch()
-
Return a list of agents research information for a character. The formula for finding the current research points with an agent is: currentPoints = remainderPoints + pointsPerDay * days(currentTime - researchStartDate). This route is cached for up to 3600 seconds.
This makes an HTTP GET request to
/characters/{character_id}/agents_research/
. The route version isv1
.On success, this resolves to a list of agents research information. An example result is:
[ { "agent_id": 3009358, "points_per_day": 53.5346162146776, "remainder_points": 53604.0634303189, "skill_type_id": 11450, "started_at": "2017-03-23T14:47:00Z" } ]
This function must be used with an SSO token that has the following scopes:
esi-characters.read_agents_research.v1
Returns:
A Promise that resolves to the parsed JSON of the response.
- Type
- Promise.<Array.<Object>>
-
assets()
-
Return a list of the characters assets. This route is cached for up to 3600 seconds.
This makes an HTTP GET request to
/characters/{character_id}/assets/
. The route version isv1
.On success, this resolves to a flat list of the users assets. An example result is:
[ { "is_singleton": true, "item_id": 1000000016835, "location_flag": "Hangar", "location_id": 60002959, "location_type": "station", "quantity": 0, "type_id": 3516 } ]
This function must be used with an SSO token that has the following scopes:
esi-assets.read_assets.v1
Returns:
A Promise that resolves to the parsed JSON of the response.
- Type
- Promise.<Array.<Object>>
-
blueprints()
-
Return a list of blueprints the character has. This route is cached for up to 3600 seconds.
This makes an HTTP GET request to
/characters/{character_id}/blueprints/
. The route version isv1
.On success, this resolves to a list of blueprints. An example result is:
[ { "item_id": 1000000010495, "location_flag": "Hangar", "location_id": 60014719, "material_efficiency": 0, "quantity": 1, "runs": -1, "time_efficiency": 0, "type_id": 691 } ]
This function must be used with an SSO token that has the following scopes:
esi-characters.read_blueprints.v1
Returns:
A Promise that resolves to the parsed JSON of the response.
- Type
- Promise.<Array.<Object>>
-
chatChannels()
-
Return chat channels that a character is the owner or an operator of. This route is cached for up to 300 seconds.
This makes an HTTP GET request to
/characters/{character_id}/chat_channels/
. The route version isv1
.On success, this resolves to a list of chat channels. An example result is:
[ { "allowed": [ { "accessor_id": 0, "accessor_type": "accessor_type string" } ], "blocked": [ { "accessor_id": 0, "accessor_type": "accessor_type string", "end_at": "Time at which this accessor will no longer be blocked", "reason": "Reason this accessor is blocked" } ], "channel_id": -69329950, "comparison_key": "players'haven", "has_password": false, "motd": "<b>Feed pineapples to the cats!</b>", "muted": [ { "accessor_id": 0, "accessor_type": "accessor_type string", "end_at": "Time at which this accessor will no longer be muted", "reason": "Reason this accessor is muted" } ], "name": "Players' Haven", "operators": [ { "accessor_id": 0, "accessor_type": "accessor_type string" } ], "owner_id": 95578451 } ]
This function must be used with an SSO token that has the following scopes:
esi-characters.read_chat_channels.v1
Returns:
A Promise that resolves to the parsed JSON of the response.
- Type
- Promise.<Array.<Object>>
-
clones()
-
A list of the character's clones. This route is cached for up to 120 seconds.
This makes an HTTP GET request to
/characters/{character_id}/clones/
. The route version isv2
.On success, this resolves to clone information for the given character. An example result is:
{ "home_location": { "location_id": 1021348135816, "location_type": "structure" }, "jump_clones": [ { "implants": [ 22118 ], "location_id": 60003463, "location_type": "station" } ], "last_jump_date": "" }
This function must be used with an SSO token that has the following scopes:
esi-clones.read_clones.v1
Returns:
A Promise that resolves to the parsed JSON of the response.
- Type
- Promise.<Object>
-
fleet(id)
-
Get a Fleet instance for the given fleet
id
.Parameters:
Name Type Description id
The fleet id this character belongs to.
Returns:
- Type
- Fleet
-
industryJobs(includeCompleted)
-
List industry jobs placed by a character. This route is cached for up to 300 seconds.
This makes an HTTP GET request to
/characters/{character_id}/industry/jobs/
. The route version isv1
.On success, this resolves to industry jobs placed by a character. An example result is:
[ { "activity_id": 1, "blueprint_id": 1015116533326, "blueprint_location_id": 60006382, "blueprint_type_id": 2047, "completed_character_id": 0, "completed_date": "", "cost": 118, "duration": 548, "end_date": "2014-07-19T15:56:14Z", "facility_id": 60006382, "installer_id": 498338451, "job_id": 229136101, "licensed_runs": 200, "output_location_id": 60006382, "pause_date": "", "probability": 0, "product_type_id": 0, "runs": 1, "start_date": "2014-07-19T15:47:06Z", "station_id": 60006382, "status": "active", "successful_runs": 0 } ]
This function must be used with an SSO token that has the following scopes:
esi-industry.read_character_jobs.v1
Parameters:
Name Type Default Description includeCompleted
Boolean false Whether retrieve completed character industry jobs as well.
Returns:
A Promise that resolves to the parsed JSON of the response.
- Type
- Promise.<Array.<Object>>
-
killmails()
-
Get all killmails, over all of history, for the given character. This makes multiple calls to recentKillmails. This should be used with caution as some characters may have a very large number of kills.
Returns:
- Type
- Promise.<Array.<Object>>
-
kills()
-
Get all kill, over all of history, for the given character. This makes multiple calls to recentKills. This should be used with caution as some characters may have a very large number of kills.
Returns:
- Type
- Promise.<Array.<Object>>
-
location()
-
Information about the characters current location. Returns the current solar system id, and also the current station or structure ID if applicable. This route is cached for up to 5 seconds.
This makes an HTTP GET request to
/characters/{character_id}/location/
. The route version isv1
.On success, this resolves to information about the characters current location. Returns the current solar system id, and also the current station or structure ID if applicable. An example result is:
{ "solar_system_id": 30002505, "station_id": 0, "structure_id": 1000000016989 }
This function must be used with an SSO token that has the following scopes:
esi-location.read_location.v1
Returns:
A Promise that resolves to the parsed JSON of the response.
- Type
- Promise.<Object>
-
loyaltyPoints()
-
Return a list of loyalty points for all corporations the character has worked for.
This makes an HTTP GET request to
/characters/{character_id}/loyalty/points/
. The route version isv1
.On success, this resolves to a list of loyalty points. An example result is:
[ { "corporation_id": 123, "loyalty_points": 100 } ]
This function must be used with an SSO token that has the following scopes:
esi-characters.read_loyalty.v1
Returns:
A Promise that resolves to the parsed JSON of the response.
- Type
- Promise.<Array.<Object>>
-
medals()
-
Return a list of medals the character has. This route is cached for up to 3600 seconds.
This makes an HTTP GET request to
/characters/{character_id}/medals/
. The route version isv1
.On success, this resolves to a list of medals. An example result is:
[ { "corporation_id": 98000001, "date": "2017-03-16T15:01:45Z", "description": "For 33 corp!", "graphics": [ { "color": -1, "graphic": "gallente.1_1", "layer": 0, "part": 1 } ], "issuer_id": 2112000002, "medal_id": 3, "reason": "Thanks!", "status": "private", "title": "33 tester medal" } ]
This function must be used with an SSO token that has the following scopes:
esi-characters.read_medals.v1
Returns:
A Promise that resolves to the parsed JSON of the response.
- Type
- Promise.<Array.<Object>>
-
online()
-
Checks if the character is currently online. This route is cached for up to 60 seconds.
This makes an HTTP GET request to
/characters/{character_id}/online/
. The route version isv1
.On success, this resolves to boolean of if the character is currently online.
This function must be used with an SSO token that has the following scopes:
esi-location.read_online.v1
Returns:
A Promise that resolves to the parsed JSON of the response.
- Type
- Promise.<Boolean>
-
opportunities()
-
Return a list of tasks finished by a character. This route is cached for up to 3600 seconds.
This makes an HTTP GET request to
/characters/{character_id}/opportunities/
. The route version isv1
.On success, this resolves to a list of opportunities task ids. An example result is:
[ { "completed_at": "2016-04-29T12:34:56Z", "task_id": 1 } ]
This function must be used with an SSO token that has the following scopes:
esi-characters.read_opportunities.v1
Returns:
A Promise that resolves to the parsed JSON of the response.
- Type
- Promise.<Array.<Object>>
-
orders()
-
List market orders placed by a character. This route is cached for up to 3600 seconds.
This makes an HTTP GET request to
/characters/{character_id}/orders/
. The route version isv1
.On success, this resolves to market orders placed by a character. An example result is:
[ { "account_id": 1000, "duration": 30, "escrow": 45.6, "is_buy_order": true, "is_corp": false, "issued": "2016-09-03T05:12:25Z", "location_id": 456, "min_volume": 1, "order_id": 123, "price": 33.3, "range": "station", "region_id": 123, "state": "open", "type_id": 456, "volume_remain": 4422, "volume_total": 123456 } ]
This function must be used with an SSO token that has the following scopes:
esi-markets.read_character_orders.v1
Returns:
A Promise that resolves to the parsed JSON of the response.
- Type
- Promise.<Array.<Object>>
-
recentKillmails(maxKillId)
-
Return a list of character's recent kills and losses. This route is cached for up to 120 seconds.
This makes an HTTP GET request to
/characters/{character_id}/killmails/recent/
. The route version isv1
.This function invokes the route with
max_count
set to50
.On success, this resolves to a list of killmail IDs and hashes. An example result is:
[ { "killmail_hash": "8eef5e8fb6b88fe3407c489df33822b2e3b57a5e", "killmail_id": 2 } ]
This function must be used with an SSO token that has the following scopes:
esi-killmails.read_killmails.v1
Parameters:
Name Type Default Description maxKillId
Number 0 Only return killmails with ID smaller than this. If
0
, the most recent killmails are returned.- See:
Returns:
A Promise that resolves to the parsed JSON of the response.
- Type
- Promise.<Array.<Object>>
-
recentKills(maxKillId)
-
Get the kill details for the recent recentKillmails and then uses Killmail#get to map the details. The request resolves to an array, each containing a killmail detail.
Parameters:
Name Type Default Description maxKillId
Number 0 Optional; the mail id that limits which mails can be returned. If provided recent mails older than the id are returned
Returns:
- Type
- Promise.<Array.<Object>>
-
roles()
-
Returns a character's corporation roles. This route is cached for up to 3600 seconds.
This makes an HTTP GET request to
/characters/{character_id}/roles/
. The route version isv1
.On success, this resolves to the character's roles in thier corporation.
This function must be used with an SSO token that has the following scopes:
esi-characters.read_corporation_roles.v1
Returns:
A Promise that resolves to the parsed JSON of the response.
- Type
- Promise.<Array.<String>>
-
ship()
-
Get the current ship type, name and id. This route is cached for up to 5 seconds.
This makes an HTTP GET request to
/characters/{character_id}/ship/
. The route version isv1
.On success, this resolves to get the current ship type, name and id. An example result is:
{ "ship_item_id": 1000000016991, "ship_name": "SPACESHIPS!!!", "ship_type_id": 1233 }
This function must be used with an SSO token that has the following scopes:
esi-location.read_ship_type.v1
Returns:
A Promise that resolves to the parsed JSON of the response.
- Type
- Promise.<Object>
-
skillqueue()
-
List the configured skill queue for the given character. This route is cached for up to 120 seconds.
This makes an HTTP GET request to
/characters/{character_id}/skillqueue/
. The route version isv2
.On success, this resolves to the current skill queue, sorted ascending by finishing time. An example result is:
[ { "finish_date": "2016-06-29T10:47:00Z", "finished_level": 3, "level_end_sp": 0, "level_start_sp": 0, "queue_position": 0, "skill_id": 1, "start_date": "2016-06-29T10:46:00Z", "training_start_sp": 0 } ]
This function must be used with an SSO token that has the following scopes:
esi-skills.read_skillqueue.v1
Returns:
A Promise that resolves to the parsed JSON of the response.
- Type
- Promise.<Array.<Object>>
-
skills()
-
List all trained skills for the given character. This route is cached for up to 120 seconds.
This makes an HTTP GET request to
/characters/{character_id}/skills/
. The route version isv3
.On success, this resolves to known skills for the character. An example result is:
{ "skills": [ { "current_skill_level": 1, "skill_id": 1, "skillpoints_in_skill": 10000 } ], "total_sp": 20000 }
This function must be used with an SSO token that has the following scopes:
esi-skills.read_skills.v1
Returns:
A Promise that resolves to the parsed JSON of the response.
- Type
- Promise.<Object>
-
standings()
-
Return character standings from agents, NPC corporations, and factions. This route is cached for up to 3600 seconds.
This makes an HTTP GET request to
/characters/{character_id}/standings/
. The route version isv1
.On success, this resolves to a list of standings. An example result is:
[ { "from_id": 3009841, "from_type": "agent", "standing": 0.1 } ]
This function must be used with an SSO token that has the following scopes:
esi-characters.read_standings.v1
Returns:
A Promise that resolves to the parsed JSON of the response.
- Type
- Promise.<Array.<Object>>
-
wallets()
-
List your wallets and their balances. Characters typically have only one wallet, with wallet_id 1000 being the master wallet. This route is cached for up to 120 seconds.
This makes an HTTP GET request to
/characters/{character_id}/wallets/
. The route version isv1
.On success, this resolves to wallet data for selected user. An example result is:
[ { "balance": 295000, "wallet_id": 1000 } ]
This function must be used with an SSO token that has the following scopes:
esi-wallet.read_character_wallet.v1
Returns:
A Promise that resolves to the parsed JSON of the response.
- Type
- Promise.<Array.<Object>>