See FrontierDevelopments-oAuth2-notes for how to use Frontier Developments' oAuth2 system for Authorization on the CAPI.
In all instances you'll need to use the Access Token obtained via oAuth2 by setting an HTTP header for the request:
Authorization: Bearer <access_token>
Note that in theory the token type could be different from 'Bearer'. It's safest to store the token_type that comes back from the request for an Access Token and repeat that back in this header.
You might occasionally see a header:
Set-Cookie: access_token=1566841911%7C%7C<40 character hex string>; domain=companion.orerve.net; path=/; expires=Mon, 26-Aug-2019 17:51:51 UTC; secure
in the responses from the CAPI end points. This seems to serve no purpose, and is perhaps left over from the work to implement oAuth2 on the service.
- The start of the access_token value appears to be a Unix Epoch timestamp, 86400 seconds in the past. That matches the expiry time on the cookie.
- That "40 character hex string" doesn't seem to be a valid JSON Web Token, for instance, or otherwise related to either the Refresh or Access Tokens.
The CAPI is not designed as a real-time service to be spammed with queries in an attempt to always be up to date. For one thing the CAPI's data itself can lag behind what the relevant game client is seeing.
In general try not to issue more than one query a minute. Although
EDMarketConnector gets away with issuing all of /profile
, /market
,
and /shipyard
in rapid succession upon docking, Frontier have in the
past stated that rate limiting might kick in if you perform more than 2
queries per second.
For the /journal
endpoint you should not expect it to update in
realtime from live gameplay. Ideally you should only query it once a
gameplay session is complete.
You need to use the correct host for the data you are expecting to retrieve. As of Odyssey Update 14 this mostly pertains to the Live/Legacy galaxy split.
The rest of this documentation will assume the Live galaxy and use its host.
The main CAPI host is companion.orerve.net
. Since Odyssey
Update 14 this only returns data for the Live galaxy.
To retrieve data pertaining to the Legacy galaxy you must use the
alternate host legacy-companion.orerve.net
.
In the past Frontier has sometimes provided a beta-specific CAPI host.
When it was available (this was before Odyssey Update 14 and the galaxy
split) the hostname was pts-companion.orerve.net
.
You can check the currently available endpoints by sending a bare query
to the CAPI host, i.e. /
path component as in https://companion.orerve.net/.
This will produce output like:
{
"links": [
{
"href": "/profile",
"rel": "CommanderProfile",
"type": "GET",
"title": "Commander profile, add ?language=[en|fr|de|ru|es|pt] to translate locName and LocDescriptions"
},
{
"href": "/market",
"rel": "CommodityMarket",
"type": "GET",
"title": "Last docked commodity market, add ?language=[en|fr|de|ru|es|pt] to translate locName and LocDescriptions"
},
{
"href": "/shipyard",
"rel": "Shipyard",
"type": "GET",
"title": "Last docked shipyard and outfitting"
},
{
"href": "/communitygoals",
"rel": "CommunityGoals",
"type": "GET",
"title": "Details on all currently active Community Goals and any contributions from this Commander, add ?language=[en|fr|de|ru|es|pt] to translate descriptions"
},
{
"href": "/journal",
"rel": "Journal",
"type": "GET",
"title": "Log lines from Commander Journal file, add (/:year(/:month(/:day))) to ask if previous journals are available"
},
{
"href": "/fleetcarrier",
"rel": "FleetCarrier",
"type": "GET",
"title": "Information about Commander's fleet carrier, add ?language=[en|fr|de|ru|es|pt] to translate locName and LocDescriptions"
},
{
"href": "/visitedstars",
"rel": "VisitedStars",
"type": "GET",
"title": "Download an zip archive containing the player's VisitedStarsCache.dat file. Status 102 indicates the file is being generated in the background, try again in a couple of minutes"
}
]
}
GET <https://companion.orerve.net/profile>
provides access to the Cmdr's profile. What follows is the last known information about the output. This will obviously be subject to change as Frontier changes things.
Where 'FDev ID' or 'FDev Symbol' is mentioned please see https://github.com/EDCD/FDevIDs.
commander
: Information about the Cmdrname
: The Cmdr's Nameid
: Numerical IDdocked
: Whether currently dockedalive
: booleancredits
: Credit Balancedebt
: Any current debt amountcurrentShipId
: Numerical ID of current ship (index within the Cmdr's currently owned ships, not necessarily unique over time due to sell/buy).rank
: Rankscombat
trade
explore
cqc
empire
federation
power
service
: ???crime
capabilities
: .e.g. whether the account has Horizons, and if it can buy the Cobra Mk IV.
lastStarport
: Information about the last StarPort they were docked atname
: Nameid
: Numerical IDfaction
: Allegiance to a Super Power, if anyminorfaction
: Minor Faction that owns this assetservices
: Available services
lastSystem
: The last System they were in- Name
- Allegiance ('faction')
- Numerical ID
NB: This has been observed to sometimes be the
id64/SystemAddress of the system, and other times be
some other id. The
ship
section below then containsid
matching this andsystemaddress
with the id64.
ship
: Current Ship data. Note that this duplicates some data that's at the top level.id
: Current ship's Numerical ID (seecurrentShipId
above)name
: Ship Namevalue
Ship Value, with breakdown cargo/modules/hullhull
modules
cargo
total
unloaned
free
: Whether this ship was free ?shipName
: Current ship's NameshipID
: Ship IDstation
: Current Station, if applicableid
: Numerical IDname
: Name of station
starsystem
: Current star systemid
name
systemaddress
: id64
alive
: booleanhealth
hull
shield
shieldup
: booleanintegrity
paintwork
cockpitBreached
: booleanoxygenRemaining
: Oxygen Remainingmodules
: The first key in each entry describes which slot the module is for, and its size.module
:id
: Numerical FDev IDname
: FDev SymbollocName
: Localised human readable namelocDescription
: Localised module description.value
: Price bought for ('value')free
: ??? Whether it came free with a ship? It's 'false' on everything, even 'Planetary Approach Suite' and the Fuel Tank.health
: Current Healthon
: Powered Status (on/off)priority
: Power Priority
engineer
: Details of currently applied engineeringengineerName
: Which engineer was usedengineerId
: Engineer's numerical IDrecipeName
: Non-localised blueprint namerecipeLocName
: Localised blueprint namerecpieLocDescription
: Localised blueprint descriptionrecipeLevel
: Rank of the blueprint
WorkInProgress_modifications
: Details about the effects of the applied blueprintspecialModifications
: "Special Effects", empty array if none
launchBays
: Information about in-stock SRVs. The top level key defines slot and size.name
: 'testbuggy' for an SRVlocName
: "SRV Scarab"rebuilds
: How many spares???loadout
: "starter"loadoutName
: "Starter" (Localised?)
ships
: Information about all ships the Commander owns. NB: This could be a simple array (if all ship indexes are contiguous from0
), or a dictionary indexed with a string version of the ship ID if there are any other gaps. The data is the same format as in theship
key.
GET <https://companion.orerve.net/shipyard>
Fetches the last visited shipyard for the authenticated commander.
CommodityId, EconomyId, ShipId can be found in the EDCD/FDevIDs repo
id
- Station IDname
- Station nameoutpostType
- What type of outpost it is, examples:starport
,fleetcarrier
- NB: Might not match the type in Journal events
imported
- Commodities that are imported to this station (dictionary, commodity id and key)- Example
"128049162": "Cobalt"
- Example
exported
- Commodities that are exported from this station (dictionary, commodity id and key)- Example
"128049162": "Cobalt"
- Example
services
- Services the station provides and their statusdock
- Status of Dock (ok
,unavailable
,private
)contacts
- Status of Contacts (ok
,unavailable
,private
)exploration
- Status of Exploration (ok
,unavailable
,private
)commodities
- Status of Commodities (ok
,unavailable
,private
)refuel
- Status of Refuel (ok
,unavailable
,private
)repair
- Status of Repair (ok
,unavailable
,private
)rearm
- Status of Rearm (ok
,unavailable
,private
)outfitting
- Status of Outfitting (ok
,unavailable
,private
)shipyard
- Status of Shipyard (ok
,unavailable
,private
)crewlounge
- Status of Crewlounge (ok
,unavailable
,private
)searchrescue
- Status of Search & Rescue (ok
,unavailable
,private
)techbroker
- Status of Tech broker (ok
,unavailable
,private
)stationmenu
- Status of Station menu (ok
,unavailable
,private
)shop
- Status of shop (ok
,unavailable
,private
)engineer
- Status of engineers (ok
,unavailable
,private
)
economies
- What different types of economies you can expect from the station (dictionary, economyId as key)- Example
"23": { "name" : "HighTech", "proportion": 0.7 }
- Example
prohibited
- Which commodities are prohibited on this station (dictionary, commodityId and key)- Example
"128049162": "Cobalt"
- Example
modules
- The list of modules on this station (dictionary, moduleId as key)id
- ModuleIdcategory
- What category this module isname
- Name for the modulecost
- Module costsku
- The SKU for the modulestock
- How many are available of this item,-1
means unlimited
ships
- The list of available ships on this stationshipyard_list
- The actual list (Dictionary, ship name as key)id
- ShipIdname
- Ship namebasevalue
- The base cost of a new shipsku
- The SKU for the shipstock
- How many of this ship we have in stock
GET <https://companion.orerve.net/fleetcarrier>
provides access to information about the Cmdr's fleet carrier.
Code | Status | Description |
---|---|---|
200 |
OK | This means you got the Fleet Carrier Data |
204 |
No Content | This means that the player does not own a Fleet Carrier |
-
name
: The carrier's callsign and name informationcallsign
: The carrier's callsign, in the format A1A-A1A.vanityName
: The carrier's name, hex encoded, before any filtering is applied.filteredVanityName
: The carrier's name, hex encoded, after applying FDev's obscenity filter.
-
currentStarSystem
: Carrier's current system. -
balance
: Amount of credits in carrier's bank account. This is separate from the owner CMDRs. -
fuel
: Amount of Tritium fuel in the carrier's Tritium reserves. (Max 1000) -
state
: Current state of the carrier. Known states are:normalOperation
: Operating normally.debtState
: Services offline due to carrier being out of funds.pendingDecommission
: Carrier has entered the decommission process.
-
theme
: Livery theme for the carrier. Known liveries:SearchAndRescue
Mining
Trader
Explorer
AntiXeno
BountyHunter
-
dockingAccess
: Who can dock with the fleet carrier. Known states:all
squadronfriends
friends
none
-
notoriousAccess
: Can CMDRs with notoriety dock? Boolean. -
capacity
: Capacity usageshipPacks
: Capacity used by ship packs (for shipyard)modulePacks
: Capacity used for module packs (for outfitting)cargoForSale
: Capacity used for cargo that is listed for sale on marketcargoNotForSale
: Capacity used for cargo that is NOT listedcargoSpaceReserved
: Capacity reserved for cargo that is listed to BUY on marketcrew
: Capacity used for crewing carrier modulesfreeSpace
: Unused capacitymicroresourceCapacityTotal
: Capacity for all micro resources (on foot materials)microresourceCapacityFree
: Unused micro resources capacitymicroresourceCapacityUsed
: Capacity used for micro resourcesmicroresourceCapacityReserved
: Capacity reserved for micro resources that are listed to BUY at bartender.
-
itinerary
: Ships' itinerarycompleted
: Completed jumps (list)departureTime
: Time carrier left system,None
if currently in systemarrivalTime
: Time carrier arrived in systemstate
: ?? (alwayssuccess
in seen entries)visitDurationSeconds
: How long carrier was/has been in system, in secondsstarsystem
: Name of starsystem
totalDistanceJumpedLY
: Total travel distance for carriercurrentJump
: System name for current plotted jump, otherwiseNone
-
marketFinances
: Market information for the carriercargoTotalValue
: Computed value of entire cargoallTimeProfit
: Total profit earned by carrier marketnumCommodsForSale
: Number of commodities listed for sale on carrier marketnumCommodsPurchaseOrders
: Number of commodities listed to buy on carrier marketbalanceAllocForPurchaseOrders
: How many credits are allocated for fulfilling buy orders
-
blackmarketFinances
: Black market information for the carrier.cargoTotalValue
: Computed value of entire cargoallTimeProfit
: Total profit earned by carrier marketnumCommodsForSale
: Number of commodities listed for sale on carrier marketnumCommodsPurchaseOrders
: Number of commodities listed to buy on carrier marketbalanceAllocForPurchaseOrders
: How many credits are allocated for fulfilling buy orders
-
finance
:bankBalance
: Total credits in fleet carrier's accountbankReservedBalance
: Balance reserved for carrier upkeeptaxation
: Taxation rate for service use on the carrierservice_taxation
: Individual taxation rates for each service (Dict)bartender
: Taxation rate in % for bartender servicespioneersupplies
: Taxation rate in % for Pioneer supply servicesrearm
: Taxation rate in % for rearming servicesrefuel
: Taxation rate in % for refuelling servicesrepair
: Taxation rate in % for repair servicesshipyard
: Taxation rate in % for shipyard servicesoutfitting
: Taxation rate in % for outfitting services
numServices
: Number of services active on carriernumOptionalServices
: Number of optional services active on carrierdebtThreshold
: Maximum negative credit balance before carrier automatically decommissionsmaintenance
: Total cost pending for weekly maintenancemaintenanceToDate
: Total paid for maintenance in carrier lifetimecoreCost
: Current base weekly cost for carrierservicesCost
: Current pending weekly cost for services, active or suspendedservicesCostToDate
: Total paid for services in carrier lifetimejumpsCost
: Current pending cost for jumps made in the past weeknumJumps
: Number of jumps made in the past weekbartender
: Detailed information about bartender micro resource services (Dict)microresourcesTotalValue
: Computed value of all micro resources (on foot materials) in stockallTimeProfit
: Total profit earned on sales of micro resourcesmicroresourcesForSale
: Number of micro resources listed for sale at bartendermicroresourcesPurchaseOrders
: Number of micro resources listed to buy at bartenderprofitHistory
: History of profit on recent transactions (List of ints)
-
servicesCrew
: Enumerates assigned crew on the carrier. All services share the same crewMember data as shown in first example.refuel
: If refuel facility is installed, shows data on crew member.crewMember
:name
: Crew member's namegender
: Crew member's gender (F
orM
)enabled
: Service enabled,YES
orNO
faction
: Crew member's native factionsalary
: Weekly salary for crew memberavatarStr
: A string, containing data needed to represent the NPC's avatar. Example:img://avatar:Seed:1913354398/Expression:eExpression_Positive/Labels:Gender|female-Faction|Federation-StarportContactType|CarrierRefuel-NPCType|StarportContact/DisableColourCorrection:0/
lastEdit
: When crew member was last changed
invoicesWeekToDate
: List containing elements as belowwages
: Amount paid/owedfrom
: From dateuntil
: To datetype
: ??, known statescurrent
andexpected
status
: ?? known states:ok
repair
: Repair facility crew member information, if installed.rearm
: Rearm facility crew member information, if installed.shipyard
: Shipyard facility crew member information, if installed.outfitting
: Outfitting facility crew member information, if installed.voucherredemption
: Voucher redemption facility crew member information, if installed.exploration
: Interstellar cartographer facility crew member information, if installed.blackmarket
: Black market facility crew member information, if installed.bartender
: Bartender market facility crew member information, if installed.vistagenomics
: Exobiology facility crew member information, if installed.pioneersupplies
: On-foot supply facility crew member information, if installed.
-
cargo
: A list of all cargo items on board, in the following format:commodity
: Non-localized commodity namemission
: Whether the commodity is mission attached, booleanqty
: Quantity of commodity (Always 1, in our experience)value
: Value of commoditystolen
: Whether the commodity is flagged as stolenlocName
: Localized name of commodity, follows carrier owner's localization
-
orders
: Information on all buy and sell orderscommodities
: Buy and sell orders for standard cargo commoditiessales
: A list of sell orders, in the following format:name
: The commodity namestock
: The quantity for saleprice
: The sell price per itemblackmarket
: Boolean,true
if this item is for sale on the black market
purchases
: A list of buy orders, in the following format:name
: The commodity nametotal
: The total buy orderoutstanding
: The remaining outstanding to fulfil the buy orderprice
: The buy price per item
onfootmicroresources
: Buy and sell orders for micro resources (on foot materials)sales
: A Dict containing sell orders, or an empty list if there are no sell orders. The Dict key is the sell order ID (str) and the contents being a Dict in the following format:id
: A unique identifier (int)name
: The resource namelocName
: Localised resource namestock
: The quantity for saleprice
: The sell price per item
purchases
: A list of buy orders, in the following format:name
: The resource namelocName
: The localised resource nametotal
: The total buy orderoutstanding
: The remaining outstanding to fulfil the buy orderprice
: The buy price per item
-
carrierLocker
: All microresources (on foot materials) stored on the carrier, organised by type.assets
: A list of all stored assetsid
: A unique identifier (int)quantity
: The number of items storedname
: The Resource namelocName
: The localised resource name
goods
: A list of all stored goodsid
: A unique identifier (int)quantity
: The number of items storedname
: The Resource namelocName
: The localised resource name
data
: A list of all stored dataid
: A unique identifier (int)quantity
: The number of items storedname
: The Resource namelocName
: The localised resource name
-
reputation
: A list of faction reputations, in the following format.majorFaction
: Name of factionscore
: Reputation score, 0 to 100
Known valid majorFaction strings are
empire
,federation
,independent
andalliance
. -
market
: Market information for the carrier, same as journal market entries-
id
: Numerical unique ID for the market -
name
: Market name, same as callsign -
outpostType
: Alwaysfleetcarrier
in this context -
imported
: List of imported commodities (carrier buys) -
exported
: List of exported commodities (carrier sells) -
services
: Array of service statuscommodities
:carrierfuel
:refuel
:repair
:rearm
:shipyard
:outfitting
:blackmarket
:voucherredemption
:exploration
:carriermanagement
:stationmenu
:dock
:crewlounge
:engineer
:contacts
:
For all the above, the following state strings are possible:
ok
: Active and available,unavailable
: Not installed, orprivate
: Only accessible by owner -
economies
: An array, always set to the same:136
:name
: AlwaysCarrier
proportion
: Always1
-
prohibited
: Which commodities are prohibited on this station (dictionary, commodityId and key). This isn't always populated. When it is, it may be related to what's prohibited in the system in which the Fleet Carrier is situated. -
commodities
: A list of available commoditiesid
: Commodity IDcategoryname
: Commodity category namename
: Non-localized string for commodity, as in journal datastock
: Number of commodity in stockbuyPrice
: Price to buy commodity FROM carriersellPrice
: Price to sell commodity TO carrierdemand
: Number of commodity carrier is willing to buylegality
: ??meanPrice
: ??demandBracket
: ??stockBracket
: ??locName
: Localized name of commodity, depending on fleet carrier owner's locale
-
-
ships
: Shipyard informationshipyard_list
: List containing available ships
-
modules
: Available modules in outfitting
GET <https://companion.orerve.net/market>
Get the market data from the last docked station/fleet carrier/settlement and contains their services and status, what type of economics it has, what they import, export and what is forbidden. (And also the commodities, with price info and stock/demand)
CommodityId can be found in the EDCD/FDevIDs repo
id
- Station IDname
- Station nameoutpostType
- What type of outpost it is, examples:starport
,fleetcarrier
- NB: Might not match the type in Journal events
imported
- Which commodities are imported to this station (dictionary, commodity id and key)- Example
"128049162": "Cobalt"
- Example
exported
- Which commodities are exported from this station (dictionary, commodity id and key)- Example
"128049162": "Cobalt"
- Example
services
- What services the station provides and their statusdock
- Status of Dock (ok
,unavailable
,private
)contacts
- Status of Contacts (ok
,unavailable
,private
)exploration
- Status of Exploration (ok
,unavailable
,private
)commodities
- Status of Commodities (ok
,unavailable
,private
)refuel
- Status of Refuel (ok
,unavailable
,private
)repair
- Status of Repair (ok
,unavailable
,private
)rearm
- Status of Rearm (ok
,unavailable
,private
)outfitting
- Status of Outfitting (ok
,unavailable
,private
)shipyard
- Status of Shipyard (ok
,unavailable
,private
)crewlounge
- Status of Crewlounge (ok
,unavailable
,private
)searchrescue
- Status of Search & Rescue (ok
,unavailable
,private
)techbroker
- Status of Tech broker (ok
,unavailable
,private
)stationmenu
- Status of Station menu (ok
,unavailable
,private
)shop
- Status of shop (ok
,unavailable
,private
)engineer
- Status of engineers (ok
,unavailable
,private
)
economies
- What different types of economies you can expect from the station (dictionary, economyId as key)- Example
"23": { "name" : "HighTech", "proportion": 0.7 }
- Example
prohibited
- Which commodities are prohibited on this station (dictionary, commodityId as key)- Example
"128049162": "Cobalt"
- Example
commodities
- All available commodities and their infoid
- Commodity IDname
- Commodity namelegality
- Status of the legality of this commodity at this station, empty string = legalbuyPrice
- The buy price at the moment of the visitsellPrice
- The sell price at the moment of the visitmeanPrice
- The mean price at the momenf of the visitdemandBracket
- How much in demand this commodity is, value between0
and3
stockBracket
- How much in stock this commodity has (bracket), value between0
and3
stock
- How many items are in stock of this commoditydemand
- How many items the station has demand for (more is better)statusFlags
categoryName
- Category the commodity belongs tolocName
- Localised name
Gives access to the authenticated players journals, all sessions are combined into a single file for a single request
GET <https://companion.orerve.net/journal>
GET <https://companion.orerve.net/journal/[year (4 numbers)]/[month (2 numbers)]/[day (2 numbers)]>
Example requests:
GET <https://companion.orerve.net/journal>
This request give you the current day journal data
GET <https://companion.orerve.net/journal/2020/12/30>
This request would give you the journal for the specific date, in this case the 30th December, 2020.
Code | Status | Description |
---|---|---|
200 |
OK | This means you got the entire journal for the specified request |
204 |
No Content | This means that the player has not (yet) played this day |
206 |
Partial Content | The request did not get the entire journal, best solution is to keep trying until you get 200 - OK |
401 |
Unauthorized | See HTTP Status Codes for more information |
To know what kind of output you can except from the /journal
endpoint, we recommend reading the Journal Manual to see what you can encounter.
-
401 - Unauthorized - Since the 'September Update' patch on 2019-09-17 the CAPI servers use this HTTP status code to signal that the provided Access Token is invalid (certainly for when it's expired).
The body containing:
{"status":401,"message":"JWT has incorrect\/unexpected fields"}
-
418 - "I'm a teapot" - used to signal that the service is down for maintenance. Technically Frontier shouldn't be using this as it's a joke from a couple of April Fools' RFCs: https://tools.ietf.org/html/rfc2324 https://tools.ietf.org/html/rfc7168
-
422 - "Unprocessable Entity" - previously used to signal that a provided Access Token was invalid, likely due to it being expired. This changed with the 'September Update' patch in 2019.