@animegarden/client
v0.5.5
Published
Anime Garden API client and utils
Maintainers
Readme
🌸 Anime Garden Client
A JavaScript / TypeScript API client for AnimeGarden.
Installation
Requires Node.js 24+ or a browser with the standard Fetch API.
npm i @animegarden/clientUsage
Example:
import { fetchResources } from '@animegarden/client';
// Fetch the first page of resources
const result = await fetchResources();
if (!result.ok) {
throw result.error;
}
console.log(result.resources);
// Fetch matching resources across pages
const botan = await fetchResources({
count: -1,
subject: 543360,
fansub: '喵萌奶茶屋',
keywords: ['简日']
});
if (!botan.ok) {
throw botan.error;
}
console.log(botan.resources);See ./examples/ for more code examples.
Common filters (combined with AND):
| Field | Matching rule |
| --- | --- |
| subjects | Match any of the specified Bangumi subject IDs. |
| fansubs / publishers | Filter by fansub or publisher names, respectively. Match any name; when both are set, either condition suffices. |
| search | Search titles by anime name or keywords. Overrides include. |
| include | The title contains any of the specified terms; useful for searching by anime name. |
| keywords | The title contains every specified term, such as ['1080p', '简日']. |
| exclude | Exclude resources whose titles contain any specified term. |
| after / before | Limit publication dates to an inclusive range. |
A successful fetchResources() result contains these fields:
| Field | Meaning |
| --- | --- |
| ok | true if the request succeeded. |
| resources | Matching resources, deduplicated and sorted from newest to oldest. |
| pagination | The last fetched page number page and page size pageSize; complete: true means there is no next page. |
| filter | The filters actually used by the server after parsing. |
| timestamp | The first successful response time. |
Credits
License
AGPL-3.0 License © 2025 XLor
