{"id":23739810,"url":"https://github.com/p1atdev/ndl","last_synced_at":"2026-05-05T04:11:05.003Z","repository":{"id":38358380,"uuid":"499675077","full_name":"p1atdev/ndl","owner":"p1atdev","description":"National Diet Library, Japan API Client for Deno","archived":false,"fork":false,"pushed_at":"2022-08-17T13:42:24.000Z","size":59,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-12-31T09:39:12.016Z","etag":null,"topics":["book","deno","library","ndl"],"latest_commit_sha":null,"homepage":"https://deno.land/x/ndl","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-06-03T23:13:35.000Z","updated_at":"2022-06-05T22:35:36.000Z","dependencies_parsed_at":"2022-08-25T02:41:57.804Z","dependency_job_id":null,"html_url":"https://github.com/p1atdev/ndl","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":"p1atdev/deno_template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/p1atdev%2Fndl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/p1atdev%2Fndl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/p1atdev%2Fndl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/p1atdev%2Fndl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/p1atdev","download_url":"https://codeload.github.com/p1atdev/ndl/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239880865,"owners_count":19712482,"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":["book","deno","library","ndl"],"created_at":"2024-12-31T09:39:18.744Z","updated_at":"2026-03-02T15:30:16.338Z","avatar_url":"https://github.com/p1atdev.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# NDL API Client for Deno\n\n[![deno module](https://shield.deno.dev/x/ndl)](https://deno.land/x/ndl)\n![deno compatibility](https://shield.deno.dev/deno/^1.22)\n[![vr scripts](https://badges.velociraptor.run/flat.svg)](https://velociraptor.run)\n![Test](https://github.com/p1atdev/ndl/actions/workflows/test.yml/badge.svg)\n[![codecov](https://codecov.io/gh/p1atdev/ndl/branch/main/graph/badge.svg?token=SJ2W1IUKCR)](https://codecov.io/gh/p1atdev/ndl)\n[![nest.land](https://nest.land/badge.svg)](https://nest.land/package/ndl)\n\nDeno 用の国立国会図書館の検索 API クライアント\n\nAPI 仕様書: https://iss.ndl.go.jp/information/api/riyou/\n\n# Features\n\n- OpenSearch エンドポイント対応\n\n## Usage\n\n### Import\n\n- deno.land: https://deno.land/x/ndl@v0.1.4/mod.ts\n- nest.land: https://x.nest.land/ndl@v0.1.4/mod.ts\n\n### フリーワード検索\n\n```ts\nimport { OpenSearch } from \"https://deno.land/ndl@v0.1.4/mod.ts\";\n\nconst client = OpenSearch();\n\nconst result = await client.search(\"タコピーの原罪\");\n\nconsole.log(result.count); // 3\n\nconst book = result.items[0];\n\nconsole.log(book.title.value); // \"タコピーの原罪\"\nconsole.log(book.title.pronounciation); // \"タコピー ノ ゲンザイ\"\n\nconsole.log(book.volume); // \"上\"\n\nconsole.log(book.identifier.find((id) =\u003e id.type == \"ISBN\")?.id); // \"9784088830490\"\n\nconsole.log(book.price); // \"630円\"\n```\n\n### パラメーター指定検索\n\n一部のパラメーターは配列にして AND 検索することができます。\n\n```ts\nconst client = OpenSearch();\n\nconst result = await client.search({\n  cnt: 5,\n  title: [\"ダンジョン\", \"飯\"],\n  creator: \"九井諒子\",\n});\n\nconsole.log(result.items.length); // 5\n\nconst book = result.items[0];\n\nconsole.log(book.title.value); // \"ダンジョン飯 = DELICIOUS IN DUNGEON\"\nconsole.log(book.title.pronounciation); // \"ダンジョンメシ\"\n\nconsole.log(book.genre); // \"漫画\"\n\nconsole.log(book.volume); // \"1\"\n\nconsole.log(book.identifier.find((id) =\u003e id.type == \"ISBN\")?.id); // \"9784047301535\"\n\nconsole.log(book.price); // \"620円\"\n```\n\n資料種を指定することもできます。\n\n```ts\nconst client = OpenSearch();\n\nconst result = await client.search({\n  cnt: 3,\n  title: \"キノの旅\",\n  mediatype: \"children\", // 児童書\n});\n\nconsole.log(result.items.length); // 3\n\nconst book = result.items[0];\n\nconsole.log(book.title.value); // \"キノの旅\"\nconsole.log(book.title.pronounciation); // \"キノ ノ タビ\"\n\nconsole.log(book.category); // \"児童書\"\n\nconsole.log(book.identifier.find((id) =\u003e id.type == \"ISBN\")?.id); // \"4840215855\"\n\nconsole.log(book.price); // \"530円\"\n```\n\n指定できるパラメーターの役割については、型定義や\n[仕様書](https://iss.ndl.go.jp/information/wp-content/uploads/2022/05/ndlsearch_api_20220520_jp.pdf)\nを参考にしてください。\n\n## TODO\n\n- プロバイダ型定義\n  ([参考](https://iss.ndl.go.jp/information/wp-content/uploads/2021/12/ndlsearch_api_ap1_20211220_jp.pdf))\n- 未対応の返り値パラメーターの対応\n  ([参考](https://www.ndl.go.jp/jp/dlib/standards/meta/2020/12/terms-list.pdf))\n- 国会議事録検索\n- メタデータ API\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fp1atdev%2Fndl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fp1atdev%2Fndl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fp1atdev%2Fndl/lists"}