API Journal v1
The journal API consist only of two endpoints. One to be aware of the discarded events and the other to actually store the events in our database.
The purpose is to have a dynamic API that can accept or deny new events that will come in the future of the game without having the software to write new API calls.
As of UPDATE 14 we will have no choice than removing support for Legacy/Console version of the game. I don't have the meaning/support needed to duplicate the database and maintain it nor I had enough time to prepare for it.
HTTP Request:
POST https://www.edsm.net/api-journal-v1
The parameters can be passed as a raw body JSON or like a form/multipart
.
Note that GET
request will not be followed for security reasons.
Parameter | Default | Description |
---|---|---|
commanderName* |
NULL
|
The name of the commander as registered on EDSM. |
apiKey* |
NULL
|
The API Key associate the commander name with his account. API Key is used to ensure your private informations stays private. |
fromSoftware* |
NULL
|
Name of the software used to submit the data. |
fromSoftwareVersion* |
NULL
|
Version of the software used to submit the data. |
fromGameVersion* |
NULL
|
Version of the game used to submit the data.
As of 29/11/2022, Frontier have separated the game into two different instances, so those two fields are now mandatory in order to check from which version the data is coming. |
fromGameBuild* |
NULL
|
Version of the build game used to submit the data. |
message* |
NULL
|
The message line from the journal without any modification.
We said without modification, but you may be aware that event passed into the journal does not keep track of every state we need. |
Most of the events do not track the state of the game, meaning that if you fed event one by one you cannot know for sure when the event happened.
Transient states are added in order to fill that gap by providing extra informations that can be used for example to know the current system or ship.
Parameter | Default | Description |
---|---|---|
_systemAddress |
NULL
|
|
_systemName |
NULL
|
|
_systemCoordinates |
NULL
|
|
_marketId |
NULL
|
|
_stationName |
NULL
|
|
_shipId |
NULL
|
|
var updateGameStatus = function(entry){ if(entry.event == 'LoadGame') { gameStatus.systemId = null; gameStatus.system = null; gameStatus.coordinates = null; gameStatus.stationId = null; gameStatus.station = null; } if(entry.event == 'SetUserShipName') { gameStatus.ship.id = entry.ShipID; } if(entry.event == 'ShipyardBuy') { gameStatus.ship.id = null; } if(entry.event == 'ShipyardSwap') { gameStatus.ship.id = entry.ShipID; } if(entry.event == 'Loadout') { gameStatus.ship.id = entry.ShipID; } if(entry.event == 'Undocked') { gameStatus.stationId = null; gameStatus.station = null; } if(['Location', 'FSDJump', 'Docked'].indexOf(entry.event) !== -1) { // Docked don't have coordinates, if system changed reset if(entry.StarSystem != gameStatus.system) { gameStatus.coordinates = null; } if(entry.StarSystem != 'ProvingGround' && entry.StarSystem != 'CQC') { if(entry.SystemAddress != undefined) { gameStatus.systemId = entry.SystemAddress; } gameStatus.system = entry.StarSystem; if(entry.StarPos != undefined) { gameStatus.coordinates = entry.StarPos; } } else { gameStatus.systemId = null; gameStatus.system = null; gameStatus.coordinates = null; } if(entry.MarketID != undefined) { gameStatus.stationId = entry.MarketID; } if(entry.StationName != undefined) { gameStatus.station = entry.StationName; } } if(['JoinACrew', 'QuitACrew'].indexOf(entry.event) !== -1) { if(entry.event == 'JoinACrew' && entry.Captain != gameStatus.cmdr) { gameStatus.sendEvents = false; } else { gameStatus.sendEvents = true; } gameStatus.systemId = null; gameStatus.system = null; gameStatus.coordinates = null; gameStatus.stationId = null; gameStatus.station = null; } entry._systemAddress = gameStatus.systemId; entry._systemName = gameStatus.system; entry._systemCoordinates = gameStatus.coordinates; entry._marketId = gameStatus.stationId; entry._stationName = gameStatus.station; entry._shipId = gameStatus.ship.id; return entry; };
Code | Message |
---|---|
100 |
OK
Everything went fine! |
101 |
Message already stored
The journal message was already processed in our database. |
102 |
Message older than the stored one
The journal message was already in a newer version in our database. |
103 |
Duplicate event request
Each event passed to the API is stored in cache for around 300 seconds, preventing multiple software from requesting the same event. |
104 |
Crew session
Commander is in a crew session without being the captain. |
201 |
Missing commander name
Commander name is a required parameter and must be one of the registered user on EDSM. |
202 |
Missing API key
API Key is a required parameter. |
203 |
Commander name/API Key not found
The commander name or the API Key provided does not correspond to any user in our database. |
204 |
Software/Software version not found
In order to be able to blacklist incorrect software, we require both the name and the version of the software used to send the informations. |
205 |
Blacklisted software
You need to update the used software, or see with the developer of the software about potential issues encountered. |
206 |
Cannot decode JSON
JSON message could not be decoded |
207 |
Game/Build version not found
In order to be able to blacklist incorrect game version and different Legacy/Live version of the game, we require both the version and the build of the game used to send the informations. |
208 |
Game/Build version too old
Legacy versions of the game are NOT supported. |
301 |
Message not found
The journal message was not provided. |
302 |
Cannot decode message JSON
The journal message could not de decoded or is not in a valid JSON format. |
303 |
Missing timestamp/event from message
Missing timestamp/event key from the journal message. |
304 |
Discarded event
This event is part of the discarded events and will not be processed. |
401 |
Category unknown
|
402 |
Item unknown
The current alias of the item is not currently in EDSM database. |
451 |
System probably non existant
The provided system probably don't exists in the game or was moved elsewhere. |
452 |
An entry for the same system already exists just before the visited date.
To avoid multiple entries for the same systems at a nearly same date, we check the before and the after submission according to the visited date provided. AKA: You cannot submit twice the same system in a row (A to A), it must be A to B to A. |
453 |
An entry for the same system already exists just after the visited date.
See |
500 |
Exception: %%
An unexpected exception! |
501 |
%%
Normally a debug message you should not see ;) |
Event | Description | |
---|---|---|
ApproachSettlement
|
|
|
BackPack
|
|
|
Backpack
|
|
|
BackpackChange
|
|
|
BookTaxi
|
|
|
BuyAmmo
|
|
|
BuyDrones
|
|
|
BuyExplorationData
|
|
|
BuyMicroResources
|
|
|
BuyTradeData
|
|
|
CancelTaxi
|
|
|
Cargo
|
|
|
CargoDepot
|
|
|
CarrierJump
|
|
|
CodexEntry
|
|
|
CollectCargo
|
|
|
CommitCrime
|
|
|
CommunityGoal
|
|
|
CommunityGoalDiscard
|
|
|
CommunityGoalJoin
|
|
|
CommunityGoalReward
|
|
|
CrewHire
|
|
|
Died
|
|
|
Docked
|
|
|
EjectCargo
|
|
|
EngineerContribution
|
|
|
EngineerCraft
|
|
|
EngineerProgress
|
|
|
FSDJump
|
|
|
FSDTarget
|
|
|
FSSAllBodiesFound
|
|
|
FSSDiscoveryScan
|
|
|
FetchRemoteModule
|
|
|
Friends
|
|
|
Interdicted
|
|
|
Interdiction
|
|
|
JoinACrew
|
|
|
LoadGame
|
|
|
Loadout
|
|
|
Location
|
|
|
MarketBuy
|
|
|
MarketSell
|
|
|
MaterialCollected
|
|
|
MaterialDiscarded
|
|
|
MaterialTrade
|
|
|
Materials
|
|
|
MiningRefined
|
|
|
MissionAbandoned
|
|
|
MissionAccepted
|
|
|
MissionCompleted
|
|
|
MissionFailed
|
|
|
MissionRedirected
|
|
|
Missions
|
|
|
ModuleBuy
|
|
|
ModuleBuyAndStore
|
|
|
ModuleRetrieve
|
|
|
ModuleSell
|
|
|
ModuleSellRemote
|
|
|
MultiSellExplorationData
|
|
|
NpcCrewPaidWage
|
|
|
PayBounties
|
|
|
PayFines
|
|
|
PayLegacyFines
|
|
|
Powerplay
|
|
|
PowerplayCollect
|
|
|
PowerplayDefect
|
|
|
PowerplayDeliver
|
|
|
PowerplayFastTrack
|
|
|
PowerplayJoin
|
|
|
PowerplayLeave
|
|
|
PowerplaySalary
|
|
|
Progress
|
|
|
Promotion
|
|
|
QuitACrew
|
|
|
Rank
|
|
|
RedeemVoucher
|
|
|
RefuelAll
|
|
|
RefuelPartial
|
|
|
Repair
|
|
|
RepairAll
|
|
|
Reputation
|
|
|
RestockVehicle
|
|
|
Resurrect
|
|
|
SAAScanComplete
|
|
|
Scan
|
|
|
ScientificResearch
|
|
|
SearchAndRescue
|
|
|
SelfDestruct
|
|
|
SellDrones
|
|
|
SellExplorationData
|
|
|
SellMicroResources
|
|
|
SellShipOnRebuy
|
|
|
SetUserShipName
|
|
|
ShipLocker
|
|
|
ShipyardBuy
|
Loadout event.Add sell price if old ship is sold. |
|
ShipyardSell
|
|
|
ShipyardSwap
|
|
|
ShipyardTransfer
|
|
|
StartUp
|
|
|
Statistics
|
|
|
StoredShips
|
|
|
Synthesis
|
|
|
TechnologyBroker
|
|
|
TradeMicroResources
|
|
|
USSDrop
|
|
|
Undocked
|
|
|
UseConsumable
|
|
HTTP Request:
GET https://www.edsm.net/api-journal-v1/discard
The purpose of this endpoint is to give software an insight of which events will be discarded by the API.
This is a fluctuent information that need to be checked ideally on software reboot to be kept up to date with the kind of events we proceed.
For any events in that list, it is not necessary to make a call to EDSM.
Output:
[ "AfmuRepairs", "AppliedToSquadron", "ApproachBody", "AsteroidCracked", "BookDropship", "Bounty", "CancelDropship", "CapShipBond", "CargoTransfer", "CarrierBankTransfer", "CarrierBuy", "CarrierCrewServices", "CarrierDecommission", "CarrierDepositFuel", "CarrierDockingPermission", "CarrierFinance", "CarrierJumpCancelled", "CarrierJumpRequest", "CarrierModulePack", "CarrierNameChange", "CarrierStats", "CarrierTradeOrder", "ChangeCrewRole", "ClearSavedGame", "CockpitBreached", "CollectItems", "Commander", "Continued", "Coriolis", "CreateSuitLoadout", "CrewAssign", "CrewFire", "CrewLaunchFighter", "CrewMemberJoins", "CrewMemberQuits", "CrewMemberRoleChange", "CrimeVictim", "DataScanned", "DatalinkScan", "DatalinkVoucher", "DisbandedSquadron", "DiscoveryScan", "Disembark", "DockFighter", "DockSRV", "DockingCancelled", "DockingDenied", "DockingGranted", "DockingRequested", "DockingTimeout", "DropItems", "DropshipDeploy", "EDDCommodityPrices", "EDDItemSet", "EDShipyard", "Embark", "EndCrewSession", "EngineerApply", "EngineerLegacyConvert", "EscapeInterdiction", "FSSBodySignals", "FSSSignalDiscovered", "FactionKillBond", "FighterDestroyed", "FighterRebuilt", "Fileheader", "FuelScoop", "HeatDamage", "HeatWarning", "HullDamage", "InvitedToSquadron", "JetConeBoost", "JetConeDamage", "JoinedSquadron", "KickCrewMember", "LaunchDrone", "LaunchFighter", "LaunchSRV", "LeaveBody", "LeftSquadron", "Liftoff", "LoadoutEquipModule", "Market", "MassModuleStore", "MaterialDiscovered", "ModuleArrived", "ModuleInfo", "ModuleStore", "ModuleSwap", "Music", "NavBeaconScan", "NavRoute", "NavRouteClear", "NewCommander", "NpcCrewRank", "Outfitting", "PVPKill", "Passengers", "PowerplayVote", "PowerplayVoucher", "ProspectedAsteroid", "RebootRepair", "ReceiveText", "RepairDrone", "ReservoirReplenished", "SAASignalsFound", "SRVDestroyed", "ScanBaryCentre", "ScanOrganic", "Scanned", "Screenshot", "SendText", "SharedBookmarkToSquadron", "ShieldState", "ShipArrived", "ShipTargeted", "Shipyard", "ShipyardNew", "ShutDown", "Shutdown", "SquadronCreated", "SquadronStartup", "StartJump", "Status", "StoredModules", "SuitLoadout", "SupercruiseEntry", "SupercruiseExit", "SwitchSuitLoadout", "SystemsShutdown", "Touchdown", "UnderAttack", "VehicleSwitch", "WingAdd", "WingInvite", "WingJoin", "WingLeave" ]