Kobo/GenreSearch

Description

Gets a Kobo genre's attributes, children genres and ancestor genres by Kobo genre id.

Resource URL

https://app.rakuten.co.jp/services/api/Kobo/GenreSearch/20131010

Resource Information

Auth Type App Key
Affiliation Support No

Parameters

App ID (string)

The Application ID that identifies your application. You can get it from https://webservice.rakuten.co.jp/.

Kobo Genre ID (string)

Kobo genre ID.

koboGenreId = 101 is the parent genre.

Default Value: 101

Genre path (integer)

Whether or not to include a the ancestor genres in the result set:

Valid Values:

  • 0 do not include ancestors
  • 1 include ancestors

Default Value: 0

Response format (string)

Format for the response output.

You can set this parameter to json or xml. JSON is usually the best option.

If you choose JSON, you can also set the callback parameter in order to use JSONP.

Valid Values:

  • json
  • xml

Default Value: json

Callback function name (string)

Function name to be used with the JSONP output

Please make sure you enter a UTF-8 URL encoded string, containing only a combination of alphanumeric characters, periods and underscores.

Choosing output fields (string)

By default API will return all the fields. You can specify what fields should be returned by using this parameter.

If you want to specify more than one parameter, please use comma (,) as separator.

For example, following request will only return itemName, itemPrice and itemUrl.

elements=itemName,itemPrice,itemUrl

Format version (integer)

Response format version.

If formatVersion=2 is set, the response format (JSON) will be improved.

In case of formatVersion=1:

The API response will return an array using the following format.

For example, you would need to use notation items[0].item.itemName to access itemName parameter.

{"items": [

{"item": {

"itemName": "a",

"itemPrice": 10

}},

{"item": {

"itemName": "b",

"itemPrice": 20

}}

]}

In case of formatVersion=2:

The API response will return an array using the following format.

For example, you would use the notation items[0].itemName to access the itemName parameter.

{"items": [

{

"itemName": "a",

"itemPrice": 10

},

{

"itemName": "b",

"itemPrice": 20

}

]}

Valid Values:

  • 1
  • 2

Default Value: 1

applicationId

App ID
string Required

The Application ID that identifies your application. You can get it from https://webservice.rakuten.co.jp/.

koboGenreId

Kobo Genre ID
string Optional

Kobo genre ID.

koboGenreId = 101 is the parent genre.

Default Value: 101

genrePath

Genre path
integer Optional

Whether or not to include a the ancestor genres in the result set:

Valid Values:

  • 0 do not include ancestors
  • 1 include ancestors

Default Value: 0

format

Response format
string Optional

Format for the response output.

You can set this parameter to json or xml. JSON is usually the best option.

If you choose JSON, you can also set the callback parameter in order to use JSONP.

Valid Values:

  • json
  • xml

Default Value: json

callback

Callback function name
string Optional

Function name to be used with the JSONP output

Please make sure you enter a UTF-8 URL encoded string, containing only a combination of alphanumeric characters, periods and underscores.

elements

Choosing output fields
string Optional

By default API will return all the fields. You can specify what fields should be returned by using this parameter.

If you want to specify more than one parameter, please use comma (,) as separator.

For example, following request will only return itemName, itemPrice and itemUrl.

elements=itemName,itemPrice,itemUrl

formatVersion

Format version
integer Optional

Response format version.

If formatVersion=2 is set, the response format (JSON) will be improved.

In case of formatVersion=1:

The API response will return an array using the following format.

For example, you would need to use notation items[0].item.itemName to access itemName parameter.

{"items": [

{"item": {

"itemName": "a",

"itemPrice": 10

}},

{"item": {

"itemName": "b",

"itemPrice": 20

}}

]}

In case of formatVersion=2:

The API response will return an array using the following format.

For example, you would use the notation items[0].itemName to access the itemName parameter.

{"items": [

{

"itemName": "a",

"itemPrice": 10

},

{

"itemName": "b",

"itemPrice": 20

}

]}

Valid Values:

  • 1
  • 2

Default Value: 1

Response Example

Request

https://app.rakuten.co.jp/services/api/Kobo/GenreSearch/20131010?applicationId=REPLACE_WITH_YOUR_APP_ID&koboGenreId=101901

Response
{
  "current": {
    "koboGenreId": "101901",
    "koboGenreName": "小説・エッセイ",
    "genreLevel": 2
  },
  "children": [
    {
      "child": {
        "koboGenreId": "101901001",
        "koboGenreName": "小説",
        "genreLevel": 3
      }
    },
    {
      "child": {
        "koboGenreId": "101901002",
        "koboGenreName": "エッセイ",
        "genreLevel": 3
      }
    },
    {
      "child": {
        "koboGenreId": "101901003",
        "koboGenreName": "ロマンス",
        "genreLevel": 3
      }
    },
    {
      "child": {
        "koboGenreId": "101901004",
        "koboGenreName": "ホラー",
        "genreLevel": 3
      }
    },
    {
      "child": {
        "koboGenreId": "101901005",
        "koboGenreName": "SF",
        "genreLevel": 3
      }
    },
    {
      "child": {
        "koboGenreId": "101901006",
        "koboGenreName": "ファンタジー",
        "genreLevel": 3
      }
    },
    {
      "child": {
        "koboGenreId": "101901007",
        "koboGenreName": "その他",
        "genreLevel": 3
      }
    }
  ],
  "parents": [
    {
      "parent": {
        "koboGenreId": "101",
        "koboGenreName": "電子書籍",
        "genreLevel": 1
      }
    }
  ]
}

Try It

Set the Parameters

  Show More Parameters

Request

https://app.rakuten.co.jp/services/api/Kobo/GenreSearch/20131010?applicationId=REPLACE_WITH_YOUR_APP_ID

Response