Skip to content

localisprimary/esi

Repository files navigation

@localisprimary/esi

A slightly opinionated TypeScript client for the EVE Online API.

NPM Version NPM Downloads Discord

Usage

import { EsiClient } from '@localisprimary/esi'

// Create client (optionally with auth token)
const esi = new EsiClient({ userAgent: 'foo@example.com', token: 'bearer-token' })

// Get all alliances
const alliances = await esi.getAlliances()
console.log(alliances.data)

// Get specific alliance by ID
const alliance = await esi.getAlliance({ alliance_id: 123 })
console.log(alliance.data)

Options

The EsiClient constructor requires an options object with the following properties:

Parameter Description Type Default Required
userAgent Resolves to "localisprimary/esi <userAgent>" string Yes
token Optional auth token string undefined No
useRequestHeaders If false, use query parameters for userAgent and token boolean true No

Methods

This client provides methods for all EVE ESI endpoints. Methods return a Promise that resolves to an EsiResponse<T> or throws an EsiError.

interface EsiResponse<TData, THeaders = Record<string, string>> {
  data: TData;
  status: number;
  headers: THeaders;
}

interface EsiError {
  error: string;
  status: number;
}

All methods are fully typed: getAlliance will take GetAllianceParams and return GetAllianceResponse.

Params types make no distinction between path, query, or body parameters, it's all the same object:

const esi = new EsiClient({ userAgent: 'foo@example.com', token: 'bearer-token' })

// POST https://esi.evetech.net/characters/{character_id}/mail
esi.postCharacterMail({
  // character_id path parameter
  character_id: 91884358,

  // request body
  approved_cost: 0,
  body: "Hello from the ESI!",
  recipients: [{ recipient_type: 'character', recipient_id: 96135698 }]
})
Method Description
getAlliance Public information about an alliance
getAllianceContacts Return contacts of an alliance
getAllianceContactsLabels Return custom labels for an alliance's contacts
getAllianceCorporations List all current member corporations of an alliance
getAllianceIcons Get the icon urls for a alliance. This route expires daily at 11:05
getAlliances List all active player alliances
getCharacter Public information about a character
getCharacterAgentsResearch 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)
getCharacterAssets Return a list of the characters assets
postCharacterAssetsLocations Return locations for a set of item ids, which you can get from character assets endpoint. Coordinates for items in hangars or stations are set to (0,0,0)
postCharacterAssetsNames Return names for a set of item ids, which you can get from character assets endpoint. Typically used for items that can customize names, like containers or ships.
getCharacterAttributes Return attributes of a character
getCharacterBlueprints Return a list of blueprints the character owns
getCharacterCalendar Get 50 event summaries from the calendar. If no from_event ID is given, the resource will return the next 50 chronological event summaries from now. If a from_event ID is specified, it will return the next 50 chronological event summaries from after that event
getCharacterCalendarEventAttendees Get all invited attendees for a given event
getCharacterCalendarEventId Get all the information for a specific event
putCharacterCalendarEventId Set your response status to an event
getCharacterClones A list of the character's clones
deleteCharacterContacts Bulk delete contacts
getCharacterContacts Return contacts of a character
postCharacterContacts Bulk add contacts with same settings
putCharacterContacts Bulk edit contacts with same settings
getCharacterContactsLabels Return custom labels for a character's contacts
getCharacterContractBids Lists bids on a particular auction contract
getCharacterContractItems Lists items of a particular contract
getCharacterContracts Returns contracts available to a character, only if the character is issuer, acceptor or assignee. Only returns contracts no older than 30 days, or if the status is "in_progress".
getCharacterCorporationhistory Get a list of all the corporations a character has been a member of
postCharacterCspa Takes a source character ID in the url and a set of target character ID's in the body, returns a CSPA charge cost
getCharacterFatigue Return a character's jump activation and fatigue information
deleteCharacterFitting Delete a fitting from a character
getCharacterFittings Return fittings of a character
postCharacterFittings Save a new fitting for a character
getCharacterFleet Return the fleet ID the character is in, if any.
getCharacterFwStats Statistical overview of a character involved in faction warfare. This route expires daily at 11:05
getCharacterImplants Return implants on the active clone of a character
getCharacterIndustryJobs List industry jobs placed by a character
getCharacterKillmailsRecent Return a list of a character's kills and losses going back 90 days
getCharacterLocation Information about the characters current location. Returns the current solar system id, and also the current station or structure ID if applicable
getCharacterLoyaltyPoints Return a list of loyalty points for all corporations the character has worked for
getCharacterMail Return the 50 most recent mail headers belonging to the character that match the query criteria. Queries can be filtered by label, and last_mail_id can be used to paginate backwards
postCharacterMail Create and send a new mail
deleteCharacterMailLabel Delete a mail label
getCharacterMailLabels Return a list of the users mail labels, unread counts for each label and a total unread count.
postCharacterMailLabels Create a mail label
getCharacterMailLists Return all mailing lists that the character is subscribed to
deleteCharacterMailMailId Delete a mail
getCharacterMailMailId Return the contents of an EVE mail
putCharacterMailMailId Update metadata about a mail
getCharacterMedals Return a list of medals the character has
getCharacterMining Paginated record of all mining done by a character for the past 30 days
getCharacterNotifications Return character notifications
getCharacterNotificationsContacts Return notifications about having been added to someone's contact list
getCharacterOnline Checks if the character is currently online
getCharacterOrders List open market orders placed by a character
getCharacterOrdersHistory List cancelled and expired market orders placed by a character up to 90 days in the past.
getCharacterPlanet Returns full details on the layout of a single planetary colony, including links, pins and routes. Note: Planetary information is only recalculated when the colony is viewed through the client. Information will not update until this criteria is met.
getCharacterPlanets Returns a list of all planetary colonies owned by a character.
getCharacterPortrait Get portrait urls for a character. This route expires daily at 11:05
getCharacterRoles Returns a character's corporation roles
postCharactersAffiliation Bulk lookup of character IDs to corporation, alliance and faction
getCharacterSearch Search for entities that match a given sub-string.
getCharacterShip Get the current ship type, name and id
getCharacterSkillqueue List the configured skill queue for the given character
getCharacterSkills List all trained skills for the given character
getCharacterStandings Return character standings from agents, NPC corporations, and factions
getCharacterTitles Returns a character's titles
getCharacterWallet Returns a character's wallet balance
getCharacterWalletJournal Retrieve the given character's wallet journal going 30 days back
getCharacterWalletTransactions Get wallet transactions of a character
getContractsPublicBids Lists bids on a public auction contract
getContractsPublicItems Lists items of a public contract
getContractsPublicRegionId Returns a paginated list of all public contracts in the given region
getCorporation Public information about a corporation
getCorporationAlliancehistory Get a list of all the alliances a corporation has been a member of
getCorporationAssets Return a list of the corporation assets
postCorporationAssetsLocations Return locations for a set of item ids, which you can get from corporation assets endpoint. Coordinates for items in hangars or stations are set to (0,0,0)
postCorporationAssetsNames Return names for a set of item ids, which you can get from corporation assets endpoint. Only valid for items that can customize names, like containers or ships
getCorporationBlueprints Returns a list of blueprints the corporation owns
getCorporationContacts Return contacts of a corporation
getCorporationContactsLabels Return custom labels for a corporation's contacts
getCorporationContainersLogs Returns logs recorded in the past seven days from all audit log secure containers (ALSC) owned by a given corporation
getCorporationContractBids Lists bids on a particular auction contract
getCorporationContractItems Lists items of a particular contract
getCorporationContracts Returns contracts available to a corporation, only if the corporation is issuer, acceptor or assignee. Only returns contracts no older than 30 days, or if the status is "in_progress".
getCorporationCorporationMiningExtractions Extraction timers for all moon chunks being extracted by refineries belonging to a corporation.
getCorporationCorporationMiningObserver Paginated record of all mining seen by an observer
getCorporationCorporationMiningObservers Paginated list of all entities capable of observing and recording mining for a corporation
getCorporationCustomsOffices List customs offices owned by a corporation
getCorporationDivisions Return corporation hangar and wallet division names, only show if a division is not using the default name
getCorporationFacilities Return a corporation's facilities
getCorporationFwStats Statistics about a corporation involved in faction warfare. This route expires daily at 11:05
getCorporationIcons Get the icon urls for a corporation
getCorporationIndustryJobs List industry jobs run by a corporation
getCorporationKillmailsRecent Get a list of a corporation's kills and losses going back 90 days
getCorporationMedals Returns a corporation's medals
getCorporationMedalsIssued Returns medals issued by a corporation
getCorporationMembers Return the current member list of a corporation, the token's character need to be a member of the corporation.
getCorporationMembersLimit Return a corporation's member limit, not including CEO himself
getCorporationMembersTitles Returns a corporation's members' titles
getCorporationMembertracking Returns additional information about a corporation's members which helps tracking their activities
getCorporationOrders List open market orders placed on behalf of a corporation
getCorporationOrdersHistory List cancelled and expired market orders placed on behalf of a corporation up to 90 days in the past.
getCorporationRoles Return the roles of all members if the character has the personnel manager role or any grantable role.
getCorporationRolesHistory Return how roles have changed for a coporation's members, up to a month
getCorporationShareholders Return the current shareholders of a corporation.
getCorporationsNpccorps Get a list of npc corporations. This route expires daily at 11:05
getCorporationStandings Return corporation standings from agents, NPC corporations, and factions
getCorporationStarbase Returns various settings and fuels of a starbase (POS)
getCorporationStarbases Returns list of corporation starbases (POSes)
getCorporationStructures Get a list of corporation structures. This route's version includes the changes to structures detailed in this blog: https://www.eveonline.com/article/upwell-2.0-structures-changes-coming-on-february-13th
getCorporationTitles Returns a corporation's titles
getCorporationWallets Get a corporation's wallets
getCorporationWalletsDivisionJournal Retrieve the given corporation's wallet journal for the given division going 30 days back
getCorporationWalletsDivisionTransactions Get wallet transactions of a corporation
getDogmaAttribute Get information on a dogma attribute. This route expires daily at 11:05
getDogmaAttributes Get a list of dogma attribute ids. This route expires daily at 11:05
getDogmaDynamicTypeItemId Returns info about a dynamic item resulting from mutation with a mutaplasmid. This route expires daily at 11:05
getDogmaEffect Get information on a dogma effect. This route expires daily at 11:05
getDogmaEffects Get a list of dogma effect ids. This route expires daily at 11:05
getFleet Return details about a fleet
putFleet Update settings about a fleet
deleteFleetMember Kick a fleet member
putFleetMember Move a fleet member around
getFleetMembers Return information about fleet members
postFleetMembers Invite a character into the fleet. If a character has a CSPA charge set it is not possible to invite them to the fleet using ESI
deleteFleetSquad Delete a fleet squad, only empty squads can be deleted
putFleetSquad Rename a fleet squad
deleteFleetWing Delete a fleet wing, only empty wings can be deleted. The wing may contain squads, but the squads must be empty
putFleetWing Rename a fleet wing
getFleetWings Return information about wings in a fleet
postFleetWings Create a new wing in a fleet
postFleetWingSquads Create a new squad in a fleet
getFwLeaderboards Top 4 leaderboard of factions for kills and victory points separated by total, last week and yesterday. This route expires daily at 11:05
getFwLeaderboardsCharacters Top 100 leaderboard of pilots for kills and victory points separated by total, last week and yesterday. This route expires daily at 11:05
getFwLeaderboardsCorporations Top 10 leaderboard of corporations for kills and victory points separated by total, last week and yesterday. This route expires daily at 11:05
getFwStats Statistical overviews of factions involved in faction warfare. This route expires daily at 11:05
getFwSystems An overview of the current ownership of faction warfare solar systems
getFwWars Data about which NPC factions are at war. This route expires daily at 11:05
getIncursions Return a list of current incursions
getIndustryFacilities Return a list of industry facilities
getIndustrySystems Return cost indices for solar systems
getInsurancePrices Return available insurance levels for all ship types
getKillmailKillmailHash Return a single killmail from its ID and hash
getLoyaltyCorporationOffers Return a list of offers from a specific corporation's loyalty store. This route expires daily at 11:05
getMarketsGroups Get a list of item groups. This route expires daily at 11:05
getMarketsGroupsMarketGroupId Get information on an item group. This route expires daily at 11:05
getMarketsPrices Return a list of prices
getMarketsStructure Return all orders in a structure
getMetaChangelog Get the changelog of this API.
getMetaCompatibilityDates Get a list of compatibility dates.
getRegionHistory Return a list of historical market statistics for the specified type in a region. This route expires daily at 11:05
getRegionOrders Return a list of orders in a region
getRegionTypes Return a list of type IDs that have active orders in the region, for efficient market indexing.
getRouteOriginDestination Get the systems between origin and destination
getSovereigntyCampaigns Shows sovereignty data for campaigns.
getSovereigntyMap Shows sovereignty information for solar systems
getSovereigntyStructures Shows sovereignty data for structures.
getStatus EVE Server status
postUiAutopilotWaypoint Set a solar system as autopilot waypoint
postUiOpenwindowContract Open the contract window inside the client
postUiOpenwindowInformation Open the information window for a character, corporation or alliance inside the client
postUiOpenwindowMarketdetails Open the market details window for a specific typeID inside the client
postUiOpenwindowNewmail Open the New Mail window, according to settings from the request if applicable
getUniverseAncestries Get all character ancestries. This route expires daily at 11:05
getUniverseAsteroidBeltsAsteroidBeltId Get information on an asteroid belt. This route expires daily at 11:05
getUniverseBloodlines Get a list of bloodlines. This route expires daily at 11:05
getUniverseCategories Get a list of item categories. This route expires daily at 11:05
getUniverseCategory Get information of an item category. This route expires daily at 11:05
getUniverseConstellation Get information on a constellation. This route expires daily at 11:05
getUniverseConstellations Get a list of constellations. This route expires daily at 11:05
getUniverseFactions Get a list of factions. This route expires daily at 11:05
getUniverseGraphic Get information on a graphic. This route expires daily at 11:05
getUniverseGraphics Get a list of graphics. This route expires daily at 11:05
getUniverseGroup Get information on an item group. This route expires daily at 11:05
getUniverseGroups Get a list of item groups. This route expires daily at 11:05
postUniverseIds Resolve a set of names to IDs in the following categories: agents, alliances, characters, constellations, corporations factions, inventory_types, regions, stations, and systems. Only exact matches will be returned. All names searched for are cached for 12 hours
getUniverseMoon Get information on a moon. This route expires daily at 11:05
postUniverseNames Resolve a set of IDs to names and categories. Supported ID's for resolving are: Characters, Corporations, Alliances, Stations, Solar Systems, Constellations, Regions, Types, Factions
getUniversePlanet Get information on a planet. This route expires daily at 11:05
getUniverseRaces Get a list of character races. This route expires daily at 11:05
getUniverseRegion Get information on a region. This route expires daily at 11:05
getUniverseRegions Get a list of regions. This route expires daily at 11:05
getUniverseSchematic Get information on a planetary factory schematic
getUniverseStar Get information on a star. This route expires daily at 11:05
getUniverseStargate Get information on a stargate. This route expires daily at 11:05
getUniverseStation Get information on a station. This route expires daily at 11:05
getUniverseStructure Returns information on requested structure if you are on the ACL. Otherwise, returns "Forbidden" for all inputs.
getUniverseStructures List all public structures
getUniverseSystem Get information on a solar system. This route expires daily at 11:05
getUniverseSystemJumps Get the number of jumps in solar systems within the last hour ending at the timestamp of the Last-Modified header, excluding wormhole space. Only systems with jumps will be listed
getUniverseSystemKills Get the number of ship, pod and NPC kills per solar system within the last hour ending at the timestamp of the Last-Modified header, excluding wormhole space. Only systems with kills will be listed
getUniverseSystems Get a list of solar systems. This route expires daily at 11:05
getUniverseType Get information on a type. This route expires daily at 11:05
getUniverseTypes Get a list of type ids. This route expires daily at 11:05
getWar Return details about a war
getWarKillmails Return a list of kills related to a war
getWars Return a list of wars

BuyMeACoffee

About

Auto-generated TypeScript client for the EVE Online API

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •