Follow me on Twitter for instant support: @fortniteapi.
We've made an easier documentation for all frameworks instead of only PHP. You can visit it here.
Documentation
getUsernameFromId()
HTTP endpoint: https://fortnite-public-api.theapinetwork.com/prod09/users/username out of id

Getting usernames with getUsernameFromId()

Want the username of an ID? Use this function.

$data = $api->user->getUsernameFromId(['user id 1', 'user id 2', 'user id 3']);

// first user id
echo $data[0]->id;
echo $data[0]->displayName;

// second user id
echo $data[1]->id;
echo $data[1]->displayName;

// third user id
echo $data[2]->id;
echo $data[2]->displayName;

  • id will give you the user ID.
  • username will give you the username.

  • Published: 06-May-2018 23:55:49 · Views: 2417