Skip to content


Folders and files

Last commit message
Last commit date

Latest commit



44 Commits

Repository files navigation


A Ruby library for XIVAPI.


Add this line to your application's Gemfile:

gem 'xivapi', git: '', tag: 'v0.3.3'

And then run:

$ bundle install


Full documentation for this library can be found here. For basic usage information, please see below.


Start by initializing a client. You can obtain an API key by signing in to XIVAPI here. The key is available under the Dev Account page after signing in.

require 'xivapi'

# Basic configuration
client = 'abc123')

# Advanced configuration
client = 'abc123', language: 'fr')

Now that you have a client, you can use it to contact the API. Examples have been provided below for the various endpoints. For the full list of endpoints and their parameters, please reference the request documentation.

Response data

The data returned from the API is automatically converted into OpenStruct objects with snake_cased keys. If the request returns multiple results (e.g. character search), it will be provided to you in the form of an XIVAPI::Paginator object. The paginator is Enumerable, allowing you to access the data with methods like first, each, map and to_a.

See the examples below to get a better idea of how to access the data.



>> achievements = 'achievement', string: 'tankless')
=> ...
=> ["A Tankless Job II (Dark Knight)", "A Tankless Job I (Paladin)", "A Tankless Job I (Warrior)", "A Tankless Job II (Warrior)", "A Tankless Job I (Dark Knight)", "A Tankless Job II (Paladin)"]
>> achievements.first.points
=> 10


>> client.content
=> ["Achievement", "AchievementCategory", "AchievementKind", ...]

>> achievement = client.content(name: 'Achievement', limit: 1).first
=> ...
=> "To Crush Your Enemies I"

>> achievements = client.content(name: 'Achievement', ids: 4..5)
=> ...
=> ["To Crush Your Enemies IV", "To Crush Your Enemies V"]


>> client.servers
=> ["Adamantoise", "Aegis", "Alexander", ...]


>> characters = client.character_search(name: 'raelys skyborn', server: 'behemoth')
=> ...
>> id =
=> 7660136
>> character = client.character(id: id, all_data: true)
=> ...
=> "Raelys Skyborn"
=> 692

Free Company

>> fcs = client.free_company_search(name: 'lodestone', server: 'behemoth')
=> ...
>> id =
=> "9234349560946590421"
>> fc = client.free_company(id: id, members: true)
=> ...
=> "Lodestone"
=> "Raelys Skyborn"


>> linkshells = client.linkshell_search(name: 'thunderbirds', server: 'behemoth')
=> ...
>> id =
=> "21955048183495181"
>> linkshell = client.linkshell(id: id).linkshell
=> ...
=> "Thunderbirds"

PVP Team

>> teams = client.pvp_team_search(name: 'kill', server: 'chaos')
=> ...
>> team = client.pvp_team(id:
=> ...
=> "!Kill_For_A_Friend!"

Patch List

>> patch = client.patch_list.last
=> ...
=> "Patch 4.4: Prelude In Violet"
=> 2018-09-18 10:00:00 +0000


After checking out the repo, run bin/setup to install dependencies. You can also run bin/console for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run bundle exec rake install. To release a new version, update the version number in version.rb, and then run bundle exec rake release, which will create a git tag for the version, push git commits and tags, and push the .gem file to


Bug reports and pull requests are welcome on GitHub at


The gem is available as open source under the terms of the MIT License.