BooruSharp 1.4.6

There is a newer version of this package available.
See the version list below for details.
dotnet add package BooruSharp --version 1.4.6
NuGet\Install-Package BooruSharp -Version 1.4.6
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="BooruSharp" Version="1.4.6" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add BooruSharp --version 1.4.6
#r "nuget: BooruSharp, 1.4.6"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install BooruSharp as a Cake Addin
#addin nuget:?package=BooruSharp&version=1.4.6

// Install BooruSharp as a Cake Tool
#tool nuget:?package=BooruSharp&version=1.4.6

BooruSharp

BooruSharp is a C# library to browse Booru websites easily BooruSharp currently handle the following websites:

  • booru.allthefallen.moe
  • danbooru.donmai.us
  • e621.net
  • e926.net
  • furry.booru.org
  • gelbooru.com
  • konachan.com
  • lolibooru.moe
  • realbooru.com
  • rule34.xxx
  • safebooru.org
  • sakugabooru.com
  • xbooru.com
  • yande.re

Basic examples

Random image:

BooruSharp.Booru.Gelbooru booru = new BooruSharp.Booru.Gelbooru();
BooruSharp.Search.Post.SearchResult result = await booru.GetRandomImage("hibiki_(kantai_collection)", "school_swimsuit");

Console.WriteLine("Image preview URL: " + result.previewUrl + Environment.NewLine +
                  "Image URL: " + result.fileUrl + Environment.NewLine +
                  "Image is safe: " + (result.rating == BooruSharp.Search.Post.Rating.Safe) + Environment.NewLine +
                  "Tags on the image: " + String.Join(", ", result.tags));

Get tag:

BooruSharp.Booru.Safebooru booru = new BooruSharp.Booru.Safebooru();
BooruSharp.Search.Tag.SearchResult result = await booru.GetTag("cirno");

Console.WriteLine("Tag type: " + result.type + Environment.NewLine +
                  "ID: " + result.id);

Get Wiki entry:

BooruSharp.Booru.Konachan booru = new BooruSharp.Booru.Konachan();
BooruSharp.Search.Wiki.SearchResult result = await booru.GetWiki("loli");

Console.WriteLine("Description: " + result.body + Environment.NewLine +
                  "ID: " + result.id + Environment.NewLine +
                  "Created at: " + result.creation.ToString("dd/MM/yy HH:mm:ss") + Environment.NewLine +
                  "Last update at: " + result.lastUpdate.ToString("dd/MM/yy HH:mm:ss"));

Get related tags:

BooruSharp.Booru.Yandere booru = new BooruSharp.Booru.Yandere();
BooruSharp.Search.Related.SearchResult[] results = await booru.GetRelated("see_through");

Console.WriteLine(String.Join(Environment.NewLine,
    results.Select(delegate (BooruSharp.Search.Related.SearchResult res) { return ("Name: " + res.name +" (" + res.count + ")"); })));

Get comments:

BooruSharp.Booru.Lolibooru booru = new BooruSharp.Booru.Lolibooru();
BooruSharp.Search.Comment.SearchResult[] results = await booru.GetComment(134097);

Console.WriteLine(String.Join(Environment.NewLine,
    results.Select(delegate (BooruSharp.Search.Comment.SearchResult res) { return ("Author: " + res.authorName + ", the " + res.creation.ToString("dd/MM/yy HH:mm:ss") + " - " + res.body); })));

Advanced examples

Get all character tags containing a string:

BooruSharp.Booru.Yandere yandere = new BooruSharp.Booru.Yandere();
BooruSharp.Search.Tag.SearchResult[] results = await yandere.GetTags("tsukiko");
Console.WriteLine(String.Join(Environment.NewLine,
	results.Where(delegate (BooruSharp.Search.Tag.SearchResult res) { return (res.type == BooruSharp.Search.Tag.TagType.Character); })
           .Select(delegate (BooruSharp.Search.Tag.SearchResult res) { return (res.name); })));
Product Compatible and additional computed target framework versions.
.NET Framework net45 is compatible.  net451 was computed.  net452 was computed.  net46 was computed.  net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on BooruSharp:

Package Downloads
BooruSharp.Others

Extension of BooruSharp to handle non-booru websites and handle them like the others

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
4.0.0-beta 326 1/10/2023
3.6.0 459 8/26/2023
3.5.5 10,748 9/28/2022
3.5.4 2,604 8/18/2022
3.5.3 394 8/17/2022
3.5.3-beta 126 8/14/2022
3.5.2-beta 130 8/12/2022
3.5.1-beta 131 8/12/2022
3.5.0-beta 116 8/12/2022
3.4.0 578 8/11/2022
3.3.0 513 6/19/2022
3.2.0 438 5/31/2022
3.1.0 974 3/20/2022
3.0.4 792 1/19/2022
3.0.3 2,389 5/21/2021
3.0.2 1,222 2/5/2021
3.0.1 839 11/17/2020
3.0.0 1,014 11/12/2020
2.11.0 1,649 9/7/2020
2.10.0 1,339 8/18/2020
2.9.0 836 8/17/2020
2.8.1 508 8/17/2020
2.8.0 2,200 8/2/2020
2.7.0 619 7/9/2020
2.6.1 489 7/8/2020
2.6.0 508 7/8/2020
2.5.0 452 7/7/2020
2.4.0 440 7/6/2020
2.3.1 501 6/23/2020
2.3.0 501 6/22/2020
2.2.0 444 6/22/2020
2.1.0 547 6/4/2020
2.0.3 1,032 3/24/2020
2.0.2 501 3/24/2020
2.0.1 493 3/23/2020
2.0.0 503 3/21/2020
1.4.8 643 2/21/2020
1.4.7 540 1/31/2020
1.4.6 624 9/24/2019
1.4.4 992 8/1/2019
1.4.3 658 7/13/2019
1.4.2 792 5/30/2019
1.4.1 865 4/8/2019
1.4.0 736 2/27/2019
1.3.6 903 1/10/2019
1.3.5 750 1/5/2019
1.3.3 929 10/17/2018
1.3.1 886 8/21/2018
1.3.0 913 8/14/2018
1.2.0 880 7/31/2018
1.1.1 830 7/30/2018
1.1.0 872 7/27/2018
1.0.1 888 7/22/2018

Fix minors bug with Atfbooru and Danbooru