Bing Image Search API client for java

description

License

License

Categories

Categories

CLI User Interface Search Business Logic Libraries
GroupId

GroupId

org.riversun
ArtifactId

ArtifactId

bing-image-search-client
Last Version

Last Version

1.0.1
Release Date

Release Date

Type

Type

jar
Description

Description

Bing Image Search API client for java
description
Project URL

Project URL

https://github.com/riversun/bing-image-search-client-for-java
Source Code Management

Source Code Management

https://github.com/riversun/bing-image-search-client-for-java

Download bing-image-search-client

How to add to project

<!-- https://jarcasting.com/artifacts/org.riversun/bing-image-search-client/ -->
<dependency>
    <groupId>org.riversun</groupId>
    <artifactId>bing-image-search-client</artifactId>
    <version>1.0.1</version>
</dependency>
// https://jarcasting.com/artifacts/org.riversun/bing-image-search-client/
implementation 'org.riversun:bing-image-search-client:1.0.1'
// https://jarcasting.com/artifacts/org.riversun/bing-image-search-client/
implementation ("org.riversun:bing-image-search-client:1.0.1")
'org.riversun:bing-image-search-client:jar:1.0.1'
<dependency org="org.riversun" name="bing-image-search-client" rev="1.0.1">
  <artifact name="bing-image-search-client" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.riversun', module='bing-image-search-client', version='1.0.1')
)
libraryDependencies += "org.riversun" % "bing-image-search-client" % "1.0.1"
[org.riversun/bing-image-search-client "1.0.1"]

Dependencies

compile (3)

Group / Artifact Type Version
org.riversun : string-grabber jar 0.1.0
com.fasterxml.jackson.core : jackson-databind jar [2.9.9,)
com.fasterxml : jackson-xml-databind jar 0.6.2

test (1)

Group / Artifact Type Version
junit : junit jar 4.7

Project Modules

There are no modules declared in this project.

Overview

Bing Image Search API client for java

Maven Central

It is licensed under MIT.

Quick Start

package com.example;

import org.riversun.bing.client.v5.image_search.*;
import org.riversun.bing.client.v5.image_search.model.*;

public class Example {

	public static void main(String[] args) {

		String apiKey = "[YOUR_API_KEY_OF_BING_SEARCH]";

		BingImageSearchClient client = new BingImageSearchClient(apiKey);

		BingImageSearchResponse response = null;

		try {
			response = client.searchImage(
					new BingImageSearchRequest()
					// keyword
					.keyword.set("the statue of Liberty")
					// from
					.offset.set(0)
					// num of request
					.count.set(5)
					// ex."en-US" "ja-JP"
					.mkt.set("en-US")
					// ex."Strict" "Moderate" "Off"
					.safeSearch.set("Moderate")
					// ex."Small" "Medium" "Large" "Wallpaper" "All"
					.size.set("All")
					);

			for (Image img : response.value) {
				System.out.println("image url=" + img.contentUrl);
			}

		} catch (BingImageSearchException e) {
			e.printStackTrace();
		}

	}
}

How to get your API_KEY

  • Step1. Access https://portal.azure.com
  • Step2. Click "+" mark on the left top.
  • Step3. Enter "Cognitive Services APIs" in the search box.
  • Step4. Select "Cognitive Services APIs" and "Create" it.
  • Step5. Create window will be shown and you can select "Bing Search APIs" in the "API type" selection box.
  • Step6. After entering required items, the resource will be created.
  • Step7. Select resource you created, and click "Keys" in the RESOURCE MANAGEMENT category.

#Downloads

maven

  • Add dependencies to maven pom.xml file.
<dependency>
 <groupId>org.riversun</groupId>
 <artifactId>bing-image-search-client</artifactId>
 <version>0.1.0</version>
</dependency>

Versions

Version
1.0.1
1.0.0
0.1.0