NPCs & Trading
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
Section titled “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.
Here are some examples of NPCs:
Loading NPCs...
List of NPCs
Section titled “List of NPCs”To view the list of all existing NPCs, use the following request:
Endpoint: GET /npcs/details
curl --location --request GET 'https://api.artifactsmmo.com/npcs/details' \--header 'Accept: application/json' \--header 'Content-Type: application/json'const url = 'https://api.artifactsmmo.com/npcs';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);}import requests
url = "https://api.artifactsmmo.com/npcs/details"headers = { "Accept": "application/json", "Content-Type": "application/json"}
response = requests.get(url, headers=headers)print(response.json())| Parameter | Description |
|---|---|
name | NPC name. |
type | Type of NPCs. |
currency | Currency code to filter NPCs that trade with this currency. |
item | Item code to filter NPCs that trade this item. |
page | Page number (default: 1). |
size | Page size (default: 50). |
Actions
Section titled “Actions”To buy or sell an item, you must be on a map with an NPC. For more information, see Maps & Movement.
Buy Item
Section titled “Buy Item”To buy an item from an NPC, use the following request:
Endpoint: POST /my/{name}/action/npc/buy
curl --request POST \--url https://api.artifactsmmo.com/my/{name}/action/npc/buy \--header 'Accept: application/json' \--header 'Authorization: Bearer YOUR_TOKEN' \--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 YOUR_TOKEN'}, 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);}import requests
url = "https://api.artifactsmmo.com/my/{name}/action/npc/buy"headers = { "Accept": "application/json", "Content-Type": "application/json", "Authorization": "Bearer YOUR_TOKEN"}data = {"code": "string", "quantity": 1}
response = requests.post(url, json=data, headers=headers)print(response.json())| Field | Description |
|---|---|
code | The item code to buy. |
quantity | Number of items to buy (1–100). |
Sell Item
Section titled “Sell Item”To sell an item to an NPC, use the following request:
Endpoint: POST /my/{name}/action/npc/sell
curl --request POST \--url https://api.artifactsmmo.com/my/{name}/action/npc/sell \--header 'Accept: application/json' \--header 'Authorization: Bearer YOUR_TOKEN' \--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 YOUR_TOKEN'}, 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);}import requests
url = "https://api.artifactsmmo.com/my/{name}/action/npc/sell"headers = { "Accept": "application/json", "Content-Type": "application/json", "Authorization": "Bearer YOUR_TOKEN"}data = {"code": "string", "quantity": 1}
response = requests.post(url, json=data, headers=headers)print(response.json())| Field | Description |
|---|---|
code | The item code to sell. |
quantity | Number of items to sell (1–100). |