NPCs
NPCs are merchant or trader characters from whom you can buy, sell or trade items. Some are static, while others appear dynamically thanks to the event system.
NPC Types
| Type | Description |
|---|---|
merchant | Buys and sells items for gold. |
trader | Trades items for other items (currency is an item code instead of gold). |
When viewing the items on an NPC, if the currency field shows anything other than gold, it will display the code of the item you need to trade to the NPC.
List of NPCs
You can use this GET request to view the list of all existing NPCs.
curl --location --request GET 'https://api.artifactsmmo.com/npcs/details' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json'var myHeaders = new Headers();
myHeaders.append("Accept", "application/json");
myHeaders.append("Content-Type", "application/json");
var requestOptions = {
method: 'GET',
headers: myHeaders,
redirect: 'follow'
};
fetch("https://api.artifactsmmo.com/npcs/details", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));View the API Reference (opens in a new tab)
Buying/selling/trading items
You can use this GET request to view the list of items that an NPC sells/buys/trades.
curl --request GET \
--url https://api.artifactsmmo.com/npcs/items/{npc_code} \
--header 'Accept: application/json'const url = 'https://api.artifactsmmo.com/npcs/items/{npc_code}';
const options = {method: 'GET', headers: {Accept: 'application/json'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}Each item entry contains:
| Field | Description |
|---|---|
code | Item code. |
npc | NPC code. |
currency | Currency used: gold or an item code for trades. |
buy_price | Price to buy from the NPC (null if the NPC doesn't sell this item). |
sell_price | Price the NPC pays when you sell (null if the NPC doesn't buy this item). |
View the API Reference (opens in a new tab)
Actions
To buy or sell an item, you must be on a map with an NPC. To learn more about the map, click here. (opens in a new tab)
You can use this POST request to buy an item.
curl --request POST \
--url https://api.artifactsmmo.com/my/{name}/action/npc/buy \
--header 'Accept: application/json' \
--header 'Authorization: Bearer INSERT_YOUR_TOKEN_HERE' \
--header 'Content-Type: application/json' \
--data '{
"code": "string",
"quantity": 1
}'const url = 'https://api.artifactsmmo.com/my/{name}/action/npc/buy';
const options = {
method: 'POST',
headers: {
'Content-Type': 'application/json',
Accept: 'application/json',
Authorization: 'Bearer INSERT_YOUR_TOKEN_HERE'
},
body: '{"code":"string","quantity":1}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}| Field | Description |
|---|---|
code | The item code to buy. |
quantity | Number of items to buy (1–100). |
View the API Reference (opens in a new tab)
You can use this POST request to sell an item.
curl --request POST \
--url https://api.artifactsmmo.com/my/{name}/action/npc/sell \
--header 'Accept: application/json' \
--header 'Authorization: Bearer INSERT_YOUR_TOKEN_HERE' \
--header 'Content-Type: application/json' \
--data '{
"code": "string",
"quantity": 1
}'const url = 'https://api.artifactsmmo.com/my/{name}/action/npc/sell';
const options = {
method: 'POST',
headers: {
'Content-Type': 'application/json',
Accept: 'application/json',
Authorization: 'Bearer INSERT_YOUR_TOKEN_HERE'
},
body: '{"code":"string","quantity":1}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}| Field | Description |
|---|---|
code | The item code to sell. |
quantity | Number of items to sell (1–100). |