Skip to content

Repository files navigation

ESI Integration for EVE Online

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

A Laravel package that integrates EVE Online's ESI API into your application. Every ESI endpoint is wrapped in a typed request class and returns fully typed, readonly DTOs — no juggling raw JSON arrays.

Features

  • Complete ESI coverage — every endpoint in ESI's OpenAPI specification is implemented, pinned to a specific compatibility date per release
  • Typed DTOs for every response — characters, corporations, alliances, assets, contracts, killmails, market data, industry, fleets, and more
  • Automatic OAuth token refresh for authenticated endpoints via your own Character / EsiToken implementations
  • Automatic pagination — multi-page endpoints are walked and merged into a single result set for you
  • No exceptions on HTTP errors — every call returns a typed EsiResult you inspect
  • Configurable retry policy with sensible defaults

Requirements

  • PHP 8.3+
  • Laravel 12 or 13

Installation

Install the package via composer:

composer require nicolaskion/eve

Publish the config file:

php artisan vendor:publish --tag="esi-config"

Set your ESI application credentials (only needed for authenticated endpoints — create an app at developers.eveonline.com):

EVE_CLIENT_ID=your-client-id
EVE_CLIENT_SECRET=your-client-secret

The config file lets you tweak the user agent, retry policy, base URL and ESI compatibility date.

Usage

Public endpoints

use NicolasKion\Esi\Facades\Esi;

$result = Esi::getStatus();

if ($result->wasSuccessful()) {
    $result->data->players; // e.g. 24_512
}

$alliance = Esi::getAlliance(434243723)->data;
$history = Esi::getMarketHistory(region_id: 10000002, type_id: 44992)->data;

Resolving names and IDs

// IDs to names
$names = Esi::getNames([95465499, 30000142])->data;

// Names to IDs, grouped by category
$ids = Esi::getIds(['CCP Bartender', 'Jita'])->data;
$ids->characters[0]->id; // 95465499
$ids->systems[0]->id;    // 30000142

Authenticated endpoints

Endpoints that require authentication accept a Character. Implement the NicolasKion\Esi\Interfaces\Character and NicolasKion\Esi\Interfaces\EsiToken interfaces on your models, and the package takes care of refreshing expired access tokens for you:

$assets = Esi::getAssets($character)->data;
$contacts = Esi::getCharacterContacts($character)->data;

Esi::setWaypoint($character, destination_id: 30000142);

Error handling

Every call returns an EsiResult. Nothing throws on HTTP errors:

$result = Esi::getCharacter(95465499);

if ($result->failed()) {
    $result->error->code; // e.g. 404
    $result->error->body;
}

Coverage & compatibility

This package implements every endpoint in ESI's OpenAPI specification, so there is no per-endpoint table to keep in sync — if it exists in ESI, there is a method for it. Method names follow the ESI operation they call (getCharacter, getCorporationWalletJournal, getMarketOrders, search, setWaypoint, …), and every one returns an EsiResult.

Each release is pinned to a specific ESI compatibility date, sent as the X-Compatibility-Date header, so responses stay stable as ESI evolves. The pinned date is configurable.

Testing

composer test

Run the suite with coverage:

composer test-coverage

Changelog

Please see CHANGELOG for more information on what has changed recently.

License

The MIT License (MIT). Please see License File for more information.

About

Laravel package that integrates EVE Online's ESI API — typed DTOs, OAuth token refresh, and pagination out of the box

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Sponsor this project

Packages

Contributors

Languages