API Commander v1

Last Revision: Mar 2, 2017, 1:09:03 PM

To recover most of the private informations, an API Key is needed.

All messages returned by the API are in JSON. Most queries work with GET but they should also be compatible with POST requests.

If you need to do some testing on our API, please use the http://beta.edsm.net:8080/ endpoint.
It is usually up to date with the production database, but if not, send us a message.

HTTP Request: GET https://www.edsm.net/api-commander-v1/get-ranks

Parameter Default Description
commanderName* NULL

The name of the commander as registered on EDSM.
Your commander name for example is: Guest.

apiKey NULL

The API Key associate the commander name with his account.
API Key can be generated under the settings > My API Key tab.

API Key is used to ensure your private informations stays private.

If not provided, ranks will only be returned if the commander has enabled his public profile.

Output:

{
    msgnum: 100,
    msg: "OK",
    ranks: {
        Combat      : 3,
        Trade       : 3,
        Explore     : 7,
        CQC         : 0,
        Federation  : 0,
        Empire      : 0
    },
    progress: {
        Combat      : 91,
        Trade       : 1,
        Explore     : 7,
        CQC         : 0,
        Federation  : 56,
        Empire      : 0
    },
    ranksVerbose: {
        Combat      : "Competent",
        Trade       : "Dealer",
        Explore     : "Pioneer",
        CQC         : "Helpless",
        Federation  : "None",
        Empire      : "None"
    }
}

Parameter Description
msgnum

The code of the output. See Codes section for more informations.

msg

The verbose message of the output. See Codes section for more informations.

ranks

An array containing the commander ranks.

progress

An array containing the current progress of the commander in the current ranks.

ranksVerbose

An array containing the verbose output of the commander ranks.

Codes

Code Message
100 OK

Everything went fine!

201 Missing commander name

Commander name is a required parameter and must be one of the registered user on EDSM.

203 Commander name/API Key not found

The commander name or the API Key provided does not correspond to any user in our database.

207 No ranks stored

No ranks are stored in our database yet, or the apiKey was not provided on a private profile.

HTTP Request: GET https://www.edsm.net/api-commander-v1/set-ranks

Only the provided parameters will be updated with the new values.

Parameter Default Description
commanderName* NULL

The name of the commander as registered on EDSM.
Your commander name for example is: Guest.

apiKey* NULL

The API Key associate the commander name with his account.
API Key can be generated under the settings > My API Key tab.

API Key is used to ensure your private informations stays private.

Combat NULL

The combat rank of the commander.

To update the progress of the combat rank, you will have to pass the progress within the parameter separated by a ;.
Like: rank;progress => 3;91

Trade NULL

The trade rank of the commander.

To update the progress of the trade rank, you will have to pass the progress within the parameter separated by a ;.
Like: rank;progress => 3;91

Explore NULL

The explore rank of the commander.

To update the progress of the explore rank, you will have to pass the progress within the parameter separated by a ;.
Like: rank;progress => 3;91

CQC NULL

The CQC rank of the commander.

To update the progress of the CQC rank, you will have to pass the progress within the parameter separated by a ;.
Like: rank;progress => 3;91

Federation NULL

The federation rank of the commander.

To update the progress of the federation rank, you will have to pass the progress within the parameter separated by a ;.
Like: rank;progress => 3;91

Empire NULL

The empire rank of the commander.

To update the progress of the empire rank, you will have to pass the progress within the parameter separated by a ;.
Like: rank;progress => 3;91

Output:

{
    msgnum  : 100,
    msg     : "OK"
}

Parameter Description
msgnum

The code of the output. See Codes section for more informations.

msg

The verbose message of the output. See Codes section for more informations.

Codes

Code Message
100 OK

Everything went fine!

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.

HTTP Request: GET https://www.edsm.net/api-commander-v1/get-credits

Parameter Default Description
commanderName* NULL

The name of the commander as registered on EDSM.
Your commander name for example is: Guest.

apiKey* NULL

The API Key associate the commander name with his account.
API Key can be generated under the settings > My API Key tab.

API Key is used to ensure your private informations stays private.

period NULL

By default the method return the last entry of the user credits. You can retrieve more values by passing a period.

Applicable period are: 7DAY, 1MONTH, 3MONTH, 6MONTH.

Output:

{
    msgnum  : 100,
    msg     : "OK",
    credits : [
        {
            balance : 48593473,
            loan    : 0,
            date    : "2016-10-26 10:10:55"
        }
    ]
}

Parameter Description
msgnum

The code of the output. See Codes section for more informations.

msg

The verbose message of the output. See Codes section for more informations.

credits

An array containing the commander balance, loan and date of the values.

Codes

Code Message
100 OK

Everything went fine!

201 Missing commander name

Commander name is a required parameter and must be one of the registered user on EDSM.

203 Commander name/API Key not found

The commander name or the API Key provided does not correspond to any user in our database.

208 No credits stored

No credits are stored in our database yet.

HTTP Request: GET https://www.edsm.net/api-commander-v1/set-credits

If loan is not provided, it will be set with the latest value saved in our database.

Parameter Default Description
commanderName* NULL

The name of the commander as registered on EDSM.
Your commander name for example is: Guest.

apiKey* NULL

The API Key associate the commander name with his account.
API Key can be generated under the settings > My API Key tab.

API Key is used to ensure your private informations stays private.

balance* NULL

Current Credits of the user as stated in the LoadGame event of journal.

loan NULL

Current Loan of the user as stated in the LoadGame event of journal.

Output:

{
    msgnum  : 100,
    msg     : "OK"
}

Parameter Description
msgnum

The code of the output. See Codes section for more informations.

msg

The verbose message of the output. See Codes section for more informations.

Codes

Code Message
100 OK

Everything went fine!

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.

209 Missing balance

The commander current balance is required.

HTTP Request: GET https://www.edsm.net/api-commander-v1/set-ship-id

Parameter Default Description
commanderName* NULL

The name of the commander as registered on EDSM.
Your commander name for example is: Guest.

apiKey* NULL

The API Key associate the commander name with his account.
API Key can be generated under the settings > My API Key tab.

API Key is used to ensure your private informations stays private.

shipId* NULL

Current ShipId of the user as stated in the corresponding events of journal.

Output:

{
    msgnum      : 100,
    msg         : "OK",
    inDatabase  : true
}

Parameter Description
msgnum

The code of the output. See Codes section for more informations.

msg

The verbose message of the output. See Codes section for more informations.

inDatabase

State if the current shipId is in our database already or if you need to add the ship type using the update-ship method.

Codes

Code Message
100 OK

Everything went fine!

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.

210 Missing ship id

The commander current ship id is required.

211 Incorrect ship id

shipId must be a INT superior or equal to 0.

HTTP Request: GET https://www.edsm.net/api-commander-v1/update-ship

Parameter Default Description
commanderName* NULL

The name of the commander as registered on EDSM.
Your commander name for example is: Guest.

apiKey* NULL

The API Key associate the commander name with his account.
API Key can be generated under the settings > My API Key tab.

API Key is used to ensure your private informations stays private.

shipId* NULL

Current ShipId of the user as stated in the corresponding events of journal.

shipName NULL

Current ShipName of the user as stated in the corresponding events of journal.

shipIdent NULL

Current ShipIdent of the user as stated in the corresponding events of journal.

type NULL

Current type of the ship.
Example: Federation_Dropship, Empire_Trader, Vulture...

If the shipId is not already stored in our database, type is required.
paintJob NULL

Current paintJob of the ship.
Example: $paintjob_asp_default_03_name;, asp_default_03...

cargoQty NULL

Current quantity of cargo in the ship

cargoCapacity NULL

Current cargo capacity of the ship

fuelMainLevel NULL

Current main level of fuel in the ship excluding reserve

fuelMainCapacity NULL

Current main fuel capacity of the ship excluding reserve

fuelReserveLevel NULL

Current reserve level of fuel in the ship

fuelReserveCapacity NULL

Current reserve fuel capacity of the ship

linkToCoriolis NULL

Outfitting link to Coriolis

linkToEDShipyard NULL

Outfitting link to E:D Shipyard

Output:

{
    msgnum      : 100,
    msg         : "OK"
}

Parameter Description
msgnum

The code of the output. See Codes section for more informations.

msg

The verbose message of the output. See Codes section for more informations.

Codes

Code Message
100 OK

Everything went fine!

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.

210 Missing ship id

The commander current ship id is required.

211 Incorrect ship id

shipId must be a INT superior or equal to 0.

213 Type is required to insert a new ship

shipId was not found in our database, so we require the type parameter to insert the new ship.

214 Ship sold

The ship was already sold in our database.

215 Invalid ship type

The shipType was invalid (testbuggy).

HTTP Request: GET https://www.edsm.net/api-commander-v1/sell-ship

Parameter Default Description
commanderName* NULL

The name of the commander as registered on EDSM.
Your commander name for example is: Guest.

apiKey* NULL

The API Key associate the commander name with his account.
API Key can be generated under the settings > My API Key tab.

API Key is used to ensure your private informations stays private.

shipId* NULL

Current ShipId of the user as stated in the corresponding events of journal.

Output:

{
    msgnum      : 100,
    msg         : "OK"
}

Parameter Description
msgnum

The code of the output. See Codes section for more informations.

msg

The verbose message of the output. See Codes section for more informations.

Codes

Code Message
100 OK

Everything went fine!

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.

210 Missing ship id

The commander current ship id is required.

211 Incorrect ship id

shipId must be a INT superior or equal to 0.

212 Ship not found in database

shipId was not found in our database, we have nothing to sell!

HTTP Request: GET https://www.edsm.net/api-commander-v1/get-materials

Parameter Default Description
commanderName* NULL

The name of the commander as registered on EDSM.
Your commander name for example is: Guest.

apiKey NULL

The API Key associate the commander name with his account.
API Key can be generated under the settings > My API Key tab.

API Key is used to ensure your private informations stays private.

If not provided, data will only be returned if the commander has enabled his public profile and share his inventory.

type materials

The type of data to fetch.
Can be one of:

  • materials: To fetch materials
  • data: To fetch encoded data

Output:

{
    msgnum      : 100,
    msg         : "OK",
    materials   : [
        {
            type    : "antimony",
            name    : "Antimony",
            qty     : 3
        },
        {
            type    : "arsenic",
            name    : "Arsenic",
            qty     : 2
        }
    ]
}

Parameter Description
msgnum

The code of the output. See Codes section for more informations.

msg

The verbose message of the output. See Codes section for more informations.

materials

An array containing the commander materials.

data

An array containing the commander encoded data.

Codes

Code Message
100 OK

Everything went fine!

201 Missing commander name

Commander name is a required parameter and must be one of the registered user on EDSM.

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 Wrong type

The type is not available.

HTTP Request: GET https://www.edsm.net/api-commander-v1/set-materials

Parameter Default Description
commanderName* NULL

The name of the commander as registered on EDSM.
Your commander name for example is: Guest.

apiKey* NULL

The API Key associate the commander name with his account.
API Key can be generated under the settings > My API Key tab.

API Key is used to ensure your private informations stays private.

type* NULL

Current type of values to handle.
Can be one of:

  • materials for materials (Raw and Manufactured)
  • data for encoded data
values* NULL

A json array of the values with keys as the material/data and value as the count.

{ "chromium": 28, "zinc": 18, ... }

Be sure to merge the Raw and Manufactured keys if sending materials.
Any missing value will be set to zero.

Output:

{
    msgnum      : 100,
    msg         : "OK",
    values      : [
        {
            type    : "antimony",
            name    : "Antimony",
            qty     : 0
        },
        {
            type    : "arsenic",
            name    : "Arsenic",
            qty     : 18
        }
    ]
}

Parameter Description
msgnum

The code of the output. See Codes section for more informations.

msg

The verbose message of the output. See Codes section for more informations.

Codes

Code Message
100 OK

Everything went fine!

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.

210 Missing material/data type

The material/data type is required.

211 Invalid material/data type

The specified alias type was not found in our database (yet!).

212 Missing values

The array of values is required

213 JSON decoding failed

Values seems to be malformed.

214 Quantity exceed the maximum limit

You cannot have more materials/data than the in-game maximum.

  • Materials: 1,000
  • Data: 500

HTTP Request: GET https://www.edsm.net/api-commander-v1/update-materials

Parameter Default Description
commanderName* NULL

The name of the commander as registered on EDSM.
Your commander name for example is: Guest.

apiKey* NULL

The API Key associate the commander name with his account.
API Key can be generated under the settings > My API Key tab.

API Key is used to ensure your private informations stays private.

type* NULL

Current type of the material/data as written in the journal.
Example: antimony, militarygradealloys, fedproprietarycomposites...

method add

The endpoint come with two methods: add or substract.

qty 1

Current quantity of the specified material/data to add or substract.

Output:

{
    msgnum  : 100,
    msg     : "OK",
    type    : "antimony",
    name    : "Antimony",
    qty     : 10
}

Parameter Description
msgnum

The code of the output. See Codes section for more informations.

msg

The verbose message of the output. See Codes section for more informations.

Codes

Code Message
100 OK

Everything went fine!

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.

210 Missing material/data type

The material/data type is required.

211 Invalid material/data type

The specified alias type was not found in our database (yet!).

212 Invalid method

The required method was not found.

213 Quantity cannot be negative

How can you have less than 0 material/data?

214 Quantity exceed the maximum limit

You cannot have more materials/data than the in-game maximum.

  • Materials: 1,000
  • Data: 500