A Python library for fetching and parsing player data from the Enka Network API for Endfield.
Endfield is an async Python library that provides easy access to player game data from the Enka Network API. It allows developers to retrieve comprehensive information about players, their characters, weapons, equipment, and computed statistics.
- Async Support: Built with asyncio for efficient concurrent requests
- Complete Data Models: Pydantic-based models for type-safe data handling
- Player Showcase Data: Fetch player profiles and their character showcases
- Character Information: Get detailed character data including skills, talents, and stats
- Equipment & Weapons: Access equipment and weapon information
- Stat Computation: Calculate final character statistics with modifiers
- Asset Resolution: Built-in asset resolution with local JSON data
- Update Checking: Check for and download library updates
- Session Management: Flexible session handling with context managers
pip install endfield-pypip install git+https://github.com/MR-LORD-REX/endfield.gitgit clone https://github.com/MR-LORD-REX/endfield.git
cd endfield
pip install -e .- Python 3.8+
- aiohttp >= 3.8.0
- pydantic >= 2.0.0
import asyncio
from endfield import Endfield
async def main():
async with Endfield() as client:
await client.update_assets()
showcase = await client.get_showcase(uid=4225399080)
print(showcase)
asyncio.run(main())async with Endfield(debug=True) as client:
showcase = await client.get_showcase(uid=4225399080)Endfield(
session: Optional[aiohttp.ClientSession] = None,
debug: bool = False
)Parameters:
session: Optional external aiohttp sessiondebug: Enable debug logging (default: False)
Fetch complete player showcase data including all characters, equipment, and weapons.
showcase = await client.get_showcase(uid=4225399080)Returns: ShowcaseData - Complete player showcase information with all characters
Fetch detailed data for a specific character in the player's showcase.
char_data = await client.get_character_showcase(uid=4225399080, index=0)Parameters:
uid: Player UIDindex: Character index (0-based, default: 0)
Returns: CharacterData - Detailed character data including skills, talents, and computed statistics
Fetch player profile information only.
profile = await client.get_profile(uid=4225399080)Returns: PlayerProfile - Player account and character list information
Check for library updates.
await client.check_for_updates()Close the client session.
await client.close()The library provides comprehensive Pydantic models for type-safe data handling:
- ShowcaseData: Complete player showcase information
- PlayerProfile: Player account information
- ProfileCharacter: Character showcase data
- CharacterData: Detailed character information including skills and talents
- WeaponData: Weapon information and skills
- EquipData: Equipment data with stat modifiers
- ComputedStats: Final calculated character statistics
async with Endfield() as client:
showcase = await client.get_showcase(uid="your_uid_here")
profile = showcase.player_info
print(f"Player: {profile.player_name}")
print(f"Level: {profile.level}")async with Endfield() as client:
showcase = await client.get_showcase(uid="your_uid_here")
for char in showcase.characters:
print(f"Character: {char.name}")
print(f"Level: {char.level}")
print(f"Stats: {char.stats}")async with Endfield() as client:
showcase = await client.get_showcase(uid="your_uid_here")
for char in showcase.characters:
if char.weapon:
print(f"{char.name}'s Weapon: {char.weapon.name}")
print(f"Level: {char.weapon.level}")async with Endfield() as ef:
stats = await ef.get_game_stats(token="your_token_here")
if stats:
print(stats.sanity_point.model_dump_json(indent=2))
print(stats.battle_pass.model_dump_json(indent=2))
print(stats.daily_points.model_dump_json(indent=2))
print(stats.weekly_points.model_dump_json(indent=2))
else:
print("Failed to fetch game stats.")async with Endfield() as ef:
msg = await ef.perform_daily_sign(token="your_token_here")
print(msg)async with Endfield() as ef:
blueprints = await ef.get_factory_blueprints(
region='Asia',
item='xiranite',
start=0,
end=10
)
print(blueprints.model_dump_json(indent=2))- Open the skport website (official endfield website) and log in with game account
- Then go to THIS API endpoint (official internal API) to get the token
Contributions are welcome! Please feel free to submit pull requests or open issues on the GitHub repository.
git clone https://github.com/MR-LORD-REX/endfield.git
cd endfield
pip install -e .This project is licensed under the MIT License - see the LICENSE.txt file for details.
This is an unofficial library. Endfield is a trademark of their respective owners. This library is not affiliated with or endorsed by the game developers. Use this library responsibly and in accordance with the Enka Network API terms of service.
For issues, questions, or suggestions, please open an issue on the GitHub repository.
- Built by MR-LORD-REX , telegram
- Data source: Enka Network
- Blueprints data source: endfieldtools.dev
- game V1.3 asset update
- Fixed issue where stats were not being computed correctly
- folder structure changed
- older versions " before v1.1.1 " will not support auto update anymore, you will have to manually update the library to get the latest assets or just update the library to the latest version
- added proxies
- Computation of final character stats are done by the currently known formulas, some of them might be inaccurate , feel free to contribute if you encounter any discrepancies or have suggestions for improvement.
Happy Endfielding