{"id":48229827,"url":"https://github.com/asmelabs/olib","last_synced_at":"2026-04-04T19:30:28.925Z","repository":{"id":337771000,"uuid":"1155117365","full_name":"asmelabs/olib","owner":"asmelabs","description":"An SDK for the OpenLibrary platform","archived":false,"fork":false,"pushed_at":"2026-02-11T12:12:28.000Z","size":75,"stargazers_count":0,"open_issues_count":4,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-02-11T14:33:02.031Z","etag":null,"topics":["bun","internetarchive","javascript","openlibrary","openlibrary-api","sdk","typescript"],"latest_commit_sha":null,"homepage":"","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/asmelabs.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":".github/CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":".github/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":".github/SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":"mehdiasadli"}},"created_at":"2026-02-11T06:21:02.000Z","updated_at":"2026-02-11T12:12:17.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/asmelabs/olib","commit_stats":null,"previous_names":["asmelabs/olib"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/asmelabs/olib","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asmelabs%2Folib","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asmelabs%2Folib/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asmelabs%2Folib/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asmelabs%2Folib/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/asmelabs","download_url":"https://codeload.github.com/asmelabs/olib/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asmelabs%2Folib/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31410748,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-04T19:29:44.979Z","status":"ssl_error","status_checked_at":"2026-04-04T19:29:11.535Z","response_time":60,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["bun","internetarchive","javascript","openlibrary","openlibrary-api","sdk","typescript"],"created_at":"2026-04-04T19:30:28.422Z","updated_at":"2026-04-04T19:30:28.917Z","avatar_url":"https://github.com/asmelabs.png","language":"TypeScript","readme":"# @asmelabs/olib\n\nA type-safe TypeScript SDK for the [Open Library API](https://openlibrary.org/developers/api).\n\n\u003e **Status:** Work in progress 🚧\n\n## Why?\n\nOpen Library is an incredible open-source project — a free, editable catalog aiming to have one web page for every book ever published. But working with its API in TypeScript is painful:\n\n- **No type safety.** Response shapes are undocumented, inconsistent, and polymorphic. A `description` field might be a `string` or `{ type: string; value: string }`. Good luck.\n- **No official TypeScript SDK.** There's a Python client, but nothing for the JS/TS ecosystem.\n- **Verbose and scattered docs.** You end up reading source code to understand what you'll actually get back.\n\n`@asmelabs/olib` fixes all of that — Zod-validated responses, normalized types, and a clean API surface.\n\n## Install\n\n```bash\n# bun\nbun add @asmelabs/olib\n\n# npm\nnpm install @asmelabs/olib\n\n# yarn\nyarn add @asmelabs/olib\n\n# pnpm\npnpm add @asmelabs/olib\n```\n\n## Quick Start\n\n```ts\nimport { createOpenLibraryClient } from \"@asmelabs/olib\";\n\nconst ol = createOpenLibraryClient();\n\n// Search for books\nconst results = await ol.search(\"Fantastic Mr Fox\"); // #not implemented yet\n\n// Get a work by its Open Library ID\nconst work = await ol.works.get(\"OL45804W\"); // #not implemented yet\n\n// Get an edition by ISBN\nconst edition = await ol.editions.getByISBN(\"9780140328721\"); // #not implemented yet\n\n// Get an author\nconst author = await ol.authors.get(\"OL34184A\");\n\n// Build a cover image URL\nconst coverUrl = ol.covers.book(\"9780140328721\").type(\"isbn\").size(\"M\").build();\n// =\u003e \"https://covers.openlibrary.org/b/isbn/9780140328721-M.jpg\"\n```\n\n## Features\n\n- 🔒 **Type-safe** — Full TypeScript types for all endpoints, powered by Zod schemas\n- ✅ **Runtime validation** — Responses are parsed and validated at runtime, not just at compile time\n- 🌐 **Universal** — Works in Node.js, Bun, Deno, and browsers (uses `fetch`)\n- 📦 **Tree-shakeable** — ESM-first, import only what you need\n- 🧩 **Normalized responses** — Polymorphic fields like `description` are normalized to consistent types\n- 📖 **Covers helper** — URL builder for book covers and author photos without extra API calls\n\n## API Coverage\n\n| Module       | Endpoints                                | Status               |\n| ------------ | ---------------------------------------- | -------------------- |\n| **Search**   | Books, Authors, Subjects                 | #not implemented yet |\n| **Works**    | Get, Editions, Ratings, Bookshelves      | #not implemented yet |\n| **Editions** | Get, by ISBN                             | #not implemented yet |\n| **Authors**  | Get, Works                               | ✅                   |\n| **Covers**   | Book covers, Author photos (URL builder) | ✅                   |\n| **Subjects** | Get                                      | #not implemented yet |\n\n## Docs\n\n→ Full documentation coming soon.\n\n## Requirements\n\n- TypeScript ≥ 5.0\n- A `fetch`-compatible runtime (Node 18+, Bun, Deno, modern browsers)\n\n## Contributing\n\nContributions are welcome! Please read the [Contributing Guide](./CONTRIBUTING.md) before submitting a PR.\n\n## License\n\n[MIT](./LICENSE)\n\n## Credits\n\nBuilt and maintained by Asme Labs.\n\nOpen Library is a project of the [Internet Archive](https://archive.org), a 501(c)(3) non-profit.\n","funding_links":["https://github.com/sponsors/mehdiasadli"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fasmelabs%2Folib","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fasmelabs%2Folib","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fasmelabs%2Folib/lists"}