漢リポ Kanseki Repository

研究者から研究者への電子テキスト

ニュース

  • [2016-03-10]
    First public release of the website.
  • [2015-10-22]
    New website available, more than 9000 texts online.
  • [2015-05-06]
    Started move to github. Some Daoist texts are up for testing purposes.
  • [2014-09-27]
    First pretest release of the Kanseki Repository.

About the Kanseki Repository API

The Kanseki Repository can be accessed programmatically to retrieve information for further processing, a socalled API interface.

The API is accessed at https://www.kanripo.org/api/v1.0/.

API Endpoints

Currently, the following endpoints exist:

  • search
    Invoked as https://www.kanripo.org/api/v1.0/search?query=[searchterm]. The result will be a list of matches. Without any additional parameter, all matches will be returned in the format found in the index. The formatting and amount of information returned can be controlled by further parameters.
    If "Accept:application/json" is sent in the header, the result will be returned in JSON format, otherwise in plain text.

    parameter status comment example
    query required The term to be searched. The returned results are raw; use one of the following parameters to control the format. search?query=時間
    with-titles optional This will cause the results to include the titles in a tab-separated text format, this also implies 'kwic-ready' search?query=時間&with-titles
    kwic-ready optional This will cause the keyword in context format in the results to be formated to be directly usable. search?query=時間&kwic-ready
    all-editions optional By default matches to editions other than the one from the master branch are removed from the results if they differ only in characters other than the matched characters. This parameter causes results from all editions to be included. search?query=時間&with-titles&all-editions
    count optional (integer) Number of items to transmit. search?query=時間&count=20
    start optional (integer) Start position of items to transmit. search?query=時間&start=20
    force optional The presence of this parameter will bypass the cache and force a re-run of the query on the server. search?query=時間&force
  • titles
    Invoked as https://www.kanripo.org/api/v1.0/titles?query=[searchterm]. The result will be a list of matches.
    If "Accept:application/json" is sent in the header, the result will be returned in JSON format, otherwise in plain text.

    parameter status comment example
    query required The term to be searched within the list of titles. Parts of the text identifier can also be used, for example "KR6q" to retrieve all texts in the category KR6q. titles?query=春秋
    count optional (integer) Number of items to transmit. titles?query=春秋&count=20
    start optional (integer) Start position of items to transmit. The first item has the position 0. titles?query=春秋&start=0&count=40