Skip to content

This is a .NET client library for accessing the scryfall.com API

License

Notifications You must be signed in to change notification settings

Gonkers/Scryfall-API-Client

Repository files navigation

Scryfall API Client

Build status

Getting Started

Until I can get better documentation, see the samples project for examples.


.NET Core Instructions

Add a service definition to your startup.cs file's ConfigureServices method.

services.AddHttpClient<ScryfallApiClient>(client =>
{
    client.BaseAddress = new Uri("https://api.scryfall.com/");
});

Add a ScryfallApiClient parameter and member to your Controller or Razor Page

ScryfallApiClient _scryfallApi { get; }

public IndexModel(ScryfallApiClient scryfallApi)
{
    _scryfallApi = scryfallApi ?? throw new ArgumentNullException(nameof(scryfallApi));
}

Use the client

var randomCard = await _scryfallApi.Cards.GetRandom();

About

This is a .NET client library for accessing the scryfall.com API

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages