API V2 Beta Documentation

Howdy everyone. I’m working on a personal project that’s using API V2 (I initially wrote it using V1, but decided we might as well get the conversion done now since it’s a personal project and not being distributed).

Anyways, I notice when I pull a subject that we only have images and SVGs in black (as opposed to white for V1) for the subjects that lack a unicode character, and was curious if anyone had a good approach to overcoming this Do you fall back to V1? Grab the SVG and style it? Should I just be patient and wait for white variants of the PNGs?

Thanks in advance!

You can use the SVGs without styling, then add your own CSS. That’s what I do on wkstats.com:10001.

Or put a stronger CSS rule to override the default stroke color.

I popped up my account and inspected the radicals in Chrome, and that does look like a good approach. I’ll make note to try something similar.

Thanks for the speedy reply!

1 Like

Hi all,

Just want to give a heads up on changes we will be releasing on Monday.

  1. We have started a WaniKani API mailing list. This is for new, announcements, and updates in regards to the WaniKani API. The mailing list can be found here.
  2. Subjects (Radical, Kanji, Vocabulary) payloads are going to include all the WaniKani content such as the mnemonics, pronunciation audio, context sentences, et cetera. The current structure and attributes will remain the same, but they’ll now be additional attributes to cover the additions. I recommend you all review the Terms of Service, especially the API section. If you have a public application please respect the subscription restrictions. You all can now stop scraping our website :stuck_out_tongue:
  3. Speaking of adding our content to the Subject payloads we have finished recording and editing new audio for all vocabulary in our system. This content will be live only in API v2 for now. We plan on replacing the old audio currently being delivered on the web app with the new audio in the near future. The new audio is a native male speaker (with a less pronounced Tokyo accent). We are finishing up the native female speaker and will include her pronunciations. In the end there will be a set of male audio and female audio.
  4. The /user endpoint payload will be going through a breaking change due to a restructuring. It will not break on Monday’s update. We will maintain the old attributes and include the new structure. Eventually we will drop the old attributes. The change is in regards to the information we return concerning the user’s subscription status. Attributes max_level_granted_by_subscription and subscribed Will be consolidated in a nested object, thus will be dropped. Please review the API v2 doc mentioned in item 5 for the new structure.
  5. We have published API v2 docs that is current with Monday’s update. You can find it here. This will replace the documentation in this topics original post going forward.
  6. With this update we are moving from alpha to beta for API v2. We have one breaking change and following that will be adding additional HTTP methods to existing endpoints.
11 Likes

Pinging @rfindley @cplaverty @davidsansome

See the above. I am probably missing other key people…

Very nice…
I’ll have to go through and update my interactive docs

How do you plan on utilizing both at the same time on the website? Will it be a setting or can we play either whenever we want?

Congrats!

:tada: :tada: :tada:

There will be a setting to choose what you want for auto play.

In the detail views there be a list of all the audio options. We are grouping audio by “voice actor”. So you’ll see a list of pronunciation audio for the vocabulary with the “voice actor”'s name besides the audio.

2 Likes

Going through the docs, it’t interesting that you default to the first reversion of the API. Most default to the latest, and leave it to the user to elect to use older versions.

It also seems that there’s a broken link in the revisions section too.

That’s an awesome update! Thanks so much for all the hard work!

1 Like

We may reevaluate that one. I think the argument to leave default as first revision is to guarantee the default doesn’t break for the consumer. But yes, I’ve seen other APIs where they default to latest.

It’d be cool if one of the settings was “random”. That’s how Memrise handles terms with multiple recordings.

4 Likes

I’ve just noticed an issue in the docs: the “Get a Specific Study Material” section is labeled “Get a Specific Review”

1 Like

I’m still hoping for the “play all audio versions simultaneously” option.

9 Likes

Sounds like fun!

Any chance we’ll get official pitch accent data/diagrams for all the vocab? I know that’s not a core part of WaniKani, but it would go nicely with the audio I think.

1 Like

Took me 5 hours, but I finally updated my interactive docs to conform (mostly, I decided to omit the deprecated fields in the user response) to the new docs that were published. Available here.

3 Likes

API update mentioned last week is live.

A small handful of vocab is missing audio. We are dealing with a transcoding issue, but hopefully will have them uploaded by tomorrow.

2 Likes

For anyone using the Open Framework…

WKOF itself will handle this change automatically since it just saves the raw API records.
But if your script accesses the /user fields that viet mentioned, you’ll need to access them from their new location:

Before: wkof.user.max_level_granted_by_subscription
After : wkof.user.subscription.max_level_granted

Before: wkof.user.subscribed
After : wkof.user.subscription.active
1 Like