1. Go to this page and download the library: Download seatplus/esi-schema library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
seatplus / esi-schema example snippets
// Without this package
$response = $httpClient->get("https://esi.evetech.net/characters/{$characterId}/assets/");
$items = json_decode((string) $response->getBody(), true);
foreach ($items as $item) {
$item['type_id']; // int? string? is the key even present?
}
// And the things you actually need to know before calling:
// Which OAuth scope does this
use Seatplus\EsiSchema\Resources\Assets\GetCharactersCharacterIdAssets;
// Known before you make the call — no instance, no network, no allocation
GetCharactersCharacterIdAssets::REQUIRED_SCOPE; // 'esi-assets.read_assets.v1'
GetCharactersCharacterIdAssets::CACHE_AGE; // 3600
GetCharactersCharacterIdAssets::RATE_LIMIT_GROUP; // 'char-asset'
GetCharactersCharacterIdAssets::REQUIRED_ROLES; // []
$result = GetCharactersCharacterIdAssets::execute($transport, characterId: $characterId);
foreach ($result->data as $item) {
$item->type_id; // int — your IDE autocompletes it, PHPStan checks it
$item->quantity; // int
}
$result->pages; // int, from the X-Pages header
$result->isCachedLoad; // bool, true when served from cache
use Seatplus\EsiSchema\Resources\Assets\GetCharactersCharacterIdAssets;
use Seatplus\EsiSchema\Resources\Market\GetMarketsPrices;
// 1. Pre-call introspection — no transport needed
$meta = GetCharactersCharacterIdAssets::meta();
$meta->Cursor; // false
// Or access constants directly — no allocation at all
GetCharactersCharacterIdAssets::REQUIRED_SCOPE; // 'esi-assets.read_assets.v1'
GetCharactersCharacterIdAssets::RATE_LIMIT_GROUP; // 'char-asset'
GetCharactersCharacterIdAssets::RATE_LIMIT_MAX_TOKENS; // 1800
GetCharactersCharacterIdAssets::CACHE_AGE; // 3600
// Check a token before dispatching a job
if ($meta->
use Seatplus\EsiSchema\Resources\AssetsResource;
use Seatplus\EsiSchema\Resources\CharacterResource;
// Construct with any EsiTransportInterface
$assets = new AssetsResource($transport);
$characters = new CharacterResource($transport);
// Same parameters, same return types as the static API
$result = $assets->getCharactersCharacterIdAssets(characterId: 12345, page: 1);
$dto = $characters->getCharactersCharacterId(characterId: 12345);
// With esi-client (EsiClient implements EsiTransportInterface):
$result = $esiClient->withToken($accessToken)->assets()->getCharactersCharacterIdAssets(12345, page: 1);
use Seatplus\EsiSchema\Resources\Assets\GetCharactersCharacterIdAssets;
class CharacterAssetJob extends EsiJob
{
public function __construct(
public readonly int $characterId,
public readonly RefreshToken $token,
) {}
// EsiJob base reads this to get scope, rate-limit group, etc.
protected const string OPERATION = GetCharactersCharacterIdAssets::class;
protected function executeJob(EsiTransportInterface $transport): void
{
$result = GetCharactersCharacterIdAssets::execute(
$transport, $this->characterId
);
if ($result->isCachedLoad) return;
Asset::upsert(/* ... */);
}
}
use Seatplus\EsiSchema\Contracts\EsiTransportInterface;
use Seatplus\EsiSchema\Contracts\EsiRawResponse;
class MyTransport implements EsiTransportInterface
{
public function invoke(
string $method,
string $path,
array $pathValues = [],
array $queryParams = [],
array $requestBody = [],
): EsiRawResponse {
// ... perform the HTTP request, handle caching, auth etc.
return new EsiRawResponse(
data: $responseBody, // decoded JSON (mixed)
isCachedLoad: $wasCached, // bool
pages: $xPagesHeader ?? 1, // int
rateLimitRemaining: $remaining,
rateLimitUsed: $used,
retryAfter: $retryAfter, // null unless 429
);
}
}
public const ?string REQUIRED_SCOPE = 'esi-assets.read_assets.v1';
public const ?string RATE_LIMIT_GROUP = 'char-asset';
public const ?int RATE_LIMIT_MAX_TOKENS = 1800;
public const ?string RATE_LIMIT_WINDOW = '15m';
public const ?int CACHE_AGE = 3600;
public const array REQUIRED_ROLES = [];
public const bool USES_CURSOR = false;
use Seatplus\EsiSchema\GeneratedSpec;
GeneratedSpec::COMPATIBILITY_DATE; // '2026-05-19'
GeneratedSpec::COMPATIBILITY_DATE_HEADER; // 'X-Compatibility-Date'
bash
php bin/generate.php --compatibility-date=2026-05-19
vendor/bin/pint # generated output is raw; format it afterwards