Skip to content
Ricky Setiawan edited this page Nov 26, 2020 · 2 revisions

Artist

Search all artist with name contain "kantoku".

var client = new DanbooruDonmai();
var artists = await client.ArtistListAsync("kantoku");
foreach (var artist in artists)
{
    Console.WriteLine($"Name: {artist.Name}");
}

Pool

Search all pool with name contain "touhou".

var client = new DanbooruDonmai();
var pools = await client.PoolList("touhou");
foreach (var pool in pools)
{
    Console.WriteLine($"Name: {pool.Name}");
    Console.WriteLine($"Post count: {pool.PostCount}");
}

Get all post inside the pool (use the pool id).

var client = new DanbooruDonmai();
var pools = await client.PoolList("touhou");
foreach (var pool in pools)
{
    Console.WriteLine($"Name: {pool.Name}");
    Console.WriteLine($"Post count: {pool.PostCount}");

    var posts = await client.PoolPostList(pool.ID);
    foreach (var post in posts)
    {
        Console.WriteLine($"Post id: {post.ID}");
    }
}

Post

Get 10 random post without specific tags.

var client = new DanbooruDonmai();
var posts = await client.GetRandomPostAsync(10);
foreach (var post in posts)
{
    Console.WriteLine($"Id: {post.ID}");
    Console.WriteLine($"File url: {post.FileUrl}");
}

Get 10 random post with specific tags (azur_lane).

var client = new DanbooruDonmai();
var posts = await client.GetRandomPostAsync(10, new string[] { "azur_lane" });
foreach (var post in posts)
{
    Console.WriteLine($"Id: {post.ID}");
    Console.WriteLine($"File url: {post.FileUrl}");
}

Tag

Search a Tag with name contain "loli".

Can use asterisk (*)

var client = new DanbooruDonmai();
var tags = await client.TagListAsync("loli");
foreach (var tag in tags)
{
    Console.WriteLine($"Id: {tag.ID}");
    Console.WriteLine($"Name: {tag.Name}");
}

Wiki

Search wiki with title contain "azur lane".

var client = new DanbooruDonmai();
var wikis = await client.WikiListAsync("azur lane");
foreach (var wiki in wikis)
{
    Console.WriteLine($"Id: {wiki.ID}");
    Console.WriteLine($"Name: {wiki.Title}");
}