Retrieve Character ID from Character Name

Hi

I think I might be missing something really simple but I’ve spent all day reading the ESI documentation and I can’t help but feel there is something missing.

I want to retrieve the portraits of pilots to display them on my EVE Cemetery website but the call to retrieve the portraits requires a character ID. I only have the character names, how do I get the ID from the character name?

The route appears in the old API here:
http://wiki.eve-id.net/APIv2_Eve_CharacterID_XML

Is this an oversight or am I just being stupid?

Assuming you just have a random character_id and not their token or something:

One of those would work. Also checkout https://developers.eveonline.com/blog/article/from-image-server-to-a-whole-new-image-service-1.

you can get the character id from the name of the character, using the search path.

May be of some use, if you want to run it through google sheets. Or just want an example of someone using it.

Thanks! This was the solution I used in the end.

I think I was going code blind and totally missed the search route.

This was the method I’ve used:

private function getCharacterIDbyName(string $character="Azia Burgi"){

    $name=urlencode($character);

    $url="https://esi.evetech.net/latest/search/?categories=character&search={$name}";

    $resp_json=file_get_contents($url);

    $response=json_decode($resp_json, true);

    if(count($response)==0){
        $id=false;
    }else{
        $id=$response['character'][0];
    }

    return $id;
}

I have noticed some weirdness being returned (404s for characters without a post-incursion face) and possibly deleted characters. I don’t suppose that there anywhere that retained the pre-incursion portraits?

Thanks again

The ccp hosted site of the old portraits went down back in 2013. They are available as a dump on the toolkit page

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.