MasKIT API Reference

MasKIT REST API web service is available on http(s)://quest.ms.mff.cuni.cz/maskit/api/.

The service is freely available for testing under these terms of use. Explicit written permission of the authors of MasKIT and the external services called (UDPipe and NameTag) is required for any commercial exploitation of the system.

Anonymity

To maintain anonymity at the REST API server, neither MasKIT, nor the external services UDPipe and NameTag, log the processed texts.
The only information that may be logged is: time of usage, size of the processed data, the system configuration and the IP address from where it is accessed.

If you wish to maintain anonymity when using the service via REST API, make sure to use the POST method, as REST API URLs may also be logged.

All comments and reactions are welcome.

API Reference

The MasKIT REST API can be accessed directly or via web programming tools that support standard HTTP request methods and JSON for output handling.

Service Request Description HTTP Method
process process the text and replace personal information GET/POST
info get the server version and a list of supported features GET/POST

Method process

Process the given data as described in the User's Manual.

Parameter Mandatory Data type Description
text yes string Input text in UTF-8.
input no string Input format; possible values: txt (default), presegmented, see input format for details.
output no string Output format; possible values: txt (default), html, see output format for details.
randomize no N/A If present, the replacements are selected in random order.
classes no N/A If present, classes (instead of fake names) are used as replacements.

Parameters randomize and classes are mutually exlusive.

The response is in JSON format of the following structure:

{
 "message": "overview_message"
 "result": "processed_output"
 "stats": "statistics"
}

The overview_message is a short comprehensible message of what has been called;
the processed_output is the output of MasKIT in the requested output format;
and statistics is an HTML overview giving the MasKIT version, the size of the text and the processing time.

Method info

Returns the info about the server - the MasKIT version and a list of supported features. The method does not have parameters.

The response is in JSON format of the following structure:

{
 "version": "MasKIT_version"
 "features": "supported_features"
}

The MasKIT_version is the version of the server consisting of the version number and the creation date; in case of an anonymized server (without text logging), these are followed by the string "(no text logging)",
and supported_features is a list of types of personal information that the server anonymizes, separated by '•'.

Browser Example

http://quest.ms.mff.cuni.cz/maskit/api/process?input=txt&output=txt&text=Paní Marie Nováková z Myslíkovy ulice č. 25 dostala dopis od firmy Škoda.

Accessing API using Curl

The described API can be comfortably used by curl. Several examples follow:

Passing Input on Command Line (if UTF-8 locale is being used)

curl --data 'input=txt&output=txt&text=Paní Marie Nováková z Myslíkovy ulice č. 25 dostala dopis od firmy Škoda.' http://quest.ms.mff.cuni.cz/maskit/api/process

Using Files as Input (files must be in UTF-8 encoding)

curl --data-urlencode 'input=txt' --data-urlencode 'output=html' --data-urlencode 'text@input_file.txt' http://quest.ms.mff.cuni.cz/maskit/api/process

Converting JSON Result to Plain Text

curl --data 'input=txt&output=txt&text=Paní Marie Nováková z Myslíkovy ulice č. 25 dostala dopis od firmy Škoda.' http://quest.ms.mff.cuni.cz/maskit/api/process | PYTHONIOENCODING=utf-8 python -c "import sys,json; sys.stdout.write(json.load(sys.stdin)['result'])"