eve_esi 0.3.0

Rust API wrapper for EVE Online's ESI & OAuth2.
Documentation

EVE ESI

Rust API wrapper for interaction with EVE Online's ESI.

Usage

Create a new EsiClient instance and request public information about a character from ESI.

#[tokio::main]
async fn main() {
    let esi_client = eve_esi::EsiClient::builder()
        .user_agent("MyApp/1.0 (contact@example.com)")
        .build()
        .expect("Failed to build EsiClient");

    // Get information about the corporation The Order of Autumn (id: 98785281)
    let corporation = esi_client.corporation().get_corporation_information(98785281).await.unwrap();
    println!("Corporation name: {}", corporation.name);
}

Make certain you set the user agent as demonstrated above, ensure it includes contact email in case there are any issues with your ESI requests.

Examples

Axum

A basic example demonstrating how to use the eve_esi crate with the axum web framework to create an API that serves ESI data.

  1. Run cargo run --example axum
  2. Head to one of the URLs posted in your terminal, change the IDs to test out different characters/corporations.

SSO

An example demonstrating how to use the eve_esi crate with the axum web framework to utilize EVE SSO authentication to login with EVE Online. This is a prerequisite for accessing private ESI routes.

  1. Create a developer application on EVE Online's Developer Portal
  2. Set the callback URL to http://localhost:8080/callback
  3. Copy .env.example to .env and set the CALLBACK_URL, EVE_ESI_CLIENT_ID, EVE_ESI_CLIENT_SECRET, & CONTACT_EMAIL variables
  4. Run cargo run --example sso
  5. Go to http://localhost:8080/login in your browser
  6. Follow the login process, once authorized you'll be shown your character's information.

Notes

  • More ESI routes will be added as needed, feel free to submit pull requests to add any you may need.
  • You can override the esi_url for the ESI Client by simply using esi_client.esi_url = "http://your_url.com" for use cases such as unit tests with crates such as mockito to emulate endpoints. See this repository's tests folder for examples.