https://github.com/p1atdev/cinii
CiNii Research API Client for Deno
https://github.com/p1atdev/cinii
api-client cinii deno
Last synced: 8 months ago
JSON representation
CiNii Research API Client for Deno
- Host: GitHub
- URL: https://github.com/p1atdev/cinii
- Owner: p1atdev
- License: mit
- Created: 2022-08-17T07:55:55.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2022-08-17T13:19:25.000Z (about 3 years ago)
- Last Synced: 2025-01-31T10:17:35.396Z (9 months ago)
- Topics: api-client, cinii, deno
- Language: TypeScript
- Homepage: https://deno.land/x/cinii
- Size: 14.6 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# CiNii Research API Client for Deno

[](https://deno.land/x/cinii])

# Usage
- search from all types
```ts
import { CiNiiClient } from "https://deno.land/x/cinii/mod.ts";
const client = new CiNiiClient({ appId: "your_app_id" }); // or, if not specified, refer to the environment variable CINII_APP_ID
const res = await client.all({
q: "QUIC",
count: 100,
});
assertEquals(res.items.length, 100);
const titles = res.items.map((i) => i.title);
assertArrayIncludes(titles, [
"Improving the performance of HTTP/3 communications when communicating simultaneously which uses CUBIC TCP and TCP BBR",
]);
```
- search from only books
```ts
const client = new CiNiiClient({ appId });
const res = await client.books({
q: "Python",
count: 200,
});
assert(res.items.every((i) => i["dc:type"] === "Book"));
```
- supports all query options
```ts
import { datetime } from "https://deno.land/x/ptera@v1.0.2/mod.ts"; // Date library
const client = new CiNiiClient({ appId });
const res = await client.all({
q: "拾遺和歌集",
count: 10,
dataSourceType: "KAKEN",
from: datetime({
year: 2022,
month: 4,
}),
});
assertExists(res.items[0].title);
```
# Query Reference
**[クエリ仕様 - CiNii Research の OpenSearch](https://support.nii.ac.jp/ja/cir/r_opensearch#query)**