Skip to content
localisprimaryPublic

About

Auto-generated TypeScript client for the EVE Online API

Resources

Stars

11 stars

Watchers

1 watching

Forks

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
cache Cache eligible GET responses using ESI Cache-Control boolean true No

Caching

The client caches successful GET responses when ESI returns a cacheable Cache-Control policy. Cache entries are shared by all EsiClient instances in the current JavaScript runtime and use an LRU limit of 1,000 entries. This works in browser tabs, Node.js processes, and warm Next.js server-function instances, but does not persist across reloads, cold starts, or server instances.

Fresh entries are returned without a network request. Stale entries are revalidated with ETag and If-None-Match when request headers are enabled; a 304 Not Modified response reuses the cached body. Set cache: false to always make a network request.

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
  subject: 'Test mail',
  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
getCharacterAccessList Get the details of an Access List.
getCharacterAccessLists Lists all Access Lists the character is Manager or Admin of.
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
getCharacterCalendarEvent Get all the information for a specific event
putCharacterCalendarEvent Set your response status to an event
getCharacterCalendarEventAttendees Get all invited attendees for a given 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
getCharacterCosmeticsSkinr Listing of all SKINR licenses you own
getCharacterCosmeticsSkinrComponents Listing of all SKINR component licenses you own
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.
getCharacterFreelanceJobParticipation Show your participation in a freelance job.
getCharacterFreelanceJobs Listing of all freelance jobs you are actively participating in.
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 Get the current location of a character, including the station or structure it is docked in.
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
deleteCharacterMailMessage Delete a mail
getCharacterMailMessage Return the contents of an EVE mail
putCharacterMailMessage Update metadata about a mail
getCharacterMedals Return a list of medals the character has
getCharacterMercenaryTacticalOperation Get the details of a Mercenary Tactical Operation.
getCharacterMercenaryTacticalOperations Listing of all Mercenary Tactical Operations for the character.
getCharacterMilitaryCampaignsObjectiveParticipation Show your participation in a military campaign objective.
getCharacterMilitaryCampaignsObjectives Listing of the military campaign objectives the character has participated in.
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 Get whether a character is online, and its login statistics.
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.
getCharacterParagonHubSkinr List the SKINR listings a character has posted on the Paragon Hub.
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 ship a character is currently in.
getCharacterSkillqueue List the configured skill queue for the given character. Entries that have their finish time in the past are completed, but aren't updated in the "/skills" route yet. This will happen the next time the character logs in.
getCharacterSkills List all trained skills for the given character. Skills returned by this route can be out-of-date if the character hasn't logged in since one or more skills completed training. Use the /skillqueue route to check for skills that completed training. Entries that are in the past need to be applied on top of this list to get an accurate view of the character's current skills.
getCharacterStandings Return character standings from agents, NPC corporations, and factions
getCharacterStructuresMercenaryDen Get the details of a Mercenary Den.
getCharacterStructuresMercenaryDens Listing of all Mercenary Dens.
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
getContractsPublicRegion 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".
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
getCorporationFreelanceJobParticipants Listing of all participants of a freelance job.
getCorporationFreelanceJobs Listing of all freelance jobs for your corporation.
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
getCorporationMiningExtractions Extraction timers for all moon chunks being extracted by refineries belonging to a corporation.
getCorporationMiningObserver Paginated record of all mining seen by an observer
getCorporationMiningObservers Paginated list of all entities capable of observing and recording mining for a corporation
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.
getCorporationProject Get the details of a corporation project.
getCorporationProjectContribution Show your contribution to a corporation project.
getCorporationProjectContributors Listing of all contributors to a corporation project.
getCorporationProjects Listing of all (active) corporation projects.
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
getCorporationStructuresSkyhook Get the details of a Skyhook.
getCorporationStructuresSkyhooks Listing of all Skyhooks.
getCorporationStructuresSovereigntyHub Get the details of a Sovereignty Hub.
getCorporationStructuresSovereigntyHubs Listing of all Sovereignty Hubs.
getCorporationTitles Returns a corporation's titles
getCorporationWalletJournal Retrieve the given corporation's wallet journal for the given division going 30 days back
getCorporationWallets Get a corporation's wallets
getCorporationWalletTransactions Get wallet transactions of a corporation
getCosmeticsSkinr All attributes of a SKINR license
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
getDogmaDynamicItem 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
getFreelanceJob Get the details of a freelance job. Jobs without an ACL (public jobs) does not require authentication. Jobs with an ACL requires authentication, and requires that the character is: - An active participant of the job, or - A freelance job manager for the corporation that owns the job.
getFreelanceJobs Listing of all public freelance jobs.
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
getKillmail 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
getMarketsGroup Get information on an item group. This route expires daily at 11:05
getMarketsGroups Get a list of item groups. 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.
getMetaName Get the name ESI is currently going by, plus the full and glorious history of every name it has ever had. The three letters have never once meant the same thing twice.
getMetaStatus Get the health status of each API route.
getMilitaryCampaign Get the details of a military campaign.
getMilitaryCampaignObjective Get the details of an objective of a military campaign.
getMilitaryCampaignObjectives Listing of all active, completed or expired objectives of a military campaign.
getMilitaryCampaigns Listing of all active military campaigns.
getParagonHubSkinr Browse the SKINR listings publicly available on the Paragon Hub.
getParagonHubSkinrAlliances Browse the SKINR listings on the Paragon Hub that are visible to the given alliance.
getParagonHubSkinrCharacters Browse the SKINR listings on the Paragon Hub that are visible to the given character.
getParagonHubSkinrCorporations Browse the SKINR listings on the Paragon Hub that are visible to the given corporation.
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.
postRoute Calculate the systems between the given origin and destination.
getSkyhooksRaidable Listing of all Skyhooks that currently or will shortly be raidable.
getSovereigntyCampaigns Shows sovereignty data for campaigns.
getSovereigntySystems Listing of sovereignty details for all K-space systems in New Eden.
getStatus Current status of the EVE Online cluster
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
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
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
getUniverseStructure Returns information on requested structure if you are on the ACL. Otherwise, returns "Forbidden" for all inputs.
getUniverseStructures List all public structures
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
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

11 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages