Menu

accentuate.us API

Kevin Scannell

Web API

Accentuate.us is a web service for automatic diacritic restoration created by Kevin Scannell and Michael Schade in 2010. The original version supported 116 languages, but hosting that many languages proved to be prohibitively expensive (especially when compared with the number of active daily users), and so we shut down the API in 2014. Since most of our original user base were speakers of one of the Gaelic languages, we've decided to revive the web service for Irish, Scottish, and Manx Gaelic.

To use the API, simply make a HTTP POST request to the URL https://cadhan.com/api/accentuate/1.0 with two parameters:

  • text: The text to be accentuated, as URL-encoded UTF-8
  • lang: The ISO 639-1 code for the language of the text; currently must be "ga", "gd", or "gv".

The parameters should be sent in the body of the request (not as part of the URL), and the request should specify Content-Type: application/x-www-form-urlencoded.

The response will be a JSON hash with two keys:

  • text: the accentuated text
  • code: the HTTP response code (200 upon success, or one of the error codes listed below)

For example, if the value of the lang parameter in the request is "ga", and the value of the text parameter is the following string (containing one embedded newline):

Ni me an ar Ait an Phuint no
na gCuig Deag ata me curtha?

You should get a response resembling the following:

{"text":"Ní mé an ar Áit an Phuint nó\nna gCúig Déag atá mé curtha?","code":"200"}

Details

  • The web service supports CORS requests.
  • The original service stored the language models in memory on the server, and was fast enough to support "live" accentuation. This is no longer the case, and there is some latency caused by loading the models on each call to the API.

HTTP Response Codes

  • 200 (OK): Successful request
  • 400 (Bad Request): Missing parameter in request, unsupported language for error messages, empty source text, source text not encoded as UTF-8, etc.
  • 403 (Forbidden): Request from unapproved IP address
  • 405 (Method Not Allowed): Only POST requests permitted
  • 413 (Payload Too Large): Request larger than 16k bytes
  • 500 (Internal Server Error): Translation server failed to process request

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.