scapi is an unofficial asynchronous wrapper for external STALCRAFT API.
It provides access to read-only game endpoints including auction, emissions, clans, profiles, and etc.
AppClientandUserClientfor API requestsOAuthClientfor OAuth 2.0 authorization flowsDatabaseLookupfor items search- Typed Pydantic model responses
- Configurable default parameters
- Rate limit information access
To use the API, you must register an application and receive approval. Use App tokens for public resources or User tokens (via OAuth) for player-specific resources like character friends. Demo API is available at https://dapi.stalcraft.net for testing without registration.
pip install stalcraft-api -Ufrom scapi import AppClient, Region
import asyncio
import os
# Initialize app client with your credentials
client = AppClient(client_id=os.getenv("CLIENT_ID"), client_secret=os.getenv("CLIENT_SECRET"))
# OR use generated token from OAuthClient
client = AppClient(token=os.getenv("APP_TOKEN"))
async def main():
# Get emission status for current region
emission = await client.emission()
print(f"Last emission ended at: {emission.previous_end}")
# Get public character information
profile = await client.profile("ZIV")
print("Character profile:", profile)
# Fetch last 3 auction lots for item with id "zyv9"
lots = await client.auction("zyv9").lots(limit=3)
print("Actual lots:", lots)
# Other methods can be know in docs:
# https://sc-api.rtfd.io
asyncio.run(main())Complete documentation is available at sc-api.readthedocs.io, including: