REST API Documentation
/api/search_kanji.php
Supported methods
- GET (args passed as query parameters)
Common arguments
-
query_type: "set", "range", "exact"
or "literal" (deprecated). Default is "set".
-
table: The name of any table in the
KANJIDIC2 database. Generally speaking, there is one
table for each XML tag type in the original
KANJIDIC2.xml database file. Default is "literal".
Ignored when using query_type "literal".
Arguments, query_type=set
-
key: The field of the table to check.
Fields generally include "data" plus any attributes
for the source XML element in question. Default is
"data".
-
value: The value, or values, to
search for. Multiple values can be specified via
syntax such as "value=a&value=b". If not specified,
the request will return a JSON null value.
-
key2: An optional parameter
specifying a field to filter on. This is primarily
intended for searching for kanji by dictionary
reference codes, where the type of reference code
(i.e. heisig) must be specified. If
specified, value2 must also be specified, else a JSON
null value will be returned.
-
value2: An optional parameter which
is required if using key2. This
specifies the value to filter upon.
Arguments, query_type=range
-
key: The field of the table to check.
Fields generally include "data" plus any attributes
for the source XML element in question. Default is
"data".
-
from: An integer representing the
lower bound of the search. If not specified, the
request will return a JSON null value.
-
to: An integer representing the
upper bound of the search. If not specified, the
request will return a JSON null value.
-
key2: An optional parameter
specifying a field to filter on. This is primarily
intended for searching for kanji by dictionary
reference codes, where the type of reference code
(i.e. heisig) must be specified. If
specified, value2 must also be specified, else a JSON
null value will be returned. See the examples
for an example of a Heisig query.
-
value2: An optional parameter which
is required if using key2. This
specifies the value to filter upon.
Arguments, query_type=exact
-
key: The field of the table to check.
Fields generally include "data" plus any attributes
for the source XML element in question. Default is
"data".
-
value: The value to search for. If
not specified, the request will return a JSON null
value.
Arguments, query_type=literal (DEPRECATED)
-
query: A UTF-8 string. The string is
broken up into individual UTF-8 characters which are
then searched for one-by-one. For toy examples this
may be convenient, but generally it's better to use
query_type=set.
Example queries