{"id":23583966,"url":"https://github.com/maks11060/openapi","last_synced_at":"2026-01-16T19:40:31.690Z","repository":{"id":269082055,"uuid":"890460198","full_name":"MAKS11060/openapi","owner":"MAKS11060","description":"OpenAPI schema for Danbooru, Shikimori","archived":false,"fork":false,"pushed_at":"2026-01-13T10:08:11.000Z","size":4416,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-01-13T10:36:19.990Z","etag":null,"topics":["danbooru","openapi","openapi31","shikimori"],"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/MAKS11060.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,"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}},"created_at":"2024-11-18T15:52:52.000Z","updated_at":"2026-01-13T10:08:14.000Z","dependencies_parsed_at":"2025-07-10T09:10:23.894Z","dependency_job_id":null,"html_url":"https://github.com/MAKS11060/openapi","commit_stats":null,"previous_names":["maks11060/openapi"],"tags_count":14,"template":false,"template_full_name":null,"purl":"pkg:github/MAKS11060/openapi","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MAKS11060%2Fopenapi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MAKS11060%2Fopenapi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MAKS11060%2Fopenapi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MAKS11060%2Fopenapi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MAKS11060","download_url":"https://codeload.github.com/MAKS11060/openapi/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MAKS11060%2Fopenapi/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28481925,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-16T11:59:17.896Z","status":"ssl_error","status_checked_at":"2026-01-16T11:55:55.838Z","response_time":107,"last_error":"SSL_read: 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":["danbooru","openapi","openapi31","shikimori"],"created_at":"2024-12-27T02:18:44.975Z","updated_at":"2026-01-16T19:40:31.682Z","avatar_url":"https://github.com/MAKS11060.png","language":"TypeScript","readme":"# OpenAPI schemas\n\nUnofficial OpenAPI schemas for some public APIs\n\n- [Danbooru](#danbooru)\n- [Shikimori](#shikimori)\n\n\u003e [!NOTE]\n\u003e\n\u003e - **OpenAPI 3.1**\n\u003e - Code examples [`/example`](example)\n\u003e - Schemas definitions in [zod](https://zod.dev/)\n\u003e - OpenAPI Builder [`jsr:@maks11060/openapi`](https://jsr.io/@maks11060/openapi)\n\n## Danbooru\n\n- [Danbooru](https://danbooru.donmai.us/)\n  - [Api Wiki](https://danbooru.donmai.us/wiki_pages/help:api)\n  - [Search Cheatsheet](https://danbooru.donmai.us/wiki_pages/help%3Acheatsheet)\n  - [Danbooru Help Table of Contents](https://danbooru.donmai.us/wiki_pages/help:toc#dtext-developer_guide)\n- [Code example](./example/danbooru.ts)\n- [Redoc][danbooru.redoc]\n- [Swagger Editor][danbooru.swagger]\n\n### Typescript client with [openapi-fetch](https://openapi-ts.dev/openapi-fetch/)\n\n#### 1. Generating types from OpenAPI schema\n\n```ps\ndeno run -A npm:openapi-typescript \\\n  https://github.com/MAKS11060/openapi/releases/latest/download/danbooru.openapi.yaml \\\n  -o ./danbooru.oas.ts\n```\n\n```ps\nnpx openapi-typescript \\\n  https://github.com/MAKS11060/openapi/releases/latest/download/danbooru.openapi.yaml \\\n  -o ./danbooru.oas.ts\n```\n\n#### 2. Create openapi-fetch client\n\n```ts\n// danbooru.ts\nimport createClient from 'openapi-fetch'\nimport type {paths} from './danbooru.oas.ts'\n\n// Almost all GET requests do not require authorization.\n// To use 'saved searches', you need an ApiKey.\n// Register api key: https://danbooru.donmai.us/profile =\u003e API Key\n// const login = ''\n// const apiKey = ''\n// const authorization = new TextEncoder().encode(`${login}:${apiKey}`).toBase64()\n\n// deep serializer / {search: {id: [1,2]}} =\u003e ?search[id]=1,2\nfunction querySerializer(\n  obj: Record\u003cstring, unknown\u003e,\n  params: URLSearchParams = new URLSearchParams(),\n  prefix = '',\n): string {\n  for (const [key, value] of Object.entries(obj)) {\n    const encodedKey = encodeURIComponent(key)\n    const paramKey = prefix ? `${prefix}[${encodedKey}]` : encodedKey\n    if (value == null) continue\n    if (Array.isArray(value)) {\n      if (value.length === 0) continue\n      params.append(paramKey, value.map(String).join(','))\n    } else if (typeof value === 'object' \u0026\u0026 value !== null) {\n      querySerializer(value as Record\u003cstring, unknown\u003e, params, paramKey)\n    } else {\n      params.append(paramKey, String(value))\n    }\n  }\n\n  return params.toString()\n}\n\nexport const danbooruApi = createClient\u003cpaths\u003e({\n  baseUrl: 'https://danbooru.donmai.us',\n  // headers: {authorization},\n  querySerializer,\n})\n```\n\n## Shikimori\n\n- [Shikimori](https://shikimori.one/)\n  - [Developer API](https://shikimori.one/api/doc)\n- [Code example](./example/shikimori.ts)\n- [Redoc][shikimori.redoc]\n- [Swagger Editor][shikimori.swagger]\n\n### Typescript client with [openapi-fetch](https://openapi-ts.dev/openapi-fetch/)\n\n#### 1. Generating types from OpenAPI schema\n\n```ps\ndeno run -A npm:openapi-typescript \\\n  https://github.com/MAKS11060/openapi/releases/latest/download/shikimori.openapi.yaml \\\n  -o ./shikimori.oas.ts\n```\n\n```ps\nnpx openapi-typescript \\\n  https://github.com/MAKS11060/openapi/releases/latest/download/shikimori.openapi.yaml \\\n  -o ./shikimori.oas.ts\n```\n\n```ts\n// shikimori.ts\nimport createClient from 'openapi-fetch'\nimport type {paths} from './shikimori.oas.ts'\n\n// Requirements\n// Add your Oauth2 Application name to User-Agent requests header.\n// Don’t mimic a browser.\n// Your IP address may be banned if you use API without properly set User-Agent header.\nconst shikimoriUserAgent = ''\n\nexport const shikimoriApi = createClient\u003cpaths\u003e({\n  baseUrl: 'https://shikimori.one',\n  headers: {'user-agent': shikimoriUserAgent},\n})\n```\n\n[shikimori.redoc]: https://redocly.github.io/redoc/?url=https://github.com/MAKS11060/openapi/releases/latest/download/shikimori.openapi.yaml\n[shikimori.swagger]: https://editor-next.swagger.io/?url=https://no-cors.deno.dev/https://github.com/MAKS11060/openapi/releases/latest/download/shikimori.openapi.yaml\n[danbooru.redoc]: https://redocly.github.io/redoc/?url=https://github.com/MAKS11060/openapi/releases/latest/download/danbooru.openapi.yaml\n[danbooru.swagger]: https://editor-next.swagger.io/?url=https://no-cors.deno.dev/https://github.com/MAKS11060/openapi/releases/latest/download/danbooru.openapi.yaml\n\n## Build\n\n\u003e [!NOTE]\n\u003e **Project structure**\n\u003e\n\u003e - `src/{service}/`\n\u003e   - `mod.ts` - Entry point\n\u003e   - `openapi.ts` - Config\n\u003e   - `schema.ts` - Data models\n\n### Prerequisites\n\n#### Install [Deno](https://github.com/denoland/deno/?tab=readme-ov-file#installation)\n\n\u003e Install dependencies\n\n```ps\ndeno run init\n```\n\n#### Check formatting and build\n\n```ps\ndeno run ok\n```\n\n#### Build OpenAPI Schemas\n\n```ps\ndeno run build\n```\n\n#### Build client types in [example](./example/)\n\n```ps\ndeno run build:client\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaks11060%2Fopenapi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmaks11060%2Fopenapi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaks11060%2Fopenapi/lists"}