Scryfall
class Scryfall(val config: ScryfallConfig = ScryfallConfig(), val engine: HttpClientEngine? = null, logger: (String) -> Unit? = null)
Main entry point for accessing the Scryfall API.
This class provides access to all Scryfall API endpoints through specialized API classes.
Parameters
config
Configuration options for the API client
engine
Optional custom Ktor HTTP engine for testing or advanced use cases
logger
Optional custom logger function for logging HTTP requests/responses. If provided and logging is enabled in config, this logger will be used. If not provided, the default platform logger will be used.
Example usage:
// Basic usage
val scryfall = Scryfall()
val cards = scryfall.cards.search("Lightning Bolt")
// With logging enabled
val scryfall = Scryfall(
config = ScryfallConfig(enableLogging = true),
logger = { message -> println("Scryfall: $message") }
)Content copied to clipboard
Constructors
Link copied to clipboard
constructor(config: ScryfallConfig = ScryfallConfig(), engine: HttpClientEngine? = null, logger: (String) -> Unit? = null)