API documentation

The API is quite simple, so this should have everything covered.
It can be queried via

and will respond with JSON.

Encode

Query https://phonetics.provinzkraut.de/api/encode and it returns a JSON object with results. The results are arrays, containing the string that was encoded and the actual encoding result.

Multiple strings can be concatenated using +.

JSON structure

{"result":
  [
    ["foo", "1234"]
  ]
}

Example

> curl https://phonetics.provinzkraut.de/api/compare?data=foo
{"result": [["foo", "3"]]}
> curl https://phonetics.provinzkraut.de/api/encode?data=foo+bar
{"result": [["foo", "3"], ["bar", "17"]]}

Compare

Query https://phonetics.provinzkraut.de/api/compare and it returns a JSON object containing the result. The result is either true, false or ValueError.

If the request is malformed, i.e. was not comparable, it will result in a 400 Bad Request.
The result value will be ValueError.

JSON structure

{"result": "true"}
{"result": "false"}
{"result": "ValueError"}

Example

> curl https://phonetics.provinzkraut.de/api/compare?data=foo+bar
{"result": false}

> curl https://phonetics.provinzkraut.de/api/compare?data=foo+foo
{"result": true}

> curl -i https://phonetics.provinzkraut.de/api/compare?data=foo
HTTP/1.0 400 Bad Request
Date: Wed, 18 Apr 2018 12:39:49 GMT
Server: WSGIServer/0.2 CPython/3.6.3
Content-Type: application/json
Content-Length: 24

{"result": "ValueError"}