Market
Query the API about Market Data.
Market Order Model
Both Sales and Buy Orders have the same response model.
Properties
- Name
id
- Type
- string
- Description
The MongoDB ObjectID of the order
- Name
ownerId
- Type
- string
- Description
The Identity ObjectId of the player who created the order.
- Name
price
- Type
- int
- Description
The price in shards of a single unit of the order.
- Name
quantity
- Type
- int
- Description
The total number of units of the order.
- Name
type
- Type
- string
- Description
The Material type of the order.
Completed Market Order Model
The model representing a completed market sale or buy order.
Properties
- Name
id
- Type
- string
- Description
The MongoDB ObjectID of the order
- Name
ownerId
- Type
- string
- Description
The Identity ObjectId of the player who created the order.
- Name
buyerId
- Type
- string
- Description
The UUID of the player who created the order.
- Name
price
- Type
- int
- Description
The price in shards of the completed order.
- Name
type
- Type
- string
- Description
The Material type of the order.
- Name
name
- Type
- string
- Description
The Friendly Name of the completed order.
- Name
sale
- Type
- boolean
- Description
Whether this was a sale. If
false
this was a Buy Order.
List all Sales
This endpoint allows you to retrieve a list of all sales on Loka.
Optional Attributes
- Name
size
- Type
- integer
- Description
- Limit the number of sales returned.
- Name
page
- Type
- integer
- Description
- Page of sales to return.
Request
const axios = require('axios');
axios.get('https://api.lokamc.com/market_sales')
.then((response) => console.log(response.data));
Response
{
"_embedded": {
"market_sales": [
{
"id": "64936f7b696d4707f878eb1d",
"ownerId": "5462b7c5e4b0cad9a0f3e6a4",
"price": 900.0,
"quantity": 1,
"type": "CROSSBOW",
},
{
"id": "64936f7b696d4707f878eb1d",
//...
},
//...
}
}
List Sales by Type
This endpoint allows you to retrieve a list of all sales given their item type.
Required attributes
- Name
type
- Type
- string
- Description
The Material Enum item type of the sale.
Optional Attributes
- Name
size
- Type
- integer
- Description
- Limit the number of sales returned.
- Name
page
- Type
- integer
- Description
- Page of sales to return.
Request
const axios = require('axios');
axios.get('https://api.lokamc.com/market_sales/search/findByType', {
params: { type: 'CROSSBOW' }
}).then((response) => console.log(response.data));
Response
{
"_embedded": {
"market_sales": [
{
"id": "64936f7b696d4707f878eb1d",
"ownerId": "5462b7c5e4b0cad9a0f3e6a4",
"price": 900.0,
"quantity": 1,
"type": "CROSSBOW",
},
{
"id": "64936f7b696d4707f878eb1d",
//...
},
//...
}
}
List Sales by Owner
This endpoint allows you to retrieve a list of all sales created by a specific player.
Required attributes
- Name
id
- Type
- string
- Description
The Identity ObjectId of the Sale Owner.
Optional Attributes
- Name
size
- Type
- integer
- Description
- Limit the number of sales returned.
- Name
page
- Type
- integer
- Description
- Page of sales to return.
Request
const axios = require('axios');
axios.get('https://api.lokamc.com/market_sales/search/findByOwnerId', {
params: { id: '5462b7c5e4b0cad9a0f3e6a4' }
}).then((response) => console.log(response.data));
Response
{
"_embedded": {
"market_sales": [
{
"id": "64936f7b696d4707f878eb1d",
"ownerId": "5462b7c5e4b0cad9a0f3e6a4",
"price": 900.0,
"quantity": 1,
"type": "CROSSBOW",
},
{
"id": "64936f7b696d4707f878eb1d",
//...
},
//...
}
}
List all Buy Orders
This endpoint allows you to retrieve a list of all buy orders on Loka.
Optional Attributes
- Name
size
- Type
- integer
- Description
- Limit the number of buy orders returned.
- Name
page
- Type
- integer
- Description
- Page of buy orders to return.
Request
const axios = require('axios');
axios.get('https://api.lokamc.com/market_buyorders')
.then((response) => console.log(response.data));
Response
{
"_embedded": {
"market_sales": [
{
"id": "64936f7b696d4707f878eb1d",
"ownerId": "5462b7c5e4b0cad9a0f3e6a4",
"price": 900.0,
"quantity": 1,
"type": "CROSSBOW",
},
{
"id": "64936f7b696d4707f878eb1d",
//...
},
//...
}
}
List Buy Orders by Type
This endpoint allows you to retrieve a list of all sales given their item type.
Required attributes
- Name
type
- Type
- string
- Description
The Material Enum item type of the buy order.
Optional Attributes
- Name
size
- Type
- integer
- Description
- Limit the number of buy orders returned.
- Name
page
- Type
- integer
- Description
- Page of buy orders to return.
Request
const axios = require('axios');
axios.get('https://api.lokamc.com/market_buyorders/search/findByType', {
params: { type: 'CROSSBOW' }
}).then((response) => console.log(response.data));
Response
{
"_embedded": {
"market_sales": [
{
"id": "64936f7b696d4707f878eb1d",
"ownerId": "5462b7c5e4b0cad9a0f3e6a4",
"price": 900.0,
"quantity": 1,
"type": "CROSSBOW",
},
{
"id": "64936f7b696d4707f878eb1d",
//...
},
//...
}
}
List Buy Orders by Owner
This endpoint allows you to retrieve a list of all sales created by a specific player.
Required attributes
- Name
id
- Type
- ObjectId
- Description
The Identity ObjectId of the Buy Order Owner.
Optional Attributes
- Name
size
- Type
- integer
- Description
- Limit the number of buy orders returned.
- Name
page
- Type
- integer
- Description
- Page of buy orders to return.
Request
const axios = require('axios');
axios.get('https://api.lokamc.com/market_buyorder/search/findByOwnerId', {
params: { id: '5462b7c5e4b0cad9a0f3e6a4' }
}).then((response) => console.log(response.data));
Response
{
"_embedded": {
"market_sales": [
{
"id": "64936f7b696d4707f878eb1d",
"ownerId": "5462b7c5e4b0cad9a0f3e6a4",
"price": 900.0,
"quantity": 1,
"type": "CROSSBOW",
},
{
"id": "64936f7b696d4707f878eb1d",
//...
},
//...
}
}
List All Completed Sales
This endpoint allows you to retrieve a list of all completed sales on Loka.
Optional Attributes
- Name
size
- Type
- integer
- Description
- Limit the number of sales returned.
- Name
page
- Type
- integer
- Description
- Page of sales to return.
Request
const axios = require('axios');
axios.get('https://api.lokamc.com/market_buyorder/search/findByOwnerId', {
params: { uuid: '23dc58af-0139-4852-98af-88d20b90efc7' }
}).then((response) => console.log(response.data));
Response
{
"_embedded": {
"market_sales": [
{
"id": "64936f7b696d4707f878eb1d",
"ownerId": "5462b7c5e4b0cad9a0f3e6a4",
"price": 900.0,
"quantity": 1,
"type": "CROSSBOW",
},
{
"id": "64936f7b696d4707f878eb1d",
//...
},
//...
}
}