Game concepts
NPCs

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

TypeDescription
merchantBuys and sells items for gold.
traderTrades 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
curl --location --request GET 'https://api.artifactsmmo.com/npcs/details' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json'
Javascript
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
curl --request GET \
  --url https://api.artifactsmmo.com/npcs/items/{npc_code} \
  --header 'Accept: application/json'
Javascript
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:

FieldDescription
codeItem code.
npcNPC code.
currencyCurrency used: gold or an item code for trades.
buy_pricePrice to buy from the NPC (null if the NPC doesn't sell this item).
sell_pricePrice 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
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
}'
Javascript
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);
}
FieldDescription
codeThe item code to buy.
quantityNumber 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
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
}'
Javascript
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);
}
FieldDescription
codeThe item code to sell.
quantityNumber of items to sell (1–100).

View the API Reference (opens in a new tab)