API 1.0 Documentation α

API 2.0 is on the way! This version will be deprecated in the coming months!

About

Welcome to UEX API 1.0 Documentation. This page is dedicated to quickly show you all the ways you can use UEX data to develop something cool.


Before you start

Please be aware that UEX API still under development as well as our website, so bugs and changes in the API structure should be expected.


Authentication

To get started, make sure you got your API key. To obtain it, please use the UEX Terminal and type apikey --help for instructions.

Example of authentication via cURL:

curl https://portal.uexcorp.space/api/star_systems -H "api_key: 665b1e3851eefefa3fb878654292f16597d25155"

Resources

/all_prices NEW!

List all UEX average prices

URL https://portal.uexcorp.space/api/all_prices/pretty_mode/1/
Method GET
Parameters
Name Type Length Description Example
pretty_mode (optional) string 1 Output locations and commodities names instead of codes 1
Response example
{
    "status": "ok",
    "code": 200,
    "data": {
        "ArcCorp": {
            "ArcCorp Mining Area 045": {
                "sell": {
                    "Hadanite": 275,
                    "Medical Supplies": 19.24,
                    "Dolivine": 130,
                    "Processed Food": 1.5,
                    "Aphorite": 152.5,
                    "Stims": 3.8,
                    "Distilled Spirits": 5.15
                },
                "buy": {
                    "Aluminum": 1.11,
                    "Quartz": 1.25,
                    "Diamond": 6.39,
                    "Tungsten": 3.57,
                    "Laranite": 27.12
                }
            },
            ...
        }
    }
}
                                     

/cities

Obtain a list of all cities in a system, operated by UEX.

URL https://portal.uexcorp.space/api/cities/system/{system_code}/
Method GET
Parameters
Name Type Length Description Example
system_code string 2 Star system code ST (Stanton)
Response example
{
  "status": "ok",
  "code": 200,
  "data": [
    {
      "system": "ST",
      "planet": "ARC",
      "code": "A18",
      "name": "Area 18",
      "available": 1,
      "date_added": 1608949515,
      "date_modified": 0
    },
    {
      "system": "ST",
      "planet": "HUR",
      "code": "LOR",
      "name": "Lorville",
      "available": 1,
      "date_added": 1608949515,
      "date_modified": 0
    },
    {
      "system": "ST",
      "planet": "MIC",
      "code": "NBB",
      "name": "New Babbage",
      "available": 1,
      "date_added": 1608949515,
      "date_modified": 0
    }
  ]
}
                                     

/commodities

Obtain all commodities available in-game and their respective UEX prices averages.

URL https://portal.uexcorp.space/api/commodities/
Method GET
Type application/json
Response example
{
  "status": "ok",
  "code": 200,
  "data": 
  [
    {
      "code": "ACSU",
      "name": "Agricultural Supplies",
      "kind": "Agricultural",
      "trade_price_buy": 1.05,
      "trade_price_sell": 1.16,
      "date_added": 1608949515,
      "date_modified": 1625097602
    },
    ...
  ]
}
                                    

/tradeport

Obtain information about an specific location

URL https://portal.uexcorp.space/api/tradeport/code/{tradeport_code}/
Method GET
Parameters
Name Type Length Description Example
tradeport_code string 5 Location code BEZDE (HDMS-Bezdek)
Response example
{
  "status": "ok",
  "code": 200,
  "data": {
    "system": "ST",
    "planet": "HUR",
    "satellite": "ARIA",
    "city": null,
    "code": "BEZDE",
    "name": "HDMS-Bezdek",
    "name_short": "HDMS-Bezdek",
    "visible": "1",
    "armistice": "1",
    "trade": "1",
    "outlaw": "0",
    "refinery": "0",
    "shops": "0",
    "restricted": "0",
    "minable": 0,
    "date_added": 1608949515,
    "date_modified": 1608949515,
    "prices": {
      "PRFO": {
        "name": "Processed Food",
        "kind": "Food",
        "operation": "sell",
        "price_buy": 0,
        "price_sell": 1.5,
        "date_update": 1636772468
      },
      "STIM": {
        "name": "Stims",
        "kind": "Vice",
        "operation": "sell",
        "price_buy": 0,
        "price_sell": 3.8,
        "date_update": 1636772468
      },
      ...
    }
  }
}
                                     

/tradeports

Obtain all locations buying and selling commodities, as well as their respective prices in a star system.

URL https://portal.uexcorp.space/api/tradeports/system/{system_code}/
Method GET
Parameters
Name Type Length Description Example
system_code string 2 Star system code ST (Stanton)
Response example
{
  "status": "ok",
  "code": 200,
  "data": 
  [
    {
      "system": "ST",
      "planet": "ARC",
      "satellite": "WALA",
      "city": null,
      "code": "AM045",
      "name": "ArcCorp Mining Area 045",
      "name_short": "ArcCorp 045",
      "space": "0",
      "visible": "1",
      "armistice": "1",
      "trade": "1",
      "outlaw": "0",
      "refinery": "0",
      "shops": "0",
      "restricted": "0",
      "minable": 0,
      "date_added": 1608949515,
      "date_modified": 1608949515,
      "prices": 
      {
        "ALUM": {
          "name": "Aluminum",
          "kind": "Metal",
          "operation": "buy",
          "price_buy": 1.11,
          "price_sell": 0,
          "date_update": 1637895604
        },
        "APHO": {
          "name": "Aphorite",
          "kind": "Mineral",
          "operation": "sell",
          "price_buy": 0,
          "price_sell": 152.5,
          "date_update": 1632193250
        },
        ...
      }
    },
    ...
  ]
}
                                     

/planets

Obtain a list of all planets in a system, operated by UEX.

URL https://portal.uexcorp.space/api/planets/system/{system_code}/
Method GET
Parameters
Name Type Length Description Example
system_code string 2 Star system code ST (Stanton)
Response example
{
  "status": "ok",
  "code": 200,
  "data": [
    {
      "system": "ST",
      "code": "ARC",
      "name": "ArcCorp",
      "available": 1,
      "date_added": 1608949515,
      "date_modified": 0
    },
    {
      "system": "ST",
      "code": "CRU",
      "name": "Crusader",
      "available": 1,
      "date_added": 1608949515,
      "date_modified": 0
    },
    {
      "system": "ST",
      "code": "HUR",
      "name": "Hurston",
      "available": 1,
      "date_added": 1608949515,
      "date_modified": 0
    },
    {
      "system": "ST",
      "code": "MIC",
      "name": "microTech",
      "available": 1,
      "date_added": 1608949515,
      "date_modified": 0
    }
  ]
}
                                     

/satellites

Obtain a list of all planetary satellites in a system, operated by UEX.

URL https://portal.uexcorp.space/api/satellites/system/{system_code}/
Method GET
Parameters
Name Type Length Description Example
system_code string 2 Star system code ST (Stanton)
Response example
{
  "status": "ok",
  "code": 200,
  "data": [
    {
      "system": "ST",
      "code": "ABER",
      "name": "Aberdeen",
      "available": 1,
      "date_added": 1608949515,
      "date_modified": 0
    },
    {
      "system": "ST",
      "code": "ARIA",
      "name": "Arial",
      "available": 1,
      "date_added": 1608949515,
      "date_modified": 0
    },
    ...
  ]
}
                                     

/ships

Obtain a list of Star Citizen ships and vehicles.

URL https://portal.uexcorp.space/api/ships/
Method GET
Response example
{
  "status": "ok",
  "code": 200,
  "data": [
    {
      "manufacturer": "AEGS",
      "name": "Sabre",
      "serie": "SABR",
      "code": "SABREA",
      "loaner": null,
      "role": "Fighter",
      "scu": 0,
      "crew": "1",
      "implemented": "1",
      "mining": "0",
      "stealth": "1",
      "price": 170,
      "price_warbond": null,
      "price_pkg": 0,
      "store_url": "https:\/\/robertsspaceindustries.com\/pledge\/ships\/sabre\/sabre",
      "stock_qt_speed": 0,
      "flyable_since": "2.6.0",
      "showdown_winner": 0,
      "date_added": 1609004572,
      "date_modified": 0,
      "buy_at": [
        {
          "system": "ST",
          "system_name": "Stanton",
          "planet": "HUR",
          "planet_name": "Hurston",
          "satellite": null,
          "satellite_name": null,
          "city": "LOR",
          "city_name": "Lorville",
          "tradeport": null,
          "tradeport_name": null,
          "store": "NEW",
          "store_name": "New Deal",
          "price": 2183300,
          "date_added": 1613689250,
          "date_modified": 0
        }
      ],
      "rent_at": null
    },
    ...
}
                                     

/star_systems

Obtain a list of all star systems operated by UEX at this time.

URL https://portal.uexcorp.space/api/star_systems/
Method GET
Response example
{
  "status": "ok",
  "code": 200,
  "data": [
    {
      "name": "Stanton",
      "code": "ST",
      "available": 1,
      "default": 1,
      "date_added": 1608949515,
      "date_modified": 0
    },
    ...
  ]
}
                                     

Note: Previous /systems endpoint is now deprecated.

/sr

Inject price reports into UEX database (subjected by UEX review)

URL https://portal.uexcorp.space/api/sr/
Method POST
Fields commodity (required)
Commodity code
VARCHAR (4)
ex: LARA

tradeport (required)
Location (tradeport) code
VARCHAR (5)
ex: BEZDE

operation (required)
Buy or sell operation
VARCHAR (4)
ex: buy

price (required)
Buy or sell price
VARCHAR(11)
ex: 8.29 or missing if not found

user_hash (required)
UEX Datarunner Access Code
VARCHAR(6)
ex: a01b41

confirm (optional)
Bypass UEX warnings
INT(1)

production (not required if running in test environment)
Ask UEX to definitely inject your data into the system. If not send, UEX will simulate a price injection
VARCHAR(1)
Status responses ok
Report received. No issues found. An report ID will be provided

missing_commodity
Commodity not provided

missing_tradeport
Tradeport not provided

missing_operation
Operation not provided

missing_price
Price not provided

missing_access_code
User access code not provided

user_not_found
Access code invalid or user not found

commodity_not_found
Commodity code invalid or not found

tradeport_not_found
Tradeport code invalid or not found

tradeport_not_available
Tradeport not available in-game and/or not accepting reports at this time

confirmation_commodity_new
If a commodity is not usually found at a location

confirmation_duplicated_report
If the same user has submitted a similar report

confirmation_commodity_missing
If a commodity was reported as missing but it is usually found at location

confirmation_price_below_tolerance
If price is below the 20% price variation tolerance (down)

confirmation_price_above_tolerance
If price is above the 20% price variation tolerance (down)

Response example
{
  "status": "ok",
  "code": 200,
  "data": 1234
}
                                     

Important: At this time, the access to the /sr command is restricted. If you want to develop your own datarunning application and help us update our prices, please contact us.

More help

If you find a bug or have any questions about the API, feel free to contact the developer via email: support@uexcorp.space