stalcraft api unofficial python library
Project description
scapi: Python Client for STALCRAFT API
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.
✨ Features
AppClientandUserClientfor API requestsOAuthClientfor OAuth 2.0 authorization flowsDatabaseLookupfor items search- Typed Pydantic model responses
- Configurable default parameters
- Rate limit information access
📌 Before You Start
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.
🛠️ Installation
pip install stalcraft-api -U
🚀 Quick Start
from 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())
📚 Documentation
Complete documentation is available at sc-api.readthedocs.io, including:
- Guides: clients, oauth, database lookup
- Library API Reference
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file stalcraft_api-2.0.1.tar.gz.
File metadata
- Download URL: stalcraft_api-2.0.1.tar.gz
- Upload date:
- Size: 32.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.10.2 {"installer":{"name":"uv","version":"0.10.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e413ce6994de6a628c844deff1ad592fe7b32e1dc4166485f9529228f4d7633c
|
|
| MD5 |
ba4add3533226f3fe5cc489820d1997f
|
|
| BLAKE2b-256 |
8a4a6fef9dffc42264a3e7f3fec293a0242c028c33c4052e4fa590fab03c948e
|
File details
Details for the file stalcraft_api-2.0.1-py3-none-any.whl.
File metadata
- Download URL: stalcraft_api-2.0.1-py3-none-any.whl
- Upload date:
- Size: 32.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.10.2 {"installer":{"name":"uv","version":"0.10.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2adabca81cbc80cd97eb70ca7af5491118ed1ab6184d8c98c4058316b206edcb
|
|
| MD5 |
5f17960e84ba9086b544d21bee8bb44f
|
|
| BLAKE2b-256 |
2e7f90abd214316cd9c3bf66e75f124d2c272907e574166983fde17d9754dadf
|