There wasn't :)
I want to have a properly documented and well functioning API that people can use to search Jisho with. Since a lot of people have been asking for this I started working on something simple to get started.
I wasn't going to mention it publicly until it was more finalized, but now I think it's just better to show it off and get feedback.
So, here's the word search API: http://beta.jisho.org/api/v1/search/words?keyword=house
It's very simple, there's no documentation and I'll probably change the format and add some kind of rate limit later down the line.
See it as an alpha inside a beta :)
:O! THANK YOU!
You have NO idea how happy I am. This is perfect! I can't wait until after my paper deadline to sit down and play with this!
Thank you! I am learning Japanese. This API will help me convert a vocabulary list of verbs from the -masu form to the -ru form. It would have taken me hours by hand.
Cool, glad it'll be useful! Let me know if you run into any issues with it.
+1! This is the kind of thing worth tweeting :D!
Maybe just one idea... Could you add the Hepburn notation to the result? E.g. {"word":"食べる","reading":"たべる","hepburn":"taberu"}
@shred, good idea, I'll make a note to add romaji to the output.
Any chance that we can use the API to include search tags?
@Kimtaro?
@Nyanko I'm not sure what you mean. Can you give an example of an API search that doesn't do what you expect it to?
@Kimtaro: When I understand it correct, than you use the search API like this: http://beta.jisho.org/api/v1/search/words?keyword=house
But how do I use the API to, for example, search for all words that are tagged with #jlpt-n5? What do I need to write into the GET parameters?
@Nyanko, this will work: http://jisho.org/api/v1/search/words?keyword=%23jlpt-n5
But the tag isn't exposed in the API output yet. At some point I hope to put some extended work into making the API great, but I have to concentrate on fixing initial issues with the website first.
@Kimtaro
Thank you for your hard work :-)
Actually I'm planning to make a Chrome extension for jisho.org to better integrate it into Chrome.
I'm not in a hurry, but is there any way that I can sign up to get notified when you release the API?
@Kimtaro, is the API output limited or is it printing all JLPT N5 words? Because it doesn't seem like it with the json from your link above.
@octref that sounds great :) There's no signup to get notified when the API is more expanded. But when that happens I will post about it in the forum and make appropriate documentation pages.
@Nyanko It's working correctly, it's just not including the JLPT tags in the output at this point. There's also no indication of pagination, but you can use page=2, page=3 etc to paginate the output. This will all be included once I do proper work on the API.
This is awesome! Thank you SO much. I've been searching for an API-able Japanese dictionary forever, but there's just not that much demand for Japanese learners who want to build Anki decks with scripts or write their own learning aids. I'd actually tried to scrape straight off the html before, but I suck at parsing and the page layout was complicated so I just gave up.
This, however, is awesome. Keep up the good work.
@StarScape Yes, I could probably add that when I put some more work into the API. Might make that a separate call though. We'll see.
@Kimtaro
Can you create a repo for the API on github?
This way I and other people interested in the API could "watch" it to get notified when you make changes to it.
I don't know how you plan to write the doc yet, but I recommend writing it as a Markdown and put it on github.
@octref, a GitHub repo for the API docs is a good idea. I've created one here for now: https://github.com/Jisho-org/API-docs
@Kimtaro Thanks!
So I'm working on a script that would take advantage of Jisho's API, but I can't make requests due to a lack of Access-Control-Allow-Origin headers :(
Is this something that could be added? Really excited to make this thing and share it!
@NessDan, good point. I'll make a todo to allow cross domain requests in the API.
Is there any way to access the kanji data with the api?
@xtreme, not yet, sorry.
@NessDan I was trying to use the api in a Web app of mine as well, but has the same cross domain error. But I managed to work around it by creating a proxy that could reside on my host but called this api.
@cjx3711 My solution as well! http://blog.javascripting.com/2015/01/17/dont-hassle-with-cors/
I modified that a bit and called a proxy function during the requests that did the translating for me.
I ended up converting my script to be fully node.js and that also seemed to fix my issues :)
I tried pulling a few words from this and it seems like the example sentences aren't included in the data. Is there a way to specifically get those? I don't need ongoing access to this stuff, so I'd also be happy to download a DB dump of some sort for offline processing.
Example: http://jisho.org/api/v1/search/words?keyword=%E5%A4%A7%E7%B5%B1%E9%A0%98
http://jisho.org/search/%E5%A4%A7%E7%B5%B1%E9%A0%98%20%23sentences
Clearly it appears in many sentences, but none appear in the API JSON.
Also, the API docs repo seems to be empty. Has it moved?
@NeedleOrchard12 Sorry, I haven't added sentences to the API yet. So far the API is just a very early test and I haven't added much to it.
The API docs repo is a just a placeholder until I finish the API and write some proper documentation :)
I've written an Android Mobile App using your API, and wanted to ask if it's free to use.
The App however is not published yet.
If your API is free to use, I'll link you in the App so you receive the credit for the great great API you offer,
and I'd like to know if there are any further conditions for using it.
I hope you can figure out what I wanted to ask in my kind of broken english (sorry for that) ^
I could use the API like yesterday. I need to make a list of all "#jlpt-n5 #kanji" and "#common" to revise for the upcoming JLPT.
@felixmark just provide credit to Jisho.org for the API and make sure you adhere to the licenses of the data sources that Jisho uses, listed on http://jisho.org/about
@txtsd hope to have a more complete API next year.
I have some problems using this API..
I'm building an app which uses this API but I got this error: "Control-Allow-Origin' header is present on the requested resource"
For simple CORS requests, the server needs to add the following header to its response: " Access-Control-Allow-Origin: * "
I don't know any other way to get access to JSON data through that API
Thank you very much for the API, will be very useful =)
@pietroventurini
You are probably making a $.get ( or similiar ) request from within your browser ( maybe your index.html).
This does only work if the target ( in this case jisho.org ) has explicitly allowed a request from within the browser. As of now, it's not allowed to do that.
If you look upwards in this thread you can see a statement from Kimtaro that he planned to enable this feature, but this was some time ago so it may not be the same anymore.
The only solution for you is to make a request not from within your browser, but from your server.
If you are running your website from your file system ( the path in the browser for your application reads like 'file:://.....index.html' instead of 'localhost:...') you have to add a server side part where you can make requests.
Like the other posters here, I think it would be nice to have a browser extension/add-on for Jisho.org whether officially or 3rd party. It looks like this forum post has some good information on API and site requests regarding the sharing of Jisho.org information. I was just curious to know if there has been any update on this or maybe there is a developer blog for this that I can follow (outside of the GitHub API watch feature).
I am definitely interested in the API documentation and the "Access-Control-Allow-Origin"error issues as these seem to be the biggest roadblocks to making a browser extension/add-on without the need of a proxy server or server-side script.
Thank you for your hard work on this site so far and in the future.
The only impediment I'm facing in using the API at this time is not being able to favor if it searches in English or Japanese. Like if I search for "man" it will show results for the Japanese man but not for the English man.
Before the new version of Jisho.org, you could've created searches specific to English and Japanese in terms of GET variables:
http://jisho.org/words?jap=&eng=&dict=edict
- In this case, you would add a value to "Jap" for Japanese or "Eng" for English
Now, these types of searches change to http://jisho.org/search/. However, it seems like you can still specify if you are searching an english word by encasing it in quotes. There's a "hint message" after searching for man which indicate you can search for "man", so these search results are different:
http://jisho.org/search/man
http://jisho.org/search/"man"
I haven't tested many results but this seems to be the case.
@JBRadio no updates beyond what's in this thread I'm afraid. I don't have a developer blog. Been thinking about creating one though. I have far less time to work on Jisho than I have things I want to add :)
It's correct that using quotes is the right way to prevent Jisho from changing searches based on what it thinks you want.
@Squib01
I didn't really seem to find it on the homepage (http://jisho.org/) or the advance search options page (http://jisho.org/docs) but, there seems to be some additional search features. For example, uppercase english letters seem to indicate that you are writing in KATAKANA and lowercase letters seems to search in hiragana. A lowercase search can yield katakana results and likely vice versa but you'll notice that not all results are the same between both lower/uppercase search results.
The search comments are really helpful:
"Searched for アップル."
"Searched for あっぷる."
I'd love if it was possible to get API data from kanji entries as well. I tried keyword=瓦%20%23kanji, sadly this doesn't work I see. Will this be a feature in the future? I am very happy being able to search on just simply keywords though, but this would add a lot.
Yes, kanji data will be included in the API in a future update.
Hey what's the status on enabling CORS? e.g., adding "Access-Control-Allow-Origin:*"
Hmm nvm, it seems like the thing I needed (text reading assistance for a sentence) is not currently exposed through the api anyway.
And thinking about it more, what I really want is just a stripped down version of the jisho results that I can embed (e.g., highlight a sentence and get definitions / text reading assistance in a popup).
For example I considered using WWWJDIC's glossing in an iframe:
But it's so ugly compared to jisho's.
There's currently a bug with your 'X-Frame-Options' on chrome:
Invalid 'X-Frame-Options' header encountered when loading 'http://jisho.org/search/%E6%98%A8%E6%97%A5%E3%81%99%E3%81%8D%E7%84%BC%E3%81%8D%E3%82%92%E9%A3%9F%E3%81%B9%E3%81%BE%E3%81%97%E3%81%9F':
'ALLOW-FROM http://www.wanikani.com' is not a recognized directive. The header will be ignored.
So I did play around with just embedding the existing jisho.org in an iframe. But it's way too cluttered with the search bar / side bar. If there's a version of the page that's just the main results that would be great (and account related or other sensitive stuff stripped if you're worried about clickjacking).
I haven't considered providing a paired down version of the page for embedding. First I'd like to "finish" the API, and then maybe provide other ways of accessing the data.
Hi Kimtaro,
i noticed with the jlpt3 query above that the json file also produces words of jlpt4 and 5, should that be doing that or is there a way to only have jlpt3 words return?
also, i do not see any jlpt property name in the json file. how does it know it is what it is?
thanks a lot for all you've done so far!
Is there a specific reason why the JLPT level of a word isn't included in the tags section?
@Noam Yeah there seems to be something odd with the search index for the jlpt tags. I'll look into it.
@MCManuelLP The current API was a very quick test and not all data is included, like the JLPT tags. I'll add them in a future update.
@Kimtaro
Hey there~
I haven't been writing for sooo long - gomennasai @__@
So.. I've finally made a signed APK of the "Japanese Dictionary" App I was working on (I know I was gettin' creative by choosin' that name) :D
I stopped working on it.. but I actually use the app from time to time so I thought.. propably somebody else does too (:
I've uploaded the Project too, so if somebody likes to edit/enhance the app, you're free to do so~
So.. the homepage is http://japanese-dictionary.weebly.com/
Thank you again that the app is able to use the API you provide!
The best API I've seen so far~
Arigato gozaimasu Senpai~
Hello! I've read that there it is possible to do a jlpt search and that it would return 20 paginated items. It would be nice that it also returned the total pages that the query has. Also, when a wrong request is made (i.e: &page=1241490409432) the response is not a JSON.
Also, is there a way to contribute in the building of the API? the repo (https://github.com/Jisho-org) is empty :(
Hey! Any progress on Cross Domain Headers at all? Would be keen to integrate this with a NodeJS App I'm building at the moment :)
@Kimtaro So is web scraping okay for retrieving some of the data that isn't supplied in the API?
I'm using this API to good effect working on a Discord bot for language learning Discord groups.
But I have the same question, is it okay to scrape for extra data?
All my results link back to Jisho.
@Kimtaro Thanks a lot!
@Kimtaro Thanks a lot for the API!
Hey, @Kimtaro!
Can't find right words of gratitude for API you've provided to the community!
It's really helpful and easy to use.
One of my students found out my passion for learning Japanese language, and decided to make a chrome extension, that translates unknown words for me.
You can take a look at it:
https://chrome.google.com/webstore/detail/jhint/hmoohbgeifohgafikhihhikaknfnlgmb?hl=en
This extension has its github repository:
https://github.com/shpp/jhint
so it will be really great if somebody leaves some issues with found bugs or just propositions of enhancement.
We didn't know the right way to mention jisho.org's ownership of data in ext, so decided to provide a couple of links. But let me know if we have to do something else!
ありがとうございます!
@felixmark, @makevoid, @yorika - I'm very happy that the API is working well for you, and that you've managed to build cool stuff with it despite it being so basic :)
@Yaku - Yeah I should add better pagination information. I should also make sure that errors are JSON, not HTML :)
@dekaikiwi - No, I haven't yet, sorry. I hope to have some time over the next few weeks to take a look at adding cross domain support.
@Reline, @Mistval - Sure, scraping is fine, but I can't guarantee that the HTML won't change. I really should finish adding all data in Jisho to the API.
This is exactly what I am looking for make an iOS app!!
Thank you for your contributions.
@Kimtaro I saw something of concern within the API for the "attribution"->"dbpedia" field. Is "dbpedia" supposed to be a boolean or string value? There were two different results for "house":
家...
"attribution": {
"jmdict": true,
"jmnedict": false,
"dbpedia": false
}
家屋...
"attribution": {
"jmdict": true,
"jmnedict": false,
"dbpedia": "http://dbpedia.org/resource/House"
}
Is this a bug? Just thought I'd point it out, not a big deal.
@Reline oops! :)
It should be a string. When there is no attribution it should probably either not be present at all, or null. I'll add a todo to fix that.
@Kimtaro thanks! I guess while I'm at it I'll throw in something that would be nice to add to the API :)
Currently it's not possible to determine which furigana belong to which kanji through the api:
{
"word": "今日は",
"reading": "こんにちは"
}
That's why I asked about doing web scraping earlier, since the html gives that distinction:
こん
にち
今日は
Thanks again for the reply and all your work on this project!
@Reline The furigana alignment is something I'd like to add to the API as well :)
@Kimtaro Any updates to the repo lately? I'm attemtping to query the JLPT N5 metadata with the link above (ala http://jisho.org/api/v1/search/words?keyword=%23jlpt-n5) but it only gives me a small selection (maybe 15 words or so). Can I get your advice on how to query all the JLPT N5 words at once?
@Kimtaro Specifically, how does one do the pagination with queries? I'm trying this atm: http://jisho.org/api/v1/search/words?keyword=%22%23jlpt-n5%22?page=2 .... but I simply get back this: {"meta":{"status":200},"data":[]}
@AviDrucker You have the correct syntax for pagination, but it looks like you have some extra characters in your query. The keyword is surrounded by "", and you have ?page=2 instead of &page=2. The working query is this: http://jisho.org/api/v1/search/words?keyword=%23jlpt-n5&page=2
Hi everyone! I made a Ruby wrapper for the Jisho API, available here:
https://github.com/dysnomian/ruby_jisho
Feedback and contributions are very welcome. I hope it's useful to someone!
Great API. Thank you a lot.
I have question though about the results. When I am searching on "no" on the website I get the first result is "いいえ".
When I do the same through the API, I do not get いいえ. I cannot find the word on any page even.
See here:
API: http://jisho.org/api/v1/search/words?keyword=%22no%22
First result is 是非とも
On jisho.org website I search "no", and first result is いいえ.
Any reason this is?
@gawara try removing the quotes in your query, like so: http://jisho.org/api/v1/search/words?keyword=no
The response is still different from the website, but more accurate. You don't get "いいえ" back at all still, oddly enough.
Currently, I am trying to implement functionality to return the JLPT level for a given word. Since this isn't returned in the JSON, the only way I can get this info (using this API solely) is to query using something like http://jisho.org/api/v1/search/words?keyword=%22家%22 %23jlpt-n5 and if the exact word is returned, I know that is the JLPT level.
Is there currently any more efficient way of doing this? I know I can just use the JLPT site that jisho uses instead, but was poking around with this.
@lissm Fantastic! Jisho is made with Ruby so this makes me very happy to see :)
@gawara, @Reline There is a piece of code around quotation marks that isn't being run for API calls. Sorry about that. Once I add that for the API it should work like regular search.
@theLongestFerret Sorry, no, until I make sure it's included in the output that is the best way to check the JLPT level.
OMG, I was looking all over for an API, I was crushed when I found out tatoeba doesn't offer one, then I found yours (such a hidden gem !!!)
But I really really hope you add example sentences to it, that would be awesome.
I'm new to Android/Java (doing my own flashcard app) , so I'm not even sure how to work around this, maybe the Forum can give me a hint/nudge:
If there is no API at tatoeba, do most people simple parse the HTML ?
I wrote an Alfred workflow using the API. Thanks @Kimtaro! https://github.com/janclarin/jisho-alfred-workflow
Please let me know if you have any feedback.
http://jisho.org/api/v1/search/words?keyword=%23jlpt-n1&page=100
http://jisho.org/api/v1/search/words?keyword=%23jlpt-n1&page=101
http://jisho.org/api/v1/search/words?keyword=%23jlpt-n1&page=102
http://jisho.org/api/v1/search/words?keyword=%23jlpt-n1&page=5000
http://jisho.org/api/v1/search/words?keyword=%23jlpt-n1&page=99999
All results are same.
What happened?
@mairyu, You can download the Tatoeba data for offline processing: https://tatoeba.org/eng/downloads
I hope to add sentences to the Jisho API in the future as well.
@ruby It looks like I capped the API pagination to 100 pages, so anything above 100 is interpreted as 100 :) I'm not sure why I did that. I'll add a todo item to make this much higher.
@Kimtaro Thanks a lot!
@Kimtaro
First of all, thank you for the API!
There is a bug in the dictionary for the word "rain" — the result contains translation of the word "line":
— http://jisho.org/api/v1/search/words?keyword=rain
— http://jisho.org/search/rain
If you add quotes to this word, the result is ok on the website:
— http://jisho.org/search/"rain"
But API shows something different:
— http://jisho.org/api/v1/search/words?keyword=%22rain%22
Why the result differs?
Please, check this issue.
Thank you in advance!
Hello Kimtaro,
first of all, thank you for your efforts so far. The results are really good.
Like every other person commenting on this thread, I am in need of an API.
I could imagine that with the community a repo could be opened where every one can contribute. Especially I am in need of a C# library. More over, an offline solution would be ... significant :)
What is the current status and what are your plans? Can we support you in your efforts?
Kind regards
It should be completely fine to open up a repo yourself and start working on a C# library for the Jisho.org API. Some other guy above also wrote a Ruby wrapper.
@jakobd2
you are right. I have open a repo. When I have the time, I will write one.
If I have done so, I let the others know.
https://github.com/Insighter2k/JishoCSharpWrapper
Use it as you think it would benefit you :)
How do I use this? Do I need to put in a programme? I'm sorry for the stupid questions, I don't know what an API is or how I use it xd
@vorontsov This is because I forgot to add the logic for quote marks in the API :) It's on my todo list to fix this the next time I update the API.
@Insight Nice! :D
@Peekza An API is something programmers use to get data from Jisho. Regular users do not need to do anything with it.
Hi @Kimtaro
First, thanks for the API, helps a lot :)
Do you have any news regarding the lift of the API pagination limit? I'd like to get all words tagged as JLPT#, but there is more than 100 pages for the N1 :(
Or does anybody know a way around it? I guess I could try to get all the results by aggregating the results of smaller requests, e.g. by splitting the request into 50 requests, each including one kana.
Thanks
Probably easier to download the date sources yourself and combine them how you need them at this point in time.
@Kimtaro Hey man, I use the API for a growing Discord bot that's on around 800 servers. I'm not sure if you are aware of the API giving a bunch of objects with empty arrays when it probably shouldn't.
I'm not sure if it was a buggy information update, or you are working on updates. If you are working on updates to the API, may I suggest making a V2 to do it on so that V1 still works?
Hey @Kimtaro and thanks for all the work so far!
There are some weird things I spotted while testing the API so far in a simple node.js app where the result does not exactly return the query request (when the query is in kanji). You can find the screenshot of the log here http://imgur.com/a/ji39W.
This while the API, accessed through browser or agent like Postman returns the correct result (querying 未来 and 鉄 in browser, for example, worked as intended). Do you think I have an encoding problem?
And I'm seconding @cyberronin reply above, searching for some terms like 声 through the API automatically returns an empty array. But accessing the API through browser and Postman returns the correct result.
@leonardykris,
I think it may be an encoding problem for ya bud. I tested it in my app and it works fine. I would suggest taking a look at the urlencode
node module. I wrap the input in it when adding it to the query for the API.
http://imgur.com/a/2G0b7 Give that a look, I think it boils down to an encoding issue for you. I created that bot to work on Discord and it returns the very first definition that is provided from the response.
Has the search API changed recently? I am getting back no results on my app that is using it. If it has would it be possible to revert it back and use a new version for the changes?
Maybe it's time to add pagination to forum threads :D
@loam I just upped the API page limit to 1000, so you should be able to grab all #jlpt-n1 words now.
@cyberronin Wow, looks like a nice bot! Sorry about the weird API response date. It definitely is a bug, but I haven't changed anything around the API in quite a while so I'm a little puzzled. I will dig into the code and data and see what I can find.
@Squib02 Sounds like you're having the same issue as @cyberronin. Hopefully I can figure out what the issue is soon.
@leonardykris I agree with @cyberroning, it sounds like you might have an encoding issue. Is it possible for you to see exactly what the data is that you send to Jisho?
@cyberronin, @Squib02 I have fixed the issue with empty senses. There was a change to the underlying database JMdict, which the HTML output was guarding against but the API wasn't.
I'm on a roll with API changed tonight! Just fixed another issue where the tags property could sometimes be [null] when there were new tags in the underlying database that we didn't have descriptions for. I have changed it so that we show the tag itself instead of null if there is no description.
I managed to get one last API fix in before calling it a day. The API will now behave like the regular site for searches that use quotation marks ("") around the keyword. It turns on the "exact" mode where no romaji-kana conversion will happen.
Nice! Glad to see some changes. Thank you for the API!
Since you're on a roll :-) ...
Any chance to add the example sentences to the JSON response ?
Are they 100% taken from Tatoeba ? (do you have another site for Eng-Jap example sentences ? (I found Jukuu, which is also great)
Is there any way I can limit the search to one result? I don't need all the other results that come with searches.
nvm am dumb
also, any way to get the Kanji results via JSON i.e.
http://jisho.org/search/%E8%AA%98%20%23kanji
right now I'm using the KanjiAlive API for that, but it doesn't support too many Kanjis, which is a bummer
@mairyu Unfortunately the roll stopped :) But adding sentences and kanji to the API is definitely on the radar.
@kimtaro Please add sentences soon :D
@othinus I can't promise anything very soon. Traveling at the moment, and very full days at work during the coming weeks.
Hey guys, I've just published a Jisho API wrapper for Elixir. Thanks to the Jisho team (aka Kimtaro) for your work on it.
@kimtaro Thanks for all your work, I think adding api for kanji (and not only words) would really be great :).
@kimtaro
Sorry if this has been asked before (can't find a recent answer) but is there a limit for number of requests made? If there's a limit is there any private API key we can retrieve for an increase?
This API is awesome thanks man.
@kimtaro Also is there page/wiki/Github I can follow to keep up to date with release notes in case there's any changes to the API? Or is this forum the place to go? Thanks!
Any news on when the API will get https? A certain web resource i'm writing, hosted on Github Pages wont load things over http due to forced https..
Hi @Kimtaro,
Thank you for the work you've done thus far on the API. Today, I've had the opportunity to use the API with Google Apps Script through the UrlFetch object. While parsing the data, I noticed that there is no JLPT number associated to API results. I'm practicing for the JLPT N3 test in Dec. so I think this information would be helpful.
In the regular site search, it looks like you need to use "#kanji #jlpt-n1" to get all the N1 Kanji but what if you wanted words for N1 or N3 or something? Searching for "#jlpt-n1" will give you N5 tagged words. Is there a way to get specifically N3 words?
http://jisho.org/api/v1/search/words?keyword=%23jlpt-n1
- For the API, is there a way to tell that these are in fact only N1 words and not N5 to N1 words?
http://jisho.org/api/v1/search/words?keyword=%23jlpt-n1&page=100
- Earlier, in this thread, it was noted that you can search for words and use a page GET variable to get additional results. My question is, how do you know, through the API results, how many words were matched or how many pages there are total for the search criteria used?
Thanks!
@sabasis That’s really cool! I’ve been meaning to play with Elexir, maybe this is the thing that makes me do it :)
@Zirk kanji information in the api is on my todo list.
@nitobes There is currently no limit enforced by the api. I plan on adding api keys at some point, and then I might also do some form of rate limiting. For now the forum is the best place to check for updates, but I also want to create proper api documentation.
@jakeoid I have started work on adding https support and hope to have it done sometime this month.
@JBRadio You can use #words #jlpt-n3 to find N3 words. Some words have multiple JLPT levels in the source data so sometimes you see words listed with a different JLPT level than the one you searched for. That just means that the word has both levels.
Currently there is no pagination information returned by the api but this is something I want to add.
Hey all! I made a simple Jisho API wrapper in node with support for grabbing the audio too. You can find it here:
https://github.com/cckelly/jisho.js
https://www.npmjs.com/package/jisho.js
Let me know if you have any questions or suggestions!
@Kimtaro,
today I stumbled upon this great Jisho API! (As Jisho is my favourite dictionary anyways, this was really good news to me.)
I would like to write a userscript for my favourite Kanji learning website, so that it will indicate the JLPT level of vocab words. So... for this I need the JLPT information ;-)
Do you have any idea when you will be able to include this information in the API? Thanks in advance!
@NicoleRauch
Though it does not make use of the WebApi, I just wrote a UserScript that retrieves the JLPT level for a given word from jisho.org and shows it in an alert. This is a link to the userscript source code:
And these are some warnings:
1) The script actually GETS the page of a word search from jisho in an httprequest
2) In order to avoid CORS issues it makes use of a proxy
3) It has not been tested on a large amount of requests
4) If you use kana instead of kanji to get the JLPT of a word, it will pick up the first resulting word which might not be the desired one. For example, if you search うち it will get the JLPT level for 内 rather than 家.
In order to use the script it, you'll need to replace the value http://*.mysite.com/ next to the @match tag by the domain of the Kanji learning website you use, as well as make some changes to the code to actually make it dynamic with each word appearing in your website rather than pulling the sample 'うち'.
Just came here to bug Kimtaro about the sentence functionality for the API!
I made a neat pen for taking speech recognition and using the word search API: https://codepen.io/mynar7/pen/ZPPVOg
I thought it might be cool to expand it into a bigger app. Might be neat to watch subbed anime with a headset, parrot any words you can't understand and get definitions on the fly.
Any updates on the API? I am trying to build an app for the dictionary but with the CORS problem, I cannot upload the app without an extra proxy server. But anyone can use it if the create their own server, code is open-source:
https://github.com/myin142/jisho-dictionary
It only has a search page. Are there any other api calls that can be made?
I am facing the same issue with CORS.
Is there a way to limit the number of search results to 1 or top X?
Is there a way to get more than 10 results per page? It takes a long time to get all the results this way
Hey guys I just posted a wrapper for the api in elixir for a personal project and decided to share it. https://github.com/IlyaSamoylov45/jishocaller
Just wanted to stop by and say cool API.
I second brugz - cool API. But I also wanted to ask (again) if there are any plans to include kanji search in the api.
Unfortunately I have no update on the API. I'm still planning on adding kanji, sentences and proper CORS support. I'm currently working on the next version of the site and hope to improve the API as part of that release.
Hi I'd really love to be able to use these new features of the api.
Are you releasing the new version anytime soon?
No, I don't know when I'll be releasing the new version.
Hey everybody 👋 First of all, thanks to Kimtaro and the Jisho team for such a fantastic resource, Jisho has been so helpful over the years.
Anyways, was inspired by this thread to make a basic Ruby client gem:
https://github.com/tomholford/jisho-api
Hope this helps someone! And, looking forward to the new site and API that's coming soon :)
wow. never knew there will be someone who will provide API for people who is studying japanese.
this is cool!
BTW, I am a mobile developer (mainly on android), do you think a collaboration is cool?
would love to hear from you guys.
BTW, is the API search is for free?
Hi @Kimtaro. Thanks for making the API! I understand it's in progress, but I hope you don't mind if they're being tested out to learn programming concepts.
Thank you so much for the API @Kimtaro, I managed to make a vocabulary list maker from it :
https://github.com/idea456/tango-list
The API is great!
However, I feel like it could be improved or am I doing something wrong here?
For example, I search on Japan, but I can't get 日本 to appear.
https://jisho.org/api/v1/search/words?keyword=japan
Tried with both "Japan" and "japan" but no luck.
@sharpgamer Try this: https://jisho.org/api/v1/search/words?keyword="japan"
Or this: https://jisho.org/api/v1/search/words?keyword=%22japan%22
Stopped in to ask whether there's been development on support for the Kanji pages? Would be amazing to be able to use my own scripts to pull Kanji info quickly from the website.
Noticing a bit of an inconsistent behavior when using the API.
As was stated earlier in this thread, there is no way to return all results. Instead, we should use &page=.
So I do this and have to loop through about 27 pages, but what I am finding is that there are some entries that are repeated.
For reference I am looking for all na-adjectives that end in い.
words #adj-na *い
There are 517 today.
I am taking each of those and adding them to a python dict. When I am done the length of that dict is less than 517, but never the same twice in a row.
This is because the dictionary wont add an item that already exists.
So I printed out the items that are duplicates and find that they change each run.
I first suspected that maybe it was because the same word appeared multiple times with different meaning, but this is not the case.
Basically, the API is returning inconsistent results.
Not sure if the actual website also has this behavior where a word that appears on, let's say, page 4 will also appear on page 6.
To add a little more information, I captured some more data on when things fail. Remember that the number of items returned should be 517.
Run 1:
first word to duplicate: 簡明
page first found: 7
Item number: 134
Duplicated on page: 8
Duplicate item number: 143
Run 2:
first word to duplicate: 零細
page first found: 4
Item number: 79
Duplicated on page: 5
Duplicate item number: 81
Run 1 item: still duplicated and all stats from run 1 remain the same.
Run 3:
Same as Run 2 including Run 1 details.
Note: Run 2 produced a dict with length 430, while Run 3 a length of 446, so even though it looks like nothing changed from my data, there are other items that are getting changed.
Run 4:
first word to duplicate: 特大
page first found: 4
Item number: 79
Duplicated on page: 5
Duplicate item number: 84
Run 1 item: still duplicated, same details
Run 2 item: No longer duplicated
Dict length produced: 439
Run 5:
Same as Run 2 and 3
Run 1 item: No longer duplicated and appears as item 134 on page 7
RUN 4 item: no longer duplicated and appears as item 84 on page 5
Dict length produced: 429
As you can see, there is no real pattern for which item will be duplicated, though 零細 was the first item to be duplicated in 3/5 run.
The number of duplicates increases further down the list which at first makes sense because there are more items in the dict to collide with as you get further down. it appears as though the majority of duplicates happen exactly one page after the first item appears, but this is not true for all duplicates. some are many pages apart. I did not do a comprehensive search to verify this claim though.
Hi, Is there a way to just get all words? keyword=* does not work.
I want to use this to create a wordlist of romaji words.
Heyo!
Not sure if I just don't know this, but what does "slug" mean in the json results?
{"meta":{"status":200},"data":[{"slug":"飲む","is_common":true,
Wikipedia:
"Some systems define a slug as the part of a URL that identifies a page in human-readable keywords."
https://en.wikipedia.org/wiki/Clean_URL#Slug
@zigzaggar Interesting issue! I have a theory as to what's going on. Jisho computes a search order value for each entry in the search results. It's quite possible that the long tail of results all have the same low search order value, and at that point the database most likely return them in random order. I don't think it's something I can fix in the current version of Jisho, but I'll look into it for the next version I'm currently working on.
@ant8672 No, this is specifically guarded against. If you need to pull all data I suggest that you go directly to the source databases that Jisho uses. You can read about them on the About page. You'll probably be most interested in JMdict, the main word dictionary file.
@zorgabluff The slug is what you can use to produce a URL that goes to that specific word. In your case it would be https://jisho.org/word/飲む
Is the API able to translate romaji into English? Could someone reply with an example if it can, if not how long do you think until it will be implemented
@Cas722eey,
You can use the API to search for anything in the dictionary including romaji.
It returns JSON of items that match the search term.
Each if the matched terms will have data associated with it.
Within that data will be the definition of the term.
Example:
hoteru = hotel
One of the results of the above search will be:
https://jisho.org/word/%E3%83%9B%E3%83%86%E3%83%AB
which is the entry for ホテル (hoteru, or, hotel)
So I would say that Jisho is not a translation tool so much as it is a dictionary. It just so happens that definitions of words often contain translations if they are loan words.
If you look up: neko (cat) one of the results will be:
猫 -> ねこ -> neko -> cat
and the first definition of this word is, you guessed it, cat.
If this did not answer your question, then I am not sure what your question is.
You can always just play around with the API to see what it returns:
https://jisho.org/api/v1/search/words?keyword=neko
Hello, I made a Clojure API Wrapper for the API. It is very basic, but if anyone is interested https://clojars.org/clojisho
I am having trouble using the search terms (i.e. https://jisho.org/api/v1/search/words?keyword=%E7%8C%AB%23kanji returns an empty data array). Am I doing something wrong?
@kishima Nice!
@LiarCake The API only does word search, so there will be no results if you search for kanji.
@Kimtaro Thank you very much for giving us your extra time to build this API. It's clear there's lots of us coders around just looking for resources like this everywhere and end up here.
I'm here to ask about something discussed before, specifically the JLPT tags and how they're currently "cumulative" - if a word is both N4 and N3, it will show up in a search for N3. I noticed on some other resources (like Wiktionary/Kanshudo) they don't this and just leave it to the reader to be looking for "only" N3 if they click on N3. This approach seems more logical to me.
For example, if someone goes to the main jisho.org homepage and searches just "#jlpt-n1" actually the entire first page of results is words found in other levels. Yes, they're also N1 of course but it's kind of losing the meaning of searching for N1, no? I suppose NOT returning 月 to the query "Give me an N1 word" may seem illogical to others, but for me that would be an N5, "not" an N1.
Anyway, one idea I was working on needed to distinguish these as well, and I tried to use other sources of JLPT lists but am not finding anything nearly as easy to use as the API here (props!). So would it be possible to enable a way to search for JLPT tags such that only results with 1 tag are returned? Maybe a new tag like #jlpt-n1-only? If it's just as easy to implement, being able to exclude any tag from a search result would also be a solution (and may be appreciated, for example if someone wants to search #jlpt-n1 "not" #common for example. I don't have a suggestion on "not" syntax but I presume that may get ruled out as too difficult to implement with the backlog.
Regardless of appetite to address the above I still want to end by saying thank you again for your work on this. It is truly appreciated. By the way, other previously mentioned items affected me too, and those I would definitely vote as higher priority: total pages in result and CORS.
Cheers
Side note: I actually double checked myself and looked up https://jisho.org/word/%E6%9C%88 - it shows N3 on the left but N5 on the right. Now I realize this story is a bit more complex because JLPT level for the kanji doesn't necessarily match the JLPT level of the word. I guess that's obvious if you think about it.... hmm.
I picked up Japanese around 4 months ago, and Jisho.org is easily the best dictionary there is. Just discovered the api yesterday, and I'm really looking forward to working with it. Thanks for the great work!
I wonder could I get the Japanese example like the Jisho search web page from the api
I wonder could I get the Japanese example like the Jisho search web page from the api
Ohayo gozaimasu Kimtaro san!
It seems like the CORS issue is not yet resolve, the alternative is to create a proxy server like what @mistval
did(?), i would like to avoid using proxy server.
https://github.com/mistval/unofficial-jisho-api/issues/6
thank you in advance
@okuRaku Thank you for the kind words! Yes, the JLPT tags are a constant source of confusion, and something I plan on addressing with the next version of the site. Same with the CORS issue. As for a not-syntax, it's not (pun not (pun intended) intended) something I currently plan on adding.
@Helios467 Thanks!
@lectre I hope to add sentences to the API at some point.
@gfreecs When I take the API out of beta at some point I will address the CORS issue.
@Kimtaro Thank you for this awesome API!
For anyone running into CORS issue please feel free to use this route I built out:
https://kanji-cors-bypass.herokuapp.com/api/${kanji or english}. It's deployed on Heroku - so your first request might take a while if the application is asleep.
Hello @Kimtaro, thank you for this amazing API! It's awesome to see you still replying to people 6 years after this thread was started! Is there any chance that the API could also respond with the path to audio source files for the words that come up after a search? I noticed that it's already under the audio tag on the HTML response from the site and that there's a links section to the API response.
Ah I just noticed someone posted a wrapper to the API that grabs audio as well! Thank you @cckelly!
Here's a bump on the wrapper in case others come looking for this too :)
https://github.com/cckelly/jisho.js
@Kimtaro thank you for your reply
@levdev thank you
@dijkram wow thanks, let me try this, i am currently using @mistval api.
Hi @Kimtaro, thank for this API!
I'm building a Chrome extension to quickly lookup words: https://github.com/merwaaan/instant-jisho
Sometimes the Jisho API returns a bunch of hex characters as the slugs. What does this mean?
For instance:
https://jisho.org/api/v1/search/words?keyword=%E3%82%A2%E3%83%AA%E3%82%B9
(It seems to happen mostly with katakana words)
Thanks
@merwan
These values you are seeing are just URL encoded versions of the word you are searching for.
You can check this website: https://www.urlencoder.org/
If you type in "アリス" as in your example, this gets encoded to "%E3%82%A2%E3%83%AA%E3%82%B9". This value is how your browser reads the katakana word "アリス" (although chrome does some fancy stuff to display the katakana word itself in the address bar)
@Kimtaro
Hi, as others have said, thank you for creating this API. I had a question regarding copyright of the API (I'm not too informed on this kind of stuff).
I'm currently creating an Android app which incorporates the API. Users will be able to search using the jisho API and add the data to a personal dictionary (from which, they can then perform flashcard reviews). My question is, in this circumstance, would I be allowed to monetize my app/display banner ads (or charge for removal of ads in my app).
From what I understand, this site uses the data as explained at the bottom of each web page (JMdict, etc.). Provided I reference those, I am allowed to monetize my application, is that correct? (I will also reference use of the JishoAPI of course!).
This is my first real app, so want to be sure and get permission before going ahead with it. Thanks in advance!
Thank you for the API, I was having a hard time changing applications to open jisho tab every time I needed to do a quick search while I was working on something else.
I made use of this API to make a desktop app kinda minimal UI which only shows me the meanings and is enough for me for the moment. It has increased the speed of my workflow a lot.
Here is the github repo:
https://github.com/Atreyagaurav/jisho-chibi
I'd prefer to get the kanji search (strokes and such) as the API too, but I understand that you only develop in your free time and are planning to do it one day, so it's ok.
@dijkram The audio files belong to WaniKani, so I am not including them in the API response.
@merwan Those slugs happen when Jisho doesn't assign the word as the slug. I don't remember the logic here off the top of my head, but it's something I intend to fix.
@THICKSANDWICH I can't advise on the legality of how you use the data in your app. You will need to check that you adhere to the license of each project that you use data from. As for using the Jisho API, please be aware that I make no guarantees of functionality or that the API will keep working.
@thevoidzero Looks nice.
@Kimtaro
Hey !
Nice work, its work like a charm.
Could you up to 2000 the limit page please ? Many tags contains more than 20k items :(
Have a great day !
@FrSenpai I will not up the page limit on the current API. The sort order is not stable towards the tail end of results, so you might get the same word repeated across pages.
If you need to scrape data from Jisho I suggest that you instead look at the data sources directly. They're all listed on https://jisho.org/about
However I would like to improve the API in the future to support more pages and stable sorting.
Hey @Kimtaro, I have developed a Python API wrapper that allows getting data from jisho.org.
You can search Words, Kanji and Sentences.
For Kanji and Sentences, I am directly scraping the HTML page, is that okay?
https://github.com/pedroallenrevez/jisho-api
Thank you for your efforts!
@pedroallenrevez Wow, that looks fantastic! Yes, it's ok to scrape the HTML for now, but I can't guarantee that updates I make in the future won't break things. Hopefully by then I'll implement kanji and sentence search in the actual API.
@kimtaro Hi, thanks for the api, it works great.
A friend of mine made a python script so that it can read a list of kanji from a txt file, and extract the kanji, reading, meaning and jlpt level from your api onto another txt file.
However, it looks like from time to time, the website is kicking me out. (I get json decode errors, but if I rerun the thing it works fine. )
I'm trying to load a big list of words so I guess it's too much for it to handle. My friend told me he could introduce delays so that we don't saturate the site, how much of a delay do you think we should put so the website doesn't kick me out?
@kimtaro sorry nevermind, we fixed the code
@Kimtaro Is there any chance you could post an unfinished version of the documentation? Even a list of the possible query string parameters would be appreciated. Are the only two currently available the following:
keyword
: the word or phrase to be searched
page
: the page of words to display, each page displays up to 20 words. Default is 1, valid values are 1-1000.
If there are more, please let us know. In particular for me, if a search contains multiple words the website separates the search by those words and you can switch between them. Is there a query string parameter in the API for that?
@KanDraw Sorry, the sentence parsing isn't available in the API. There is one more query parameter, "exact". If you set exact=1 it will skip romaji to kana conversion for the search query.
Hi @kimtaro thanks again for the API!
I started having an issue with it today I was hoping to consult you about. The API began returning 403 responses with bodies like:
403 Forbidden
Request forbidden by administrative rules.
I use the "axios" node.js package for making HTTP requests, and via some experimentation I found that requests via axios (and also node-fetch) are now detected and blocked. Was that change intentional?
Thanks!
@Mistval Yes, sorry about that. Someone was scraping the site using axios and node-fetch to the point that it overloaded the servers. If you set your user-agent to something else it should work.
Got it, thanks!
By the way, let me know if you want any help implementing rate limiting. Without knowing any of the specifics my inclination would be to drop NGINX in front of it and limit requests to "/search" to 3 per second per IP.
Thanks, I use HAproxy for load balancing and have a rate limiter implemented there. But it looks like I didn't tune it well when I set it up, so it's not very effective. I'm going to adjust it to hopefully catch these scrapers, but it's tricky because Jisho gets used a lot from schools, where requests from different machines might originate from the same IP, so I can't set the limit too low.
Hi Kimtaro!
Can I use your API in my android app?
I plan to publish it in Play market and I don't know how many users/requests will be.
@Denny The API is not very good, and will at some point be replaced by something better. I would not recommend relying on it for critical functionality in a published app. It's mostly intended for hobby usage.
Hi I used:
https://jisho.org/api/v1/search/words?keyword=jlpt-n5
I noticed that I got the same results as if I'd used the #jlpt-n5 tag in the search. But I only got 20 results is it possible to get all 657 results?
@IkkiHide You can add page=2, page=3 etc to get more results. Like this: https://jisho.org/api/v1/search/words?keyword=jlpt-n5&page=2
Hello, it seems like the search API sometimes returns wrong results. Usually it returns the same set of words in the same order as the Web UI, but when I search かよう, the results include duplicates (可溶 and 佳容 twice) and have 斯様 and 家用 missing.
Is it a bug, or am I missing something?
[API]
page 1 https://jisho.org/api/v1/search/words?keyword=%E3%81%8B%E3%82%88%E3%81%86&page=1
"通う", "火曜", "歌謡", "荷葉", "下葉", "加養", "可溶", "花葉", "佳容", "可用"
page 2 https://jisho.org/api/v1/search/words?keyword=%E3%81%8B%E3%82%88%E3%81%86&page=2
"可溶", "佳容", "下葉-1", "火曜日", "歌謡曲", "可用性", "可溶性", "可鎔性", "潰瘍性病変", "可用時間"
Web https://jisho.org/search/%E3%81%8B%E3%82%88%E3%81%86
通う,火曜,歌謡,荷葉,家用,花葉,加養,斯様,可用,下葉,可溶,佳容,下葉,火曜日,歌謡曲,可用性,可溶性,可鎔性,潰瘍性病変,可用時間
@mittei After a certain number of entries shown, the order becomes undefined as the words don't have enough information to differentiate them when sorting. Although I should probably just order them in Unicode order at that point.
Hey there, I know you've been bothered about this a lot over the years, but - any plans to add sentences to this API in the near future? Also, if this API is open source on github I'd be willing to help out and try my hand at adding sentences too!
@webbben: If you just need the data used by Jisho.org for a project, in almost all cases it's probably better to use the data itself instead of the Jisho.org API. There is (almost) no exclusive data that you can only find on Jisho.org, it's all taken from public sources that are more or less freely available under different licenses.
For example sentences you can find at https://tatoeba.org/en/downloads and the data there can be used under "CC BY 2.0 FR" license, which should be fine for almost all kinds of projects.
There is currently one notable exception: The data from Jreibun project www.tufs.ac.jp/ts/personal/SUZUKI_Tomomi/jreibun/index-jreibun.html is not publically available yet. That is on purpose, as it's still a work in progress. If you want to use Jreibun project data in your own project, then you will have to wait for an official release. It will be licensed under some kind of CC license. (I hope either CC0 or CC-BY) But right now, this data is not allowed to be used freely, so even if you write a screen scraping tool to get the preliminary data available from Jisho.org for these sentences, you're not allowed to redistribute them anywhere. Therefore I also wouldn't expect these sentences to be available through any kind of API in the current state.
In general afaik Kim is working on the next bigger overhaul of Jisho.org currently, so I wouldn't expect much changes to the current website/API before that is finished.
Thanks @bay4bay, that's indeed the current state.
Hm, if I pass the sentence "私はバカです。" to jisho (the website)[0], it will break it into the words. However API does no such thing[1], it seems to just produce the results for the first word. Any idea how to duplicate this functionality? My current thinking is to query both the website (to parse the #zen_bar element) and the API (to get the data), but would prefer to not do it if possible.
Is there any information on how jisho does fill the #zen_bar so that I could do it on my own?
0: https://jisho.org/search/%E7%A7%81%E3%81%AF%E3%83%90%E3%82%AB%E3%81%A7%E3%81%99%E3%80%82
1: https://jisho.org/api/v1/search/words?keyword=%E7%A7%81%E3%81%AF%E3%83%90%E3%82%AB%E3%81%A7%E3%81%99%E3%80%82
@graywolf There is only a word search API offered. You are allowed to scrape the website. Things might break.
As @bay4bay said. But I will add that while scraping is allowed for personal use, please do not use scraping as part of an app, or to bulk download data from Jisho.
Is there any kind of search API?
Hello!
I'm thinking of writing a plugin for emacs to quickly look up words. Is there any kind of HTTP JSON API for Jisho? Should I screenscrape the results page?
Also, are there any API rate limits? Nobody uses emacs so I hope this won't be a big server load.