Skip to main content

akef

Async Python wrapper for Arknights: Endfield. Your SKPORT account card, operators with gear, pull history, endgame records, daily check-in and the wiki. Also public Enka profiles by UID, and final stats like the ones on the in-game stat screen for any operator.

Install

pip install akef

Python 3.10+. Full docs on the docs site (also in docs/), a script for every feature in examples/.

Usage

import asyncio
import akef


async def main():
    async with akef.Client("your account token") as client:
        card = await client.card()
        print(card.name, card.base.level, card.base.world_level)
        print(f"sanity {card.stamina.current}/{card.stamina.max}")

        for op in card.chars:
            print(op.rarity, op.name, op.level, op.weapon.name)


asyncio.run(main())

Login, request signing and logging back in when the session runs out, all handled for you.

Methods

Everything comes back as a pydantic model. Fields SKPORT adds later still show up in model_extra. Pass raw=True to any of them to get the plain API dict instead.

Method Gives you
card(uid=None) profile, operators with gear, sanity, dailies, battle pass, regions, dijiang, contracts, war echoes
character(who, uid=None) one operator or a list, by name (any case or spacing) or SKPORT id
monument(uid=None) endgame events: stages, rules, enemies, best clear team and time, medals
contract(uid=None) current Contingency Contract: every run with its team, all indicators with their effect text, enemies
pulls(uid=None, after=None, since=None) whole pull history with pity per banner
inventory(uid=None) every owned operator, weapon, gear piece and tactical, with counts
attendance(uid=None) this month's check-in calendar and rewards
check_in(uid=None) claims today's check-in, raises AlreadyCheckedIn if its done
news() the in-game notice board
wiki(kind) / wiki_item(id) SKPORT's official database
wiki_index() every wiki item by id, for naming the materials a page links to
char_banners() / weapon_banners() current banners
roles() / role(uid=None) Endfield accounts on the login
enums() game enums: professions, elements, rarities...
profile() SKPORT user profile
account() Gryphline account info

uid=None means the default account on the login.

Housekeeping
Method
login() log in now instead of on the first request
refresh() get a new signing key, akef does this by itself when it goes stale
clear_cache() forget cached reads
close() close the session, or just use async with
Wiki kinds and readable pages

operators, weapons, threats, gear, facilities, items, essence, valuables

ops = await client.wiki("operators")
arcane = await client.wiki_item(next(o for o in ops if o.name == "Arcane").id)
print(arcane.description)

page = akef.wiki_page(arcane, await client.wiki_index())   # quote, bio, skills, talents, lore...
print(page.quote, [s.name for s in page.skills])

The raw page is a deep tree of blocks, wiki_page() turns it into plain fields so you dont dig through it.

Enka and final stats

SKPORT only says what an operator has equipped, not the numbers on their stat screen. akef.Enka works them out same way enka.network does, from Enka's public game data. We checked them against the site and the game, they match.

async with akef.Enka() as enka:
    profile = await enka.profile(4727743200)      # any public UID, no token needed
    si = profile.build("Si")
    print(si.stats.hp, si.stats.atk, si.stats.crit_rate)

Enka only sees the 4 operators in the showcase. With a SKPORT card you get anyone on the account:

async with akef.Client(token) as client, akef.Enka() as enka:
    card = await client.card()
    build = await enka.build(card, "Arcane")
    print(build.stats.atk, build.gear[0].lines)
Method Gives you
profile(uid) showcased operators with final stats, plus the player's profile
build(card, name) final stats for any operator on a SKPORT card
player(card) the whole roster as a profile
update() pull new game tables after a patch
clear_cache() forget cached Enka answers

First call downloads Enka's game tables (few MB) and keeps them on disk. After a patch they refresh by themselves when something new shows up. More in docs/enka.md, and how the numbers got checked in docs/stats.md.

Pull history

pulls = await client.pulls()
for p in pulls.pity():
    print(p.name, f"{p.since_six}/{p.hard}")

pulls.save("pulls.json")                  # or pulls.csv
old = akef.Pulls.load("pulls.json")
newer = await client.pulls(since=old)     # only fetches whats new and merges it in
recent = await client.pulls(after=date(2026, 11, 1))

SKPORT hands out pulls 5 a page, so first full grab of a big account takes a while. Save it and pass since= next time. Passing another UID's saved pulls raises a ValueError, so two accounts never get mixed.

pulls.operators, pulls.weapons and pulls.gifts hold the pulls. pulls.banner("standard") and pulls.weapon_banner(pool_id) filter one banner, pulls.to_csv() and pulls.to_json() give the text without saving.

How pity is counted
Banner Hard pity Featured
Limited operators 80, shared across limited banners 120, per banner
Standard 80 300
Beginner 50
Weapons 40 80

Free urgent recruitment pulls dont move pity.

Getting a token

While signed in to skport.com, open https://web-api.skport.com/cookie_store/account_token. You get back something like {"code":0,"data":{"content":"..."}}, the content string is your token.

That token is a full login for your account, dont share it with anyone.

Caching and logins

Reads stay in memory for a short while, so a bot where ten people check the same account sends one request, not ten. If the same request is already on its way, other callers wait for it instead of sending their own.

What Kept for
card(), character(), attendance(), inventory() 1 minute
monument(), contract(), profile() 5 minutes
Enka.profile() as long as Enka's own ttl says, about a minute
banners 10 minutes
enums(), wiki 1 hour

Errors are never cached and check_in() clears the cached calendar.

client = akef.Client(token, cache=False)                     # no cache
client.clear_cache()                                         # fresh data next call
client = akef.Client(token, login_file="skport_login.json")  # keep the login between runs
client = akef.Client(token, debug=True)                      # log every request

Every new Client logs in first, thats two requests. With login_file it saves the login and your account list, so a restart only pays for what you ask. If SKPORT expires it, akef logs in again by itself and updates the file. Keep that file private, it works like the token. Debug logs only show the path, never tokens or query strings.

Errors

try:
    card = await client.card()
except akef.AuthError:
    ...  # token is dead, get a new one
except akef.NoRoleError:
    ...  # no Endfield account on this login
except akef.AkefError as e:
    print(e.code, e.message)
All errors
Error When
AkefError base of all of them, has .code and .message
AuthError token rejected or expired
NoRoleError no Endfield account bound to the login
NetworkError couldnt reach SKPORT or Enka
APIError SKPORT said no for some other reason
AlreadyCheckedIn check_in() when today is already claimed
UnknownCharacter character() or Enka.build() with a name that doesnt match anyone
PlayerNotFound Enka doesnt know the UID
ShowcaseEmpty Enka player has nothing in their showcase
MissingGameData something from a new patch isnt in Enka's data yet
GameDataError saved game tables are broken, await enka.update()

Examples

Script Shows
card.py the basics off your account card
operators.py every operator with skills, weapon and gear
character.py look up operators by name
pulls.py pull history, pity, save, load, csv
monument.py monument events and clear teams
contract.py contract runs, teams and indicators
endgame.py contracts and war echoes off the card
inventory.py everything you own
attendance.py, check_in.py daily check-in
banners.py current banners
news.py notice board
wiki.py the official wiki, and pages made readable
enka.py a public profile by UID with final stats
final_stats.py final stats and gear lines for your whole roster
world.py regions and dijiang
caching.py cache, login file and debug logs
errors.py catching errors
raw.py plain API dicts
roles.py, account.py, profile.py, enums.py account side stuff

They read the token from SKPORT_TOKEN or ~/.skport_token, except enka.py which only needs a UID.

Image cards

Want all this as pictures? akef-cards draws it: operator builds, profiles, pull history, endgame and more. akef gets the data, akef-cards only draws.

License

MIT. Game data for the stat math comes from Enka.Network, thanks enka. Not affiliated with Hypergryph or Gryphline.

Metadata

Release files for akef 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for akef 1.0.0
File Size Uploaded Provenance Actions
akef-1.0.0.tar.gz 54.2 kB Without provenance Details for akef-1.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for akef 1.0.0
File Interpreter ABI Platform Actions
akef-1.0.0-py3-none-any.whl Python 3 none any Details for akef-1.0.0-py3-none-any.whl

Total release size: 102.0 kB

Release files / akef-1.0.0.tar.gz

Download URL akef-1.0.0.tar.gz
Size 54.2 kB
Tags Source
SHA-256 checksum
How to use checksums
3545a61a9a04fa0a98b60b56ffda01bb0becd492afaf9d156e24f958622836b2
BLAKE2b-256 checksum
How to use checksums
64d8565274254a78a5905303681b652513db88b119d99c0dd353ae4dc741d842
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.10

Release files / akef-1.0.0-py3-none-any.whl

Download URL akef-1.0.0-py3-none-any.whl
Size 47.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
49e1e5197053afa6334f427e4dc2e0be8b802b178abb88644da622f53d3ecb12
BLAKE2b-256 checksum
How to use checksums
980f2d617edde938b889e5fb3459fc921e1558bb3d928d51ef2ef3b01efb084c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.10

Security for akef 1.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page