An unofficial Java library for the Giphy API.
Take a look at the Giphy API page to get your api key.
- The public beta/test key is "dc6zaTOxFJmzC”
Giphy giphy = new Giphy(API_KEY);
SearchFeed feed = giphy.search("cat", 1, 0);
feed.getDataList().get(0).getImages().getOriginal().getUrl();
- fixed_height - Height set to 200px. Good for mobile use.
- fixed_height_still - Static preview image for fixed_height
- fixed_height_downsampled - Height set to 200px. Reduced to 6 frames to minimize file size to the lowest. Works well for unlimited scroll on mobile and as animated previews. See Giphy.com on mobile web as an example.
- fixed_width - Width set to 200px. Good for mobile use.
- fixed_width_still - Static preview image for fixed_width
- fixed_width_downsampled - Width set to 200px. Reduced to 6 frames. Works well for unlimited scroll on mobile and as animated previews.
- fixed_height_small - Height set to 100px. Good for mobile keyboards.
- fixed_height_small_still - Static preview image for fixed_height_small
- fixed_width_small - Width set to 100px. Good for mobile keyboards
- fixed_width_small_still - Static preview image for fixed_width_small
- downsized - File size under 1.5mb.
- downsized_still - Static preview image for downsized
- downsized_medium - File size under 5mb.
- downsized_large - File size under 8mb.
- original - Original file size and file dimensions. Good for desktop use.
- original_still - Preview image for original
Quick showcase how to use the library.
Giphy giphy = new Giphy(API_KEY);
SearchFeed feed = giphy.search("cat", 1, 0);
feed.getDataList().get(0).getImages().getOriginal().getUrl();
Giphy giphy = new Giphy(API_KEY);
SearchGiphy giphyData = giphy.searchByID("feqkVgjJpYtjy");
giphyData.getData().getImages().getOriginal().getUrl();
Giphy giphy = new Giphy(API_KEY);
SearchGiphy giphyData = giphy.translate("superman");
giphyData.getData().getImages().getOriginal().getUrl();
Giphy giphy = new Giphy(API_KEY);
SearchRandom giphyData = giphy.searchRandom("cat");
giphyData.getData().getImageOriginalUrl();
Giphy giphy = new Giphy(API_KEY);
SearchFeed feed = giphy.trend();
feed.getDataList().get(0).getImages().getOriginal().getUrl();
Giphy giphy = new Giphy(API_KEY);
SearchFeed feed = giphy.searchSticker("cat", 1, 0);
feed.getDataList().get(0).getImages().getOriginal().getUrl();
Giphy giphy = new Giphy(API_KEY);
SearchGiphy giphyData = giphy.translateSticker("superman");
giphyData.getData().getImages().getOriginal().getUrl();
Giphy giphy = new Giphy(API_KEY);
SearchRandom giphyData = giphy.trendSticker("cat");
giphyData.getData().getImageOriginalUrl();
Giphy giphy = new Giphy(API_KEY);
SearchFeed feed = giphy.trendSticker();
feed.getDataList().get(0).getImages().getOriginal().getUrl();
Giphy4J can either be downloaded as a JAR file or embedded as Maven dependency.
Download JAR from here.
<dependency>
<groupId>at.mukprojects</groupId>
<artifactId>giphy4j</artifactId>
<version>1.0.1</version>
</dependency>