Client
The Client is your entry point to the Artifacts MMO API.
Purpose:
Authenticate with your API token
Query game data (items, monsters, maps, resources)
Create Character controllers
There are two client types:
ArtifactsClient- Synchronous (blocking)AsyncArtifactsClient- Asynchronous (non-blocking)
Sync Client
Use the sync client for simple scripts and tools:
from artifacts import ArtifactsClient
with ArtifactsClient(token="your_token") as client:
# Query game data
items = client.get_all_items()
# Control a character
char = client.character("MyCharacter")
char.move(x=1, y=2)
- class artifacts.ArtifactsClient[source]
Bases:
objectSynchronous SDK client for the Artifacts MMO API.
No
async/awaitneeded – every call blocks until complete:from artifacts import ArtifactsClient with ArtifactsClient(token="your_token") as client: char = client.character("MyChar") info = char.get() print(f"{info.name} lv{info.level}") char.move(x=0, y=1) # blocks, auto-waits cooldown result = char.fight() # blocks, auto-waits cooldown char.skills.craft(code="iron_sword") char.bank.deposit_gold(quantity=100)
- Parameters:
token (
Optional[str]) – JWT token for authentication.base_url (
str) – API base URL. Defaults to the production server.auto_wait (
bool) – IfTrue(default), every action automatically sleeps until its cooldown expires.retry (
Optional[Any]) – Custom retry configuration.
- __init__(token=None, *, base_url='https://api.artifactsmmo.com', auto_wait=True, retry=None)[source]
- Parameters:
token (str | None)
base_url (str)
auto_wait (bool)
retry (Any | None)
- character(name, *, auto_wait=None)[source]
Return a synchronous
SyncCharactercontroller for name.- Return type:
SyncCharacter- Parameters:
name (str)
auto_wait (bool | None)
- property auto_wait: bool
Whether actions automatically sleep until their cooldown expires.
Setting this on the client affects all characters that were created without an explicit per-character override:
client.auto_wait = False # disable globally client.auto_wait = True # re-enable globally
- property server: _SyncProxy
- property token: _SyncProxy
- property accounts: _SyncProxy
- property my_account: _SyncProxy
- property characters: _SyncProxy
- property achievements: _SyncProxy
- property badges: _SyncProxy
- property effects: _SyncProxy
- property events: _SyncProxy
- property grand_exchange: _SyncProxy
- property items: _SyncProxy
- property leaderboard: _SyncProxy
- property maps: _SyncProxy
- property monsters: _SyncProxy
- property npcs: _SyncProxy
- property resources: _SyncProxy
- property tasks: _SyncProxy
- property simulation: _SyncProxy
- property sandbox: _SyncProxy
Async Client
Use the async client for bots managing multiple characters:
from artifacts import AsyncArtifactsClient
import asyncio
async def main():
async with AsyncArtifactsClient(token="your_token") as client:
# Control multiple characters in parallel
char1 = client.character("Fighter")
char2 = client.character("Mage")
await asyncio.gather(
char1.fight(),
char2.fight()
)
asyncio.run(main())
- class artifacts.AsyncArtifactsClient[source]
Bases:
objectAsync SDK client for the Artifacts MMO API.
Use as an async context manager:
async with AsyncArtifactsClient(token="your_token") as client: char = client.character("MyChar") await char.move(x=0, y=1) # auto-waits cooldown await char.fight() # auto-waits cooldown
- Parameters:
token (
Optional[str]) – JWT token for authentication. Generate one viaclient.token.generate(username, password)or pass an existing token.base_url (
str) – API base URL. Defaults to the production server.auto_wait (
bool) – IfTrue(default), every action automatically sleeps until its cooldown expires. Disable globally here or per-character/per-call.retry (
Optional[RetryConfig]) – Custom retry configuration. Defaults to 3 retries with exponential backoff.
- __init__(token=None, *, base_url='https://api.artifactsmmo.com', auto_wait=True, retry=None)[source]
- Parameters:
token (str | None)
base_url (str)
auto_wait (bool)
retry (RetryConfig | None)
- property auto_wait: bool
Whether actions automatically sleep until their cooldown expires.
Setting this on the client affects all characters that were created without an explicit per-character override:
client.auto_wait = False # disable globally client.auto_wait = True # re-enable globally
- character(name, *, auto_wait=None)[source]
Return a
Charactercontroller for name.- Parameters:
auto_wait (
Optional[bool]) – Override the client-levelauto_waitsetting for this character. IfNone(default), the character shares the client reference and will reflect any future changes toclient.auto_waitautomatically.name (str)
- Return type: