Skip to content

Client Parameters

seria edited this page May 15, 2024 · 2 revisions

About AmbrAPI

AmbrAPI is the main class that you use to interact with the ambr API.
The AmbrAPI class has the following parameters:

Language

Changes the language of contents returned by the wrapper, such as weapon names, character names, etc.

import ambr

async with ambr.AmbrAPI(ambr.Language.CHT) as api:
    ...

Headers

Changes the headers when requesting to the Enka Network API, default is {"User-Agent": "ambr-py"}

import ambr

async with ambr.AmbrAPI(headers={"User-Agent": "MyDiscordBot-1.0"}) as client:
    ...

Cache TTL

The time to live (ttl) in seconds for the internal cache to be evicted, the default is 3600 seconds.

import ambr

async with ambr.AmbrAPI(cache_ttl=30) as client:
   ...
Clone this wiki locally