# Retrieve Character ID from Character Name

**URL:** <https://forums.eveonline.com/t/retrieve-character-id-from-character-name/258789>\
**Category:** Third Party Developers\
**Created:** [August 5, 2020, 3:31pm UTC](https://forums.eveonline.com/t/retrieve-character-id-from-character-name/258789 "2020-08-05T15:31:55Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Azia\_Burgi](https://sea1.discourse-cdn.com/eveonline/user_avatar/forums.eveonline.com/azia_burgi/32/219708_2.png) [@Azia\_Burgi](https://forums.eveonline.com/u/Azia_Burgi)\
**Post date:** [August 5, 2020, 3:31pm UTC](https://forums.eveonline.com/t/retrieve-character-id-from-character-name/258789/1 "2020-08-05T15:31:55Z")

</div>

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](http://wiki.eve-id.net/APIv2_Eve_CharacterID_XML)

Is this an oversight or am I just being stupid?

---

<div class="post-metadata">

**Author:** ![Blacksmoke16](https://sea1.discourse-cdn.com/eveonline/user_avatar/forums.eveonline.com/blacksmoke16/32/376589_2.png) [@Blacksmoke16](https://forums.eveonline.com/u/Blacksmoke16)\
**Post date:** [August 5, 2020, 7:44pm UTC](https://forums.eveonline.com/t/retrieve-character-id-from-character-name/258789/2 "2020-08-05T19:44:50Z")

</div>

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

- [https://esi.evetech.net/ui/#/Character/get\_characters\_character\_id](https://esi.evetech.net/ui/#/Character/get_characters_character_id)
- [https://esi.evetech.net/ui/#/Universe/post\_universe\_ids](https://esi.evetech.net/ui/#/Universe/post_universe_ids)

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

---

<div class="post-metadata">

**Author:** ![Anderson\_Geten](https://sea1.discourse-cdn.com/eveonline/user_avatar/forums.eveonline.com/anderson_geten/32/390041_2.png) [@Anderson\_Geten](https://forums.eveonline.com/u/Anderson_Geten)\
**Post date:** [August 5, 2020, 8:41pm UTC](https://forums.eveonline.com/t/retrieve-character-id-from-character-name/258789/3 "2020-08-05T20:41:47Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Steve\_Ronuken](https://sea1.discourse-cdn.com/eveonline/user_avatar/forums.eveonline.com/steve_ronuken/32/373894_2.png) [@Steve\_Ronuken](https://forums.eveonline.com/u/Steve_Ronuken)\
**Post date:** [August 5, 2020, 9:05pm UTC](https://forums.eveonline.com/t/retrieve-character-id-from-character-name/258789/4 "2020-08-05T21:05:25Z")

</div>

> <https://github.com/fuzzysteve/eve-googledocs-script/blob/master/esi-nameloader.gs>

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

---

<div class="post-metadata">

**Author:** ![Azia\_Burgi](https://sea1.discourse-cdn.com/eveonline/user_avatar/forums.eveonline.com/azia_burgi/32/219708_2.png) [@Azia\_Burgi](https://forums.eveonline.com/u/Azia_Burgi)\
**Post date:** [August 14, 2020, 6:05pm UTC](https://forums.eveonline.com/t/retrieve-character-id-from-character-name/258789/5 "2020-08-14T18:05:34Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Ortho\_Loess](https://sea1.discourse-cdn.com/eveonline/user_avatar/forums.eveonline.com/ortho_loess/32/291073_2.png) [@Ortho\_Loess](https://forums.eveonline.com/u/Ortho_Loess)\
**Post date:** [August 16, 2020, 6:25pm UTC](https://forums.eveonline.com/t/retrieve-character-id-from-character-name/258789/6 "2020-08-16T18:25:22Z")

</div>

The ccp hosted site of the old portraits went down back in 2013. They are available as a dump on the [toolkit page](https://community.eveonline.com/community/fansites/toolkit/)

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/eveonline/original/3X/4/1/41ec4921cbaca7a6f9ea556e7cc20018461eae5e.png) [@system](https://forums.eveonline.com/u/system)\
**Post date:** [November 14, 2020, 6:25pm UTC](https://forums.eveonline.com/t/retrieve-character-id-from-character-name/258789/7 "2020-11-14T18:25:37Z")

</div>

Closed on November 14, 2020, 6:25pm UTC

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