https://github.com/gonkers/scryfall-api-client
This is a .NET client library for accessing the scryfall.com API
https://github.com/gonkers/scryfall-api-client
dotnet scryfall scryfall-api
Last synced: 5 months ago
JSON representation
This is a .NET client library for accessing the scryfall.com API
- Host: GitHub
- URL: https://github.com/gonkers/scryfall-api-client
- Owner: Gonkers
- License: mit
- Created: 2018-04-15T03:48:05.000Z (about 8 years ago)
- Default Branch: main
- Last Pushed: 2024-09-23T05:20:37.000Z (over 1 year ago)
- Last Synced: 2025-12-01T13:44:29.779Z (7 months ago)
- Topics: dotnet, scryfall, scryfall-api
- Language: C#
- Homepage:
- Size: 2.09 MB
- Stars: 16
- Watchers: 4
- Forks: 9
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Scryfall API Client
[](https://gonkers.visualstudio.com/Scryfall-API-Client/_build/latest?definitionId=5)
## Getting Started
Until I can get better documentation, see the [samples project](https://github.com/Gonkers/Scryfall-API-Client/tree/master/samples/ScryfallApi.WebSample) for examples.
---
## .NET Core Instructions
### Add a service definition to your `startup.cs` file's `ConfigureServices` method.
```c#
services.AddHttpClient(client =>
{
client.BaseAddress = new Uri("https://api.scryfall.com/");
});
```
### Add a `ScryfallApiClient` parameter and member to your Controller or Razor Page
```c#
ScryfallApiClient _scryfallApi { get; }
public IndexModel(ScryfallApiClient scryfallApi)
{
_scryfallApi = scryfallApi ?? throw new ArgumentNullException(nameof(scryfallApi));
}
```
### Use the client
```c#
var randomCard = await _scryfallApi.Cards.GetRandom();
```