{"id":23739740,"url":"https://github.com/p1atdev/calil","last_synced_at":"2026-03-02T15:30:15.653Z","repository":{"id":39614714,"uuid":"497707433","full_name":"p1atdev/calil","owner":"p1atdev","description":"Calil 図書館 API クライアント for Deno","archived":false,"fork":false,"pushed_at":"2022-08-17T08:32:52.000Z","size":38,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-02-01T08:33:07.088Z","etag":null,"topics":["api-client","calil","deno","denoland","library"],"latest_commit_sha":null,"homepage":"https://deno.land/x/calil","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/p1atdev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-05-29T20:54:19.000Z","updated_at":"2022-05-31T09:36:18.000Z","dependencies_parsed_at":"2022-09-15T21:40:49.026Z","dependency_job_id":null,"html_url":"https://github.com/p1atdev/calil","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/p1atdev%2Fcalil","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/p1atdev%2Fcalil/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/p1atdev%2Fcalil/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/p1atdev%2Fcalil/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/p1atdev","download_url":"https://codeload.github.com/p1atdev/calil/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239880837,"owners_count":19712477,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api-client","calil","deno","denoland","library"],"created_at":"2024-12-31T09:39:03.870Z","updated_at":"2026-03-02T15:30:15.606Z","avatar_url":"https://github.com/p1atdev.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Calil Client\n\n[![deno module](https://shield.deno.dev/x/calil)](https://deno.land/x/calil)\n![deno compatibility](https://shield.deno.dev/deno/^1.22)\n[![vr scripts](https://badges.velociraptor.run/flat.svg)](https://velociraptor.run)\n[![codecov](https://codecov.io/gh/p1atdev/calil/branch/main/graph/badge.svg?token=S37OD55SBF)](https://codecov.io/gh/p1atdev/calil)\n![Testing](https://github.com/p1atdev/calil/actions/workflows/test.yml/badge.svg)\n![Lint](https://github.com/p1atdev/calil/actions/workflows/lint.yml/badge.svg)\n\n図書館蔵書検索 API [Calil(カーリル)](https://calil.jp/) の Deno クライアント\n\nAPI 仕様書: https://calil.jp/doc/api_ref.html\n\n## 使い方\n\n### 図書館の検索\n\n```ts\nimport { CalilClient } from \"https://deno.land/x/calil@v0.1.2/mod.ts\";\n\nconst client = new CalilClient({ appKey: \"your_app_key\" });\n\nconst libraries = await client.searchLibrary({\n  prefecture: \"沖縄\",\n  limit: 2,\n});\n\nconsole.log(libraries);\n```\n\n関数的に\n\n```ts\nimport { createCalilClient } from \"https://deno.land/x/calil@v0.1.2/mod.ts\";\n\nconst client = createCalilClient({ appKey: \"your_app_key\" });\n\nconst libraries = await client.searchLibrary({\n  prefecture: \"沖縄\",\n  limit: 2,\n});\n\nconsole.log(libraries);\n```\n\noutput:\n\n```\n[\n  Library {\n    libraryId: \"102944\",\n    formalName: \"北谷町立北玉小学校図書室\",\n    shortName: \"北玉小学校\",\n    systemId: \"Okinawa_Chatan\",\n    systemName: \"沖縄県北谷町\",\n    libraryKey: \"北玉小学校\",\n    category: \"SMALL\",\n    postalCode: \"904-0105\",\n    tel: \"098-936-3928\",\n    prefecture: \"沖縄県\",\n    city: \"中頭郡北谷町\",\n    address: \"沖縄県中頭郡北谷町字吉原875番地\",\n    location: Location { latitude: 127.7729474, longitude: 26.3137224 },\n    isil: null,\n    faid: null,\n    url: \"https://www.chatan.jp/kosodate/library/\"\n  },\n  Library {\n    libraryId: \"102945\",\n    formalName: \"北谷町立北谷中学校図書室\",\n    shortName: \"北谷中学校\",\n    systemId: \"Okinawa_Chatan\",\n    systemName: \"沖縄県北谷町\",\n    libraryKey: \"北谷中学校\",\n    category: \"SMALL\",\n    postalCode: \"904-0105\",\n    tel: \"098-936-3929\",\n    prefecture: \"沖縄県\",\n    city: \"中頭郡北谷町\",\n    address: \"沖縄県中頭郡北谷町字吉原480番地\",\n    location: Location { latitude: 127.7796607, longitude: 26.3198774 },\n    isil: null,\n    faid: null,\n    url: \"https://www.chatan.jp/kosodate/library/\"\n  }\n]\n```\n\n#### オプション\n\n| 名前          | 説明         | 型        | 例                 |\n| ----------- | ---------- | -------- | ----------------- |\n| appKey?     | アプリケーションキー | string   | `your_key`        |\n| prefecture? | 都道府県       | string   | `東京`              |\n| city?       | 市区町村       | string   | `千代田区`            |\n| systemId?   | システム ID    | string   | `Tokyo_NDL`       |\n| location?   | 緯度\u0026軽度      | Location | 上の返り値 location 参照 |\n| limit?      | 取得数        | number   | `10`              |\n\n`prefecture`、`systemId`、`location`のうち、少なくともどれかは指定する必要があります\n\n※ システム ID とは？\n\n\u003e システム ID\n\u003e は、各図書館が導入している蔵書管理システムの固有の識別子で「Kanagawa_Fujisawa」のようなアルファベットとアンダーラインによって構成されています。\n\u003e 一つのシステム ID には多くの場合、複数の図書館／図書室が紐付いています。市に一つのシステム ID\n\u003e があり、市内の全ての図書館・図書室が含まれていることが多いですが、複数の市町村で共同で一つのシステム ID\n\u003e がある場合や、合併などによって一つの市に複数のシステム ID があることもあります。\n\n詳しくは [カーリル図書館 API 仕様書](https://calil.jp/doc/api_ref.html) を参照\n\n### 貸出状況の検索\n\nクラス的に\n\n```ts\nimport { CalilClient } from \"https://deno.land/x/calil@v0.1.2/mod.ts\";\n\nconst appKey = \"your_app_key\";\n\nconst client = new CalilClient({ appKey });\n\nconst lending = await client.searchLending({\n  isbn: \"9784048923965\", // キノの旅ＸＸ the Beautiful World\n  systemId: \"Tokyo_NDL\",\n});\n\nconsole.log(lending);\n```\n\n関数的に\n\n```ts\nimport { createCalilClient } from \"https://deno.land/x/calil@v0.1.2/mod.ts\";\n\nconst appKey = \"your_app_key\";\n\nconst client = createCalilClient({ appKey });\n\nconst lending = await client.searchLending({\n  isbn: \"9784048923965\", // キノの旅ＸＸ the Beautiful World\n  systemId: \"Tokyo_NDL\",\n});\n\nconsole.log(lending);\n```\n\noutput:\n\n```\nLending {\n  books: [\n    LendingData {\n      isbn: \"9784048923965\",\n      libraries: [\n        LendingLibraryInformation {\n          systemId: \"Tokyo_NDL\",\n          status: \"Cache\",\n          reserveUrl: \"https://ndlonline.ndl.go.jp/#!/detail/R300000001-I027617183-00\",\n          libraryStatus: [ { name: \"東京本館\", status: \"蔵書あり\" } ]\n        }\n      ]\n    }\n  ]\n}\n```\n\n#### オプション\n\n| 名前       | 説明         | 型                                    | 例               |\n| -------- | ---------- | ------------------------------------ | --------------- |\n| appKey?  | アプリケーションキー | string                               | `your_app_key`  |\n| isbn     | 書籍 ISBN    | string                               | `9784048923965` |\n| systemId | システム ID    | string, string[], Library, Library[] | `Tokyo_NDL`     |\n\nsystemId は図書館を指定します。図書館検索で帰ってきた `Library` を渡すことも可能です。\n\n※ ISBN とは\n\n\u003e ISBN（アイエスビーエヌ）は、International Standard Book Number\n\u003e の略称（頭字語）。図書（書籍）および資料の識別用に設けられた国際規格コード（番号システム）の一種。アラビア数字で表される。日本における漢訳名は「国際標準図書番号」。\n\n[Wikipedia - ISBN](https://ja.wikipedia.org/wiki/ISBN)\n\n本の一番後ろのページとかに 必ず書いてある 10 桁、または 13 桁の数字です。ハイフンで区切られていることもあります。Amazon\nの商品ページとかにも載っています。\n\n## 仕様書\n\n詳細な型定義はコードを参照してください\n\nAPI 仕様書: https://calil.jp/doc/api_ref.html\n\nappKey は [ダッシュボード](https://calil.jp/api/dashboard/) から取得できます。無料です。\n\nダッシュボード: https://calil.jp/api/dashboard/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fp1atdev%2Fcalil","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fp1atdev%2Fcalil","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fp1atdev%2Fcalil/lists"}