Skip to content

Post functions

Christian Chaux edited this page Oct 2, 2019 · 9 revisions

The following information allows you to interact with the posts from the Booru websites

GetNbImage returns the numbers of images available on the Booru given some tags. If no tags given, it'll return the total number of images available.

Task<int> GetNbImage(params string[] tags);

GetLimit returns a nullable int corresponding to the limit of images available through the API (see the previous page for more information), null means no limit.

int? GetLimit();

GetImage allows searching an image given an ID and some tags. For example an ID of 2 with a tag of "loli" will give the 3rd image found with this tag.

Task<BooruSharp.Search.SearchResult> GetImage(int id, params string[] tagsArg);

GetRandomImage searches for a random image with the tags given. If no tags are gave, the image will be totally random.

Task<BooruSharp.Search.SearchResult> GetRandomImage(params string[] tags);

BooruSharp.Search.SearchResult is a structure containing the following data:

  • string fileUrl: URL to the image found
  • string previewUrl: A preview of the image found
  • BooruSharp.Search.Rating rating: The rating of the image (Safe, Questionable or Explicit)
  • string[] tags: The list of all the tags on the image
  • uint id: The ID of the image
  • int? size: The size of the image, if available
  • int height: The height of the image
  • int width: The width of the image
  • int? previewHeight: The height of the preview, if available
  • int? previewWidth: The width of the preview, if available
  • DateTime creation: When the image was created
  • string source: From where the image is
  • int score: Score of the image