Skip to content

Waifu-pics/Waifus4J

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

banner

Official minimal Java wrapper for waifu.pics.
Refer to the docs for available endpoints currently in the API

Add to project

For Maven

<repositories>  
    <repository>  
        <id>jitpack.io</id>  
        <url>https://jitpack.io</url>  
    </repository>  
</repositories>  
<dependency>  
    <groupId>com.github.Waifu-pics</groupId>  
    <artifactId>Waifus4J</artifactId>  
    <version>master-SNAPSHOT</version>  
</dependency>  

For Gradle

allprojects {
    repositories {  
        maven { url 'https://jitpack.io' }  
    }
}
dependencies {  
    implementation 'com.github.Waifu-pics:Waifus4J:master-SNAPSHOT'  
}  

Examples

Get Image URL

Get a random image from waifu endpoint in sfw category

WaifuClient client = new WaifuClient();  
System.out.println(client.getSFWImage(Endpoints.SFW.WAIFU));

Download Image from API

try {
  WaifuClient client = new WaifuClient();
  
  WaifuImage image = client.downloadSFWImage(Endpoints.SFW.WAIFU);  
  
  OutputStream os = new FileOutputStream(image.filename);  
  os.write(image.buffer);  
  os.close();  
} catch (Exception ignored) {}

the available categories are sfw, and nsfw. Available endpoints are here

About

Java API for the waifu.pics API

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages