Constructor
new API()
- Source:
Methods
- Description:
- Scrape the word page for a word/phrase. This allows you to
get some information that isn't provided by the official API, such as
part-of-speech and JLPT level. However, the official API should be preferred
if it has the information you need. This function scrapes https://jisho.org/word/XXX.
In general, you'll want to include kanji in your search term, for example 掛かる
instead of かかる (no results).
- Source:
Parameters:
Name |
Type |
Description |
phrase |
string
|
The search term to search for. |
Returns:
Information about the searched query.
-
Type
-
PhrasePageScrapeResult
(async) searchForExamples(phrase) → {ExampleResults}
- Description:
- Scrape Jisho.org for examples.
- Source:
Parameters:
Name |
Type |
Description |
phrase |
string
|
The word or phrase to search for. |
Returns:
-
Type
-
ExampleResults
(async) searchForKanji(kanji) → {KanjiResult}
- Description:
- Scrape Jisho.org for information about a kanji character.
- Source:
Parameters:
Name |
Type |
Description |
kanji |
string
|
The kanji to search for. |
Returns:
Information about the searched kanji.
-
Type
-
KanjiResult
(async) searchForPhrase(phrase) → {Object}
- Description:
- Query the official Jisho API for a word or phrase. See
here
for discussion about the official API.
- Source:
Parameters:
Name |
Type |
Description |
phrase |
string
|
The search term to search for. |
Returns:
The response data from the official Jisho.org API. Its format is somewhat
complex and is not documented, so put on your trial-and-error hat.
-
Type
-
Object