OpenAPI 3.0.3 spec for the Wanikani API

Hi there,

Inspired by @dogboydog Wanikani CLI tool here: WaniKani CLI + Typescript API library - I thought it might be useful if we had an OpenAPI spec for the Wanikani API, to make it easy to generate clients regardless of which language you’re working in. To that end, I’ve scraped and transcribed all of the endpoints, request/response bodies, documentation and examples from WaniKani API Reference into an OpenAPI v3 spec document. The repository is here: GitHub - jleskovar-tyro/wanikani-oas-spec

You can test it out by copying the yaml into https://editor.swagger.io/, plugging in your API key and playing around with it.

I’ve successfully generated clients for Typescript using a couple of different client generators (OpenAPITools “typescript-axios” and openapi-typescript-codegen), which I’m actively using in a couple of my own pet projects. There is a known issue with some of the OpenAPITools client generators, that don’t seem to handle the “OneOf” construct nicely (used to describe Subjects, which can be either Kanji, Radicals or Vocabs). There are various workarounds though, and hopefully the generators improve over time.

Anyway, just thought I’d share. Hope somebody finds this useful :slight_smile:

6 Likes

sorry for reviving this topic after 3 years. was just curious is this openAPI scheme for wanikani is being maintained, and if it can still be used?
I am not a developer,but i was thinking of playing a bit with Google Cloud’s new Vertex AI Agent builder, and integrate WaniKani as a Tool (Tools  |  Vertex AI Agents  |  Google Cloud). potentially thinking of creating an agent which can create context sentences using words i have already mastered in Wanikani.
So wandering this this scheme is up to date and is still usable, considering many changes in Wanikani APi through recent couple of years