{"id":17775615,"url":"https://github.com/h7x4/unofficial_jisho_api_dart","last_synced_at":"2026-01-11T13:37:27.401Z","repository":{"id":56841604,"uuid":"245880835","full_name":"h7x4/unofficial_jisho_api_dart","owner":"h7x4","description":"An unofficial api for searching and scraping the japanese dictionary Jisho.org","archived":false,"fork":false,"pushed_at":"2023-03-10T07:01:28.000Z","size":160,"stargazers_count":13,"open_issues_count":0,"forks_count":7,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-27T03:54:15.229Z","etag":null,"topics":["api","dictionary","japanese","japanese-language","jisho"],"latest_commit_sha":null,"homepage":"https://pub.dev/packages/unofficial_jisho_api","language":"Dart","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/h7x4.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-03-08T20:12:42.000Z","updated_at":"2024-01-16T10:43:40.000Z","dependencies_parsed_at":"2024-10-26T22:04:34.233Z","dependency_job_id":"64f8fbe1-77cc-4562-8ef6-e95c4b9edbd6","html_url":"https://github.com/h7x4/unofficial_jisho_api_dart","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/h7x4%2Funofficial_jisho_api_dart","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/h7x4%2Funofficial_jisho_api_dart/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/h7x4%2Funofficial_jisho_api_dart/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/h7x4%2Funofficial_jisho_api_dart/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/h7x4","download_url":"https://codeload.github.com/h7x4/unofficial_jisho_api_dart/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243760345,"owners_count":20343626,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","dictionary","japanese","japanese-language","jisho"],"created_at":"2024-10-26T21:58:03.268Z","updated_at":"2026-01-11T13:37:27.395Z","avatar_url":"https://github.com/h7x4.png","language":"Dart","funding_links":[],"categories":[],"sub_categories":[],"readme":"# unofficial_jisho_api\n ![pub version](https://img.shields.io/pub/v/unofficial_jisho_api)\n ![pub likes](https://badges.bar/unofficial_jisho_api/likes)\n ![pub points](https://badges.bar/unofficial_jisho_api/pub%20points)\n ![pub popularity](https://badges.bar/unofficial_jisho_api/popularity)\n\nA rewrite of the [unofficial-jisho-api](https://www.npmjs.com/package/unofficial-jisho-api)\n\n\n## Usage\n\nBelow are some basic examples.\n\n### Word/phrase search (provided by official Jisho API)\n\nThis returns the same results as the official [Jisho.org](https://jisho.org/) API. See the discussion of that [here](https://jisho.org/forum/54fefc1f6e73340b1f160000-is-there-any-kind-of-search-api).\n\n```dart\nimport 'package:unofficial_jisho_api/api.dart' as jisho;\n\nvoid main() async {\n  jisho.searchForPhrase('日').then((result) {\n    ...\n    ...\n    ...\n  });\n}\n```\n\n### Kanji search\n\n```dart\nimport 'dart:convert' show jsonEncode;\nimport 'package:unofficial_jisho_api/api.dart' as jisho;\n\nvoid main() async {\n  await jisho.searchForKanji('語').then((result) {\n    print('Found: ${result.found}');\n\n    final data = result.data;\n    if (data != null) {\n      print('Kanji: ${data.kanji}');\n      print('Taught in: ${data.taughtIn}');\n      print('JLPT level: ${data.jlptLevel}');\n      print('Newspaper frequency rank: ${data.newspaperFrequencyRank}');\n      print('Stroke count: ${data.strokeCount}');\n      print('Meaning: ${data.meaning}');\n      print('Kunyomi: ${jsonEncode(data.kunyomi)}');\n      print('Kunyomi example: ${jsonEncode(data.kunyomiExamples[0])}');\n      print('Onyomi: ${jsonEncode(data.onyomi)}');\n      print('Onyomi example: ${jsonEncode(data.onyomiExamples[0])}');\n      print('Radical: ${jsonEncode(data.radical)}');\n      print('Parts: ${jsonEncode(data.parts)}');\n      print('Stroke order diagram: ${data.strokeOrderDiagramUri}');\n      print('Stroke order SVG: ${data.strokeOrderSvgUri}');\n      print('Stroke order GIF: ${data.strokeOrderGifUri}');\n      print('Jisho Uri: ${data.uri}');\n    }\n  });\n}\n```\n\nThis outputs the following:\n\n```\nFound: true\nKanji: 語\nTaught in: grade 2\nJLPT level: N5\nNewspaper frequency rank: 301\nStroke count: 14\nMeaning: word, speech, language\nKunyomi: [\"かた.る\",\"かた.らう\"]\nKunyomi example: {\"example\":\"語る\",\"reading\":\"かたる\",\"meaning\":\"to talk about, to speak of, to tell, to narrate, to recite, to chant, to indicate, to show\"}\nOnyomi: [\"ゴ\"]\nOnyomi example: {\"example\":\"語\",\"reading\":\"ゴ\",\"meaning\":\"language, word\"}\nRadical: {\"symbol\":\"言\",\"forms\":[\"訁\"],\"meaning\":\"speech\"}\nParts: [\"五\",\"口\",\"言\"]\nStroke order diagram: https://classic.jisho.org/static/images/stroke_diagrams/35486_frames.png\nStroke order SVG: https://d1w6u4xc3l95km.cloudfront.net/kanji-2015-03/08a9e.svg\nStroke order GIF: https://raw.githubusercontent.com/mistval/kanji_images/master/gifs/8a9e.gif\nJisho Uri: https://jisho.org/search/%E8%AA%9E%23kanji\n```\n\n### Example search\n\n```dart\nimport 'dart:convert' show jsonEncode;\nimport 'package:unofficial_jisho_api/api.dart' as jisho;\n\nvoid main() async {\n  await jisho.searchForExamples('日').then((result) {\n    print('Jisho Uri: ${result.uri}');\n    print('');\n\n    for (var i = 0; i \u003c 3; i++) {\n      var example = result.results[i];\n      print(example.kanji);\n      print(example.kana);\n      print(example.english);\n      print(jsonEncode(example.pieces));\n      print('');\n    }\n  });\n}\n```\n\nThis outputs the following:\n\n```\nJisho Uri: https://jisho.org/search/%E6%97%A5%23sentences\n\n日本人ならそんなことはけっしてしないでしょう。\nにほんじんならそんなことはけっしてしないでしょう。\nA Japanese person would never do such a thing.\n[{\"lifted\":\"にほんじん\",\"unlifted\":\"日本人\"},{\"lifted\":null,\"unlifted\":\"なら\"},{\"lifted\":null,\"unlifted\":\"そんな\"},{\"lifted\":null,\"unlifted\":\"こと\"},{\"lifted\":null,\"unlifted\":\"は\"},{\"lifted\":null,\"unlifted\":\"けっして\"},{\"lifted\":null,\"unlifted\":\"しない\"},{\"lifted\":null,\"unlifted\":\"でしょう\"}]\n\n今日はとても暑い。\nきょうはとてもあつい。\nIt is very hot today.\n[{\"lifted\":\"きょう\",\"unlifted\":\"今日\"},{\"lifted\":null,\"unlifted\":\"は\"},{\"lifted\":null,\"unlifted\":\"とても\"},{\"lifted\":\"あつ\",\"unlifted\":\"暑い\"}]\n\n日本には美しい都市が多い。例えば京都、奈良だ。\nにほんにはうつくしいとしがおおい。たとえばきょうと、奈良だ。\nJapan is full of beautiful cities. Kyoto and Nara, for instance.\n[{\"lifted\":\"にほん\",\"unlifted\":\"日本\"},{\"lifted\":null,\"unlifted\":\"には\"},{\"lifted\":\"うつく\",\"unlifted\":\"美しい\"},{\"lifted\":\"とし\",\"unlifted\":\"都市\"},{\"lifted\":null,\"unlifted\":\"が\"},{\"lifted\":\"おお\",\"unlifted\":\"多い\"},{\"lifted\":\"たと\",\"unlifted\":\"例えば\"},{\"lifted\":\"きょうと\",\"unlifted\":\"京都\"},{\"lifted\":null,\"unlifted\":\"だ\"}]\n\n```\n\n### Word/phrase scraping\n\nThis scrapes the word/phrase page on Jisho.org. This can get you some data that the official API doesn't have, such as JLPT level and part-of-speech. The official API (`searchForPhrase`) should be preferred if it has the data you need.\n\n```dart\nimport 'dart:convert';\nimport 'package:unofficial_jisho_api/api.dart' as jisho;\nfinal JsonEncoder encoder = JsonEncoder.withIndent('  ');\n\nvoid main() async {\n  await jisho.scrapeForPhrase('谷').then((data) {\n    print(encoder.convert(data));\n  });\n}\n```\n\nThis outputs the following:\n\n```json\n{\n  \"found\": true,\n  \"query\": \"谷\",\n  \"data\": {\n    \"uri\": \"https://jisho.org/word/%E8%B0%B7\",\n    \"tags\": [\n      \"Common word\",\n      \"JLPT N3\",\n      \"Wanikani level 5\"\n    ],\n    \"meanings\": [\n      {\n        \"seeAlsoTerms\": [],\n        \"sentences\": [],\n        \"definition\": \"valley\",\n        \"supplemental\": [],\n        \"definitionAbstract\": null,\n        \"tags\": []\n      },\n      {\n        \"seeAlsoTerms\": [],\n        \"sentences\": [],\n        \"definition\": \"Valley\",\n        \"supplemental\": [],\n        \"definitionAbstract\": \"In geology, a valley or dale is a depression with predominant extent in one direction. A very deep river valley may be called a canyon or gorge. The terms U-shaped and V-shaped are descriptive terms of geography to characterize the form of valleys. Most valleys belong to one of these two main types or a mixture of them, (at least) with respect of the cross section of the slopes or hillsides.\",\n        \"tags\": []\n      }\n    ],\n    \"otherForms\": [\n      {\n        \"kanji\": \"渓\",\n        \"kana\": \"たに\"\n      },\n      {\n        \"kanji\": \"谿\",\n        \"kana\": \"たに\"\n      }\n    ],\n    \"audio\": [\n      {\n        \"uri\": \"https://d1vjc5dkcd3yh2.cloudfront.net/audio/b9ff4f25c7a20f0f39131b3e3db0cd19.mp3\",\n        \"mimetype\": \"audio/mpeg\"\n      },\n      {\n        \"uri\": \"https://d1vjc5dkcd3yh2.cloudfront.net/audio_ogg/b9ff4f25c7a20f0f39131b3e3db0cd19.ogg\",\n        \"mimetype\": \"audio/ogg\"\n      }\n    ],\n    \"notes\": []\n  }\n}\n```\n\n## Parsing HTML strings\n\nYou can provide the HTML responses from Jisho yourself. This can be useful if you need to use a CORS proxy or something. You can do whatever you need to do to get the HTML and then provide it to this module's parsing functions. For example:\n\n### Parse kanji page HTML\n\n```dart\nimport 'dart:convert';\nimport 'package:http/http.dart' as http;\nimport 'package:unofficial_jisho_api/parser.dart' as jisho_parser;\n\nfinal JsonEncoder encoder = JsonEncoder.withIndent('  ');\n\nconst String searchKanji = '車';\nfinal String searchURI = jisho_parser.uriForKanjiSearch(searchKanji);\n\nvoid main() async {\n  await http.get(searchURI).then((result) {\n    final parsedResult = jisho_parser.parseKanjiPageData(result.body, searchKanji);\n    final data = parsedResult.data;\n    if (data != null) {\n      print('JLPT level: ${data.jlptLevel}');\n      print('Stroke count: ${data.strokeCount}');\n      print('Meaning: ${data.meaning}');\n    }\n  });\n}\n```\n\n### Parse example page HTML\n\n```dart\nimport 'dart:convert';\nimport 'package:http/http.dart' as http;\nimport 'package:unofficial_jisho_api/parser.dart' as jisho_parser;\n\nfinal JsonEncoder encoder = JsonEncoder.withIndent('  ');\n\nconst String searchExample = '保護者';\nfinal String searchURI = jisho_parser.uriForExampleSearch(searchExample);\n\nvoid main() async {\n  await http.get(searchURI).then((result) {\n    final parsedResult = jisho_parser.parseExamplePageData(result.body, searchExample);\n    print('English: ${parsedResult.results[0].english}');\n    print('Kanji ${parsedResult.results[0].kanji}');\n    print('Kana: ${parsedResult.results[0].kana}');\n  });\n}\n```\n\n### Parse phrase page HTML\n\n```dart\nimport 'dart:convert';\nimport 'package:http/http.dart' as http;\nimport 'package:unofficial_jisho_api/parser.dart' as jisho_parser;\n\nfinal JsonEncoder encoder = JsonEncoder.withIndent('  ');\n\nconst String searchExample = '保護者';\nfinal String searchURI = jisho_parser.uriForPhraseScrape(searchExample);\n\nvoid main() async {\n\n  await http.get(searchURI).then((result) {\n    final parsedResult = jisho_parser.parsePhrasePageData(result.body, searchExample);\n    print(encoder.convert(parsedResult));\n  });\n}\n```\n\n## Note on usage with web\n\nAlthough the library is marked as ok for use with website outputs, you will not be able to reach through the CORS setup of jisho.org. You should set up a backend as a proxy if you want to make a website. See (#3)\n\n## About\n\nPermission to scrape granted by Jisho's admin Kimtaro: https://jisho.org/forum/54fefc1f6e73340b1f160000-is-there-any-kind-of-search-api\n\n## Notes\n\nThe null-safety of dart 2.12 makes the parsing and interpreting of the native search API a little unreliable. Please be cautious when using `jisho.searchForPhrase()`, and if you do, please read the [API docs][api-docs] about the different result values.\n\n[api-docs]: https://pub.dev/documentation/unofficial_jisho_api/latest/","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fh7x4%2Funofficial_jisho_api_dart","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fh7x4%2Funofficial_jisho_api_dart","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fh7x4%2Funofficial_jisho_api_dart/lists"}