Rakuten API Client
Rakuten API Client for Deno
Warning This project is currently in beta. There might still be breaking changes. Please be careful to use this.
Supported Endpoints
- Ichiba
- Books
- Total
- Book
- CD
- BooksDVD
- ForeignBook
- Magazine
- Game
- Software
- Genre
- Travel
- Recipe
- Kobo
- GORA
Usage
First you have to get Application ID from here for free.
BooksTotal
import { RakutenAPI, RakutenEnv } from "https://deno.land/x/rakuten/mod.ts"
const client = new RakutenAPI(RakutenEnv.APP_ID!) // RakutenEnv.APP_ID loads RAKUTENN_APP_ID. Or you can pass your app id directly
const res = await client.Books().Total().get({
keyword: "TypeScript",
hits: 3,
})
assertEquals(res.Items.length, 3)
console.log(res.Items.map((i) => i.title)) // response type supported
// Output sample:
// [
// "プロを目指す人のためのTypeScript入門 安全なコードの書き方から高度な型の使い方まで",
// "TypeScriptとReact/Next.jsでつくる実践Webアプリケーション開発",
// "プログラミングTypeScript"
// ]