PHPackages                             xivapi/companion-php - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. xivapi/companion-php

AbandonedArchivedLibrary[API Development](/categories/api)

xivapi/companion-php
====================

A library for interacting with the FFXIV Companion App API

1.2.11(5y ago)244575[1 PRs](https://github.com/xivapi/companion-php/pulls)MITPHP

Since Nov 6Pushed 4y agoCompare

[ Source](https://github.com/xivapi/companion-php)[ Packagist](https://packagist.org/packages/xivapi/companion-php)[ Docs](https://github.com/xivapi/companion-php)[ RSS](/packages/xivapi-companion-php/feed)WikiDiscussions master Synced yesterday

READMEChangelog (10)Dependencies (4)Versions (26)Used By (0)

Deprecated
==========

[](#deprecated)

Companion PHP
=============

[](#companion-php)

A library for interacting with the FFXIV Companion App API

To learn more about the FFXIV Companion App, read the [Research Doc](https://github.com/viion/ffxiv-datamining/blob/master/docs/CompanionAppApi.md).

If you cannot use PHP
---------------------

[](#if-you-cannot-use-php)

XIVAPI provides endpoints that can give you a companion token with your own account and even let you query the market board. It provides both automated login or providing the SE Official Login. This is useful if you want to use your own account but only know frontend dev (eg: JavaScript), or you're building an Electron app.

If you'd like to try this, please message **Vekien#3458** on discord for endpoint information.

Terminology:
------------

[](#terminology)

- **Companion**: The Official FFXIV Companioon Mobile App.
- **Sight**: The API that SE uses within the app to talk to the Game Servers.

Library Documentation
---------------------

[](#library-documentation)

- [Ban Disclaimer](https://github.com/xivapi/companion-php/wiki/Ban-Disclaimer) - Please read this.
- [Getting Started](https://github.com/xivapi/companion-php/wiki/Getting-Started)
    - `composer require xivapi/companion-php`
- [Tokens](https://github.com/xivapi/companion-php/wiki/Tokens)
    - Information on how tokens work, and understanding the `SightToken` object.
    - [Tokens: Manual Login](https://github.com/xivapi/companion-php/wiki/Tokens:-Manual)
    - [Tokens: Automatic Login](https://github.com/xivapi/companion-php/wiki/Tokens:-Automatic)

---

Character Select Process
------------------------

[](#character-select-process)

In order to use the Sight API you need a valid character with an active Subscription (it cannot be in the free trial period). A character does not need to be at any "stage" in the game, a brand new-never logged into character will have full market board access the moment you enter a name and click "create".

### Selecting a character

[](#selecting-a-character)

To access the market we first need to select our character and this requires knowing the unique "Character ID". We can find this by listing out our characters:

```
foreach ($api->Login()->getCharacters()->accounts[0]->characters as $character) {
    echo "- {$character->cid} :: {$character->name} ({$character->world})\n";
}
```

Characters have a unique Character ID property known as: `cid`. This ID is not the one you see on Lodestone or anything you'll be familiar with, once you find the character you want take its `cid` over to the `loginCharacter` function, for example:

```
$api->login()->loginCharacter('character_id');
```

This will confirm with Sight that you want to use this character, you can confirm yourself by performing the following optional code:

```
// Get current logged in character#echo "Confirming logged in character ...\n";
$character = $api->login()->getCharacter()->character;
echo "- Logged in as: {$character->name} ({$character->world}) \n";
```

Now that we've told it what character to use, we have to confirm its worlds status. This is a new addition in Patch 4.4 and I believe it will be used for when World Visit system is in place. For now it is a requirement and returns the current world and your home world:

```
$api->login()->getCharacterWorlds();
```

Once you have done this, you can now access the market board as well as any other Sight endpoint! You can find all API calls below.

Async Requests
--------------

[](#async-requests)

The library supports async requests for all main data actions (not Account or Login actions). This allows you to query multiple endpoints at the same time.

When you enable async it will by pass the "garauntee response" feature. The Sight API doesn't provide data in the first request, instead it will take your request and queue it up, you then need to perform the same request again to get the response. Usually a Sight request will fulfill within 3 seconds, so you could 20 concurrent requests, wait 3 seconds and then perform the same 20 concurrent requests again using the same Request ID to get your response.

You can view an example of Async usage in `bin/cli_async`

API
---

[](#api)

### Account

[](#account)

### AddressBook

[](#addressbook)

### ChatRoom

[](#chatroom)

### Item

[](#item)

### Login

[](#login)

### Market

[](#market)

#### `$api->market()->getItemMarketListings(int $itemId)`

[](#api-market-getitemmarketlistingsint-itemid)

Get the current Market Prices for an item. The item id must be the in-game dat value which is an integer, not the one on Lodestone.

#### `$api->market()->getTransactionHistory(int $itemId)`

[](#api-market-gettransactionhistoryint-itemid)

Get the current Market History for an item. The item id must be the in-game dat value which is an integer, not the one on Lodestone. The maximum returned history is currently 20, this cannot be changed.

#### `$api->market()->getMarketListingsByCategory(int $categoryId)`

[](#api-market-getmarketlistingsbycategoryint-categoryid)

Get the current stock listings for a market category

### Payments

[](#payments)

### Reports

[](#reports)

### Schedule

[](#schedule)

Testing
-------

[](#testing)

- `php bin/cli` - Have a look into thisclass for examples

---

**Library by:** Josh Freeman (Vekien on Discord: (XIVAPI) )

License is MIT, do whatever you want with it :)

###  Health Score

36

—

LowBetter than 79% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity24

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity72

Established project with proven stability

 Bus Factor1

Top contributor holds 96.9% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~33 days

Recently: every ~128 days

Total

24

Last Release

2030d ago

Major Versions

0.1.8 → 1.0.02019-02-15

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/136744026?v=4)[viion](/maintainers/viion)[@viion](https://github.com/viion)

---

Top Contributors

[![vekien](https://avatars.githubusercontent.com/u/270800?v=4)](https://github.com/vekien "vekien (63 commits)")[![ArcaneDisgea](https://avatars.githubusercontent.com/u/39720490?v=4)](https://github.com/ArcaneDisgea "ArcaneDisgea (1 commits)")[![Supamiu](https://avatars.githubusercontent.com/u/11519203?v=4)](https://github.com/Supamiu "Supamiu (1 commits)")

---

Tags

ffxiv-companionmarketmarket-boardsight-apiphpcompanionffxiv

### Embed Badge

![Health badge](/badges/xivapi-companion-php/health.svg)

```
[![Health](https://phpackages.com/badges/xivapi-companion-php/health.svg)](https://phpackages.com/packages/xivapi-companion-php)
```

###  Alternatives

[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.5k5.8M717](/packages/sylius-sylius)[wheelpros/fitment-platform-api

Magento 2 (Open Source)

12.1k1.2k](/packages/wheelpros-fitment-platform-api)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

585.4M526](/packages/shopware-core)[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3661.2M46](/packages/tencentcloud-tencentcloud-sdk-php)[soneso/stellar-php-sdk

Stellar PHP SDK for the Stellar Network

4152.0k4](/packages/soneso-stellar-php-sdk)[eslazarev/wildberries-sdk

Wildberries OpenAPI clients (generated).

252.5k](/packages/eslazarev-wildberries-sdk)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
