Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/p1atdev/cinii
CiNii Research API Client for Deno
https://github.com/p1atdev/cinii
api-client cinii deno
Last synced: 6 days 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 (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-08-17T13:19:25.000Z (over 2 years ago)
- Last Synced: 2024-12-19T00:36:31.778Z (18 days 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
![deno compatibility](https://shield.deno.dev/deno/^1.24)
[![deno module](https://shield.deno.dev/x/cinii)](https://deno.land/x/cinii])
![Test](https://github.com/p1atdev/cinii/actions/workflows/test.yaml/badge.svg)# 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/[email protected]/mod.ts"; // Date libraryconst 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)**