YgoProDeck.Lib
1.0.2
dotnet add package YgoProDeck.Lib --version 1.0.2
NuGet\Install-Package YgoProDeck.Lib -Version 1.0.2
<PackageReference Include="YgoProDeck.Lib" Version="1.0.2" />
<PackageVersion Include="YgoProDeck.Lib" Version="1.0.2" />
<PackageReference Include="YgoProDeck.Lib" />
paket add YgoProDeck.Lib --version 1.0.2
#r "nuget: YgoProDeck.Lib, 1.0.2"
#:package YgoProDeck.Lib@1.0.2
#addin nuget:?package=YgoProDeck.Lib&version=1.0.2
#tool nuget:?package=YgoProDeck.Lib&version=1.0.2
YgoProDeck.Lib
A lightweight, strongly-typed, and asynchronous .NET client library for the YGOPRODeck API v7.
Installation
Install via the .NET CLI:
dotnet add package YgoProDeck.Lib
Or via Package Manager Console:
Install-Package YgoProDeck.Lib
Quick Start
1. Basic Fuzzy Search
Search for cards by fuzzy name with pagination and additional metadata:
using System;
using System.Threading.Tasks;
using YgoProDeck.Lib.EnumValue;
using YgoProDeck.Lib.Query;
using YgoProDeck.Lib.Response;
QueryParameters query = new() {
FuzzyName = "Dark Magician",
Language = Language.English,
Number = 5,
Offset = 0,
Misc = true // Includes release dates, formats, views, and more
};
CardInfoRequester requester = new(query);
CardInfo? result = await requester.RequestAsync();
if (result?.Data is { Count: > 0 } cards) {
foreach (CardData card in cards) {
Console.WriteLine($"[{card.Id}] {card.Name} | {card.Type} | ATK: {card.Atk ?? 0} / DEF: {card.Def ?? 0}");
Console.WriteLine($"Image: {card.CardImages[0].ImageUrl}");
}
}
2. Advanced Filtering (Attributes, Types & Numeric Comparisons)
Filter cards using strongly-typed attributes and numeric comparisons (e.g., Level 8+ DARK Dragons with ATK $\ge$ 3000):
using YgoProDeck.Lib.EnumValue;
using YgoProDeck.Lib.Query;
using YgoProDeck.Lib.Response;
QueryParameters query = new() {
Attribute = [MonsterAttribute.Dark],
Race = [Race.Dragon],
Level = (8, ValueCompare.GreaterThanOrEqual),
ATK = (3000, ValueCompare.GreaterThanOrEqual),
Format = Format.TCG,
Sort = Sort.ATK
};
CardInfoRequester requester = new(query);
CardInfo? result = await requester.RequestAsync();
foreach (var card in result?.Data ?? []) {
Console.WriteLine($"{card.Name} - ATK: {card.Atk}, DEF: {card.Def}, Level: {card.Level}");
}
3. Exact Lookup by Passcode or Name
Lookup specific cards directly by 8-digit passcode or exact card names:
// Lookup by 8-digit passcode (e.g., Blue-Eyes White Dragon: 89631139)
QueryParameters queryById = new() {
ID = [89631139]
};
// Or lookup by exact card name(s)
QueryParameters queryByName = new() {
Name = ["Ash Blossom & Joyous Spring", "Effect Veiler"]
};
CardInfo? result = await new CardInfoRequester(queryById).RequestAsync();
Console.WriteLine(result?.Data.FirstOrDefault()?.Desc);
4. Error Handling & Pagination Metadata
using System.Net.Http;
QueryParameters query = new() {
Archetype = "Blue-Eyes",
Number = 10,
Offset = 0
};
try {
CardInfoRequester requester = new(query);
CardInfo? result = await requester.RequestAsync();
if (result?.Meta is { } meta) {
Console.WriteLine($"Total cards found: {meta.TotalRows} (Page: {meta.TotalPages - meta.PagesRemaining}/{meta.TotalPages})");
}
}
catch (HttpRequestException ex) {
// Thrown if the card was not found (400 Bad Request) or network failure occurs
Console.WriteLine($"Request failed: {ex.Message}");
}
Data Source & Attribution
Data is retrieved from the YGOPRODeck API. Please review their API terms of service and rate limits when using this library.
License
This project is licensed under the MIT License.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net8.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.