Vocabulary dictionary

Kanji dictionary

Grammar dictionary

Sentence lookup

test
 

Forums - Interested in working with a renshuu API?

Top > renshuu.org > Developer corner



avatar
マイコー
Level: 264

Over the last year, I have been to build an internal API for our discord bot, @kaochan.

If you are a developer and would like to develop something that works with an upcoming, public API, please let me know! This is an informal thread for interest about the API as well as questions/discussions.

What the API will *not* contain

I am not planning to add any of the quizzing functionality to the API now or in the future. Most of the API functionality will be accessing the dictionary data (along with example sentences, usage notes, mnemonics, etc.), user data, as well as simple ways to interact with your study materials.

Current examples of discord commands on our @kaochan bot

1. Dictionary lookup (vocab, kanji, grammar, sentences)

2. Word conjugator

3. Random kao-chan comic

4. User profile

5. Showing off your garden

6. Way to add terms from the bot directly into one of your lists or schedules.

6
1 month ago
Report Content
avatar
ライフェン
Level: 328

Would be nice to have API endpoints for personal (word/any) lists.
Currently I use ocr to read manga and mkv piping for extracting subtitles and after each session I dump all words into renshuu text analyzer and spread between lists.

Would be nice to be able to add these words via API, so instead of dumping them into text analyzer at the end of the session, I have them in payload as post request or add each word during my session.

All in all what I mentioned above is the same api call anyway.

1
1 month ago
Report Content
avatar
Gibolt
Level: 306

I was going to say something similar. I have .srt subtitle files for movies + shows, and song lyrics that would be great to be able to upload more easily. Not sure I would actually use an API to upload them, but the option would be nice.

The Text analyzer could also just use some attention, since it and the Reading Buddy feel more like unpolished prototypes.

1
1 month ago
Report Content
avatar
マイコー
Level: 264

I was going to say something similar. I have .srt subtitle files for movies + shows, and song lyrics that would be great to be able to upload more easily. Not sure I would actually use an API to upload them, but the option would be nice.

The Text analyzer could also just use some attention, since it and the Reading Buddy feel more like unpolished prototypes.

You're free to comment on them in other threads, but they get a good amount of usage by a subset of users, and aside from a few QoL issues with the menus on top of the Reading Buddy, I do not have any core functionality that I feel is missing.

0
1 month ago
Report Content
avatar
イクト
Level: 910

First of all great to see you moving forward with the idea of providing an api.

I guess you already know what I'd want to use it for, but it probably makes sense to mention it here too.


I'm using the yomichan/yomitan popup dictionary browser plugin. I would find it very useful to be able to add words, I look up with it, directly to a renshuu list.

It already has a function to create anki cards from looked up words by calling an API that anki provides.

To make it work with renshuu as a backend instead of anki I think there would be 3 ways to do it
* create a program to run locally to convert api calls from yomichan to the renshuu api format
* offer an api on the renshuu server in the format the yomichan plugin expects, so it can connect directly to it
* add functionality to the browser plugin, so it uses the renshuu api and either fork it or talk to the developers of they would accept to integrate that change.


(There's also the 10ten reader browser plugin which is similar. It currently doesn't have a feature to export looked up words, but the developer seems to be working at this function. But there isn't much information when it will be available and how configurable it will be. https://github.com/birchill/10... )

3
1 month ago
Report Content
avatar
Level: 43

This is very exciting! I'd love to be able to query current schedules that are due/need reviewing, as well as list the day's challenges. This would make setting up integrations with other tools (i.e. Zapier, an Android widget, or other automation tools) easier and help make it even easier to get notified that it's time to study!

1
1 month ago
Report Content
avatar
Fwiffo
Level: 366

Simillar to Ikuto, my main interest is to be able to integrate other sources of learning with Renshuu. For me and my friends this usually involves using Yomitan extension to help with reading. Currently, if we want to add words to Renshuu while doing that, it involves a lot of actions that force a significant slow down and disruption, and we can't use Yomitan for assistance with it.

Given the plugin's very wide spread, I think it is very worthwhile to add some support for the extension or at least let us write proper plugins for it.

1
7 days ago
Report Content
avatar

I would be interested in a plugin that was able to add private sentences from other websites, especially if there was a way to attach audio.

1
7 days ago
Report Content
avatar
マイコー
Level: 264

Simillar to Ikuto, my main interest is to be able to integrate other sources of learning with Renshuu. For me and my friends this usually involves using Yomitan extension to help with reading. Currently, if we want to add words to Renshuu while doing that, it involves a lot of actions that force a significant slow down and disruption, and we can't use Yomitan for assistance with it.

Given the plugin's very wide spread, I think it is very worthwhile to add some support for the extension or at least let us write proper plugins for it.

I was under the impression that Yomitan itself made it somewhat difficult to interface with renshuu - ikuto was able to write some code, but it also required a little server to be running somewhere in between yomitan and renshuu's api.

0
4 days ago
Report Content
avatar
Fwiffo
Level: 366
I was under the impression that Yomitan itself made it somewhat difficult to interface with renshuu - ikuto was able to write some code, but it also required a little server to be running somewhere in between yomitan and renshuu's api.

That is somewhat true, because Yomitan itself expects to have an ankiconnect api as a backend. However, that API exists and is (somewhat) known, whereas Renshuu calls had to be hacked together. The script works for the simplest scenarios, but the moment you deviate from those there's nothing to be done because Renshuu doesn't have support for certain things.

Easy example: readings that are considered alternative or "rare" by Renshuu itself - I assume they require a different call to add so Ikuto's script doesn't work for those. It was still a LOT better than nothing, but there's certainly room for improvement.

I considered writing my own backend as well in order to practice Go a little but so far haven't had the time, and if we're getting an API I'd prefer to use that directly rather than employ hacky ways with curl.

1
3 days ago
Report Content
avatar
イクト
Level: 910

I was under the impression that Yomitan itself made it somewhat difficult to interface with renshuu - ikuto was able to write some code, but it also required a little server to be running somewhere in between yomitan and renshuu's api.

The middle layer seemed like the path of least resistance to me as I have no experience with writing browser addons and it's probably hard to use an self built addon on a mobile browser.

It would probably be possible to add support for an Renshuu API. Convincing the maintainers to integrate that change or maintaining a fork of the addon (let's call it kaotan ) might be the largest part of the work.




Easy example: readings that are considered alternative or "rare" by Renshuu itself - I assume they require a different call to add so Ikuto's script doesn't work for those.

The data is there, the script just doesn't extract it. What the script receives is formatted exactly like the entries in the popup dictionary (there's an optional line of text "(Rarely written as: ...)" at the end of each entry)

1
3 days ago
Report Content
avatar
マイコー
Level: 264

Don't forget - if you need specific api endpoints for what you'd like to do, please list them out as clearly as possible :)

1
3 days ago
Report Content
avatar
Level: 43

Don't forget - if you need specific api endpoints for what you'd like to do, please list them out as clearly as possible :)

Specifically I'd be interested in:

- GET stats: Access to the stats associated with the current user would be useful. Default to all time. Example:

GET /v1/stats/?window

{
    "user": "abc",
    "total_xp": 123,
    "level": 123,
    "statistics": [
        {
            "type": "grammar",
            "terms": 123,
            "questions": 123,
            "correct": 123,
            "new_terms": 123,
            "window": "today"
        },
        ...
    ],
}

- GET streak: I'm sure this data is recorded somewhere since the 30d streak applies a debuff on the xp gain. Could probably bundle the xp and level in here too, but just an example. Example:

GET /v1/streak
{
    "user": "abc",
    "streak": 123
}

- GET upcoming schedules/schedules due: Simply return a list of the currently subscribed schedules along with the relevant stats. Example:

GET /v1/schedules
{
    "user": "abc",
    "schedules": [
        {
            "name": "Genki 1 Words",
            "review": 123,
            "learn": 123
        },
        ...
    ]
}

- GET challenges: Similar to above, but for the days challenges. Example:

GET /v1/challenges
{
    "user": "abc",
    "time_left": 123, (think time until reset)
    "challenges": [
        {
            "name": "Answer 1 question in the question corner",
            "link": http... (ie this link takes you to the question corner),
            "percentage_complete": 123,
        },
        ...
    ]
}
        

- POST shiritori answer: Pretty self explanatory, needs a corresponding GET to get the id of the game you want to post to, but takes some kind of JSON body to post an answer to a Shiritori round and responds with whether you succeeded or not.


Edit: I see that the full history isn't stored in DB (makes sense), but an additional field on a user that tracks the # of days studied consecutively that updates once a day shouldn't be too onerous on the DB (I hope). At the end of the month can just set the field to be equal to the curr_val + this months streak, if the streak gets broken in Renshuu then that value gets reset. So theoretically could reduce number of DB work by just using the existing 30d window + an int stored on the profile that gets updated at the start of a month with the latest streak of the past month, then every call to the streak endpoint just adds that int with the current months streak?

1
17 hours ago
Report Content
Getting the posts




Top > renshuu.org > Developer corner


Loading the list
Lv.

Sorry, there was an error on renshuu! If it's OK, please describe what you were doing. This will help us fix the issue.

Characters to show:





Use your mouse or finger to write characters in the box.
■ Katakana ■ Hiragana