Bunpro API when?

Thanks for the thread guys, ive managed to use the info here for creating a status bar indicator to tell me when reviews are due for bunpro and for anki.

image

Its just for GNOME based linux users, but might be handy to a couple of people or inspire someone. Feel free to contribute if anyone is handy with code.

6 Likes

The status bar of JoshMc inspired me to create a topbar and cli tool for macos.
Just wanted to share my approach for scarping the token:

I am using the Ruby on Rails CSRF token to login to the page and get the frontend token.

Does it still work? I tried to do a few simple API requests using curl and PowerShell and I either got an HTTP response saying ‘Page not found!’ or an error ‘The request was aborted: The connection was closed unexpectedly.’.

I tried adding a few additional headers to mimic the requests made by the frontend, but no luck so far.

Edit: It seems like I had only been trying deprecated endpoints. With current ones, it works.

1 Like

if you wanna get a working bunpro api key you need to copy the “frontend_api_token” cookie value and use a reverse-engineered project on github i forgot which one but just search bunpro api and it should be there. I’ve done a bunpro RPC that way even tho it is a bit sketchy

1 Like

Yes, I was able to do a proof of concept of a browser extension to sentence mine, creating self-study sentences with the selected word and surrounding sentence. The nice thing is that from a browser extension I can directly retrieve the cookie value, instead of having to set it manually.

3 Likes

Post it when you’re done!

Seeing what people are making might hype us enough to bump the priority of the Bunpro API

3 Likes

Sure! Here’s the public GitHub repository: GitHub - apommel/bunpro-sentence-mining-extension: Browser extension (Chrome, Firefox) to create self-study sentences in Bunpro. · GitHub

I use a LLM connection (OpenAI compatible) to parse the sentence and provide the furigana and the translation. I tried to adjust the prompt but smaller models tend to mess up the required formatting for the self-study sentence. But I don’t think a very large model is required either. It works perfectly with Gemini 3.1 Flash Lite.

I did use AI assistance extensively to actually write the extension itself as I have not done that before. But I have tested it and improved quite a bit now and it works pretty well.

Feel free to use it for your own purposes :slight_smile:

2 Likes

@Linksta35 @enjuichang @Fungalorex @BakemonoNoNana @thelizard @Sully22 @anonymousturty @JoshMc @Libroru @popipo

We’ve added a new system that should make the lives of those trying to backwards-engineer our API for hobby projects/integrations a lot less painful.

DM me if you’re interested and I can share the details

9 Likes

Please tell me it’s a swagger json :rofl:

2 Likes

:eyes:

(no, it’s not)

FYI ya’ll – the Legacy API (/api/user/**) has been officially removed from the site

3 Likes

@Sean Unfortunately I also had a Stream Deck plugin that this broke. Is there an alternative API, or is it just not possible now?

I assume the alternative is getting username/password and reverse engineering the site’s normal API as you mentioned.

1 Like

I would also be interested in volunteering! This website has given me so much, so I’d love to give something in return

1 Like

I’ll DM you

Wow 2 years in the making. Thanks @Sean ! Unfortunately, I’ve had to put my Japanese learnings on hold for life reasons. I hope to one day get back into it, but until then I put my faith in the rest of these developers.

2 Likes

Why not share in the thread?
Anyway, got hit by the removal of the legacy API. Frontend API works but the token expiring is not ideal. Hoping this is related but can’t find a way to send a DM.

1 Like

I don’t currently have a project in mind that I’m thinking of making at the moment but I’m really looking forward to what people come with with a public API so I’m definitely following this closely!

1 Like

Welcome to the forums!

Why not share in the thread?

Forums are publicly indexed and would rather keep things on the DL until we have a more final solution

DM’ed you!

Hi, I don’t know how many people you can share it with. But I currently work on personal tool I created to help myself speak and listen text, and I would like to (if possible) connect some vocab automatically to bunpro. Like instead of my selecting that word in my app, copy paste, go to bunpro search and add to review, I would like to automate the flow. If there is a way to access an api for this I would like to implement for my use in my side app for now

1 Like

I’m in a similar situation; currently working on my own alternative to Anki that is tailored to how my brain works. It already syncs with Wanikani, and would be great to be able to sync it with Bunpro too, especially if I can mark words I’ve studied on my app as known in Bunpro! (I will eventually release my tool to the public too)

2 Likes