REST and GraphQL API’s
There are three levels of API servers:
- Production API server
- URL: https://api-giellalt.uit.no/
- uptime monitoring
- load balancing between multiple virtual machines
- tested and verified services and language quality
- updated infrequently
- target audience: language communities, regular users, production use
- beta/staging API server
- URL: https://beta.api.giellalt.org/
- NO uptime monitoring
- NO load balancing, just one server instance
- language quality is usually good, but
- updated semi-frequently
- target audience: early adopters, testers
- development API server
- URL: https://dev.api.giellalt.org/
- NO uptime monitoring
- NO load balancing, just one server instance
- language quality is not guaranteed in any way
- updated on every successful CI build, including changes that may break core linguistic functionality
- target audience: developers
General information
The API’s can be accessed both using REST and GraphQL, more info behind the links at the bottom.
To get an overview over available services, just click one of the links above, they all behave the same.
More services will be added over time.
Documentation
API documentation is available directly at api-giellalt.uit.no. More info about the usage of existing services can be found at https://divvun.github.io/divvun-api/redoc-static.html and https://divvun.github.io/divvun-api/.
Some examples
Get list of services and languages
Command:
curl -s -X GET 'https://api-giellalt.uit.no/languages' | jq
Output:
{
"available": {
"grammar": {
"fkv": "Kven Finnish",
"fo": "føroyskt",
"kl": "kalaallisut",
"nb": "norsk bokmål",
"se": "davvisámegiella",
"sma": "åarjelsaemien gïele",
"smj": "julevsámegiella",
"smn": "anarâškielâ",
"sms": "nuõrttsääʹmǩiõll"
},
"hyphenation": {
"se": "davvisámegiella"
},
"speller": {
"fkv": "Kven Finnish",
"fo": "føroyskt",
"kl": "kalaallisut",
"nb": "norsk bokmål",
"se": "davvisámegiella",
"sma": "åarjelsaemien gïele",
"smj": "julevsámegiella",
"smn": "anarâškielâ",
"sms": "nuõrttsääʹmǩiõll"
}
}
}
Similar for the other API servers.
Grammar
Command:
curl -s -X POST -H 'Content-Type: application/json' \
'https://api-giellalt.uit.no/grammar/se' \
--data '{"text": "mun hálat davvvisámegiela"}' | jq
Output:
{
"text": "mun hálat davvvisámegiela",
"errs": [
{
"error_text": "hálat",
"start_index": 4,
"end_index": 9,
"error_code": "syn-number_congruence-subj-verb",
"description": "Kongrueansa subjeavtta ja vearbba gaskkas",
"suggestions": [
"hálan"
],
"title": "Boasttuhápmi"
},
{
"error_text": "davvvisámegiela",
"start_index": 10,
"end_index": 25,
"error_code": "typo",
"description": "Ii leat sátnelisttus",
"suggestions": [
"davvisámegiela",
"davvisámegiella",
"davvesámegiela",
"davvisámegeali",
"davvisámegeale",
"davvisámegealo",
"davvisámegielu",
"davvisámegealu"
],
"title": "Čállinmeattáhus"
}
]
}
Speller
Command:
curl -s -X POST -H 'Content-Type: application/json' \
'https://api-giellalt.uit.no/speller/se' \
--data '{"text": "mun hálan davvvisámegiela"}' | jq
Output:
{
"text": "mun hálan davvvisámegiela",
"results": [
{
"word": "mun",
"is_correct": true,
"suggestions": [
{
"value": "mun",
"weight": 9.547852
},
{
"value": "mon",
"weight": 9.609375
},
...
]
},
{
"word": "hálan",
"is_correct": true,
"suggestions": [
{
"value": "hálan",
"weight": 13.608398
},
{
"value": "hállan",
"weight": 21.047852
},
...
]
},
{
"word": "davvvisámegiela",
"is_correct": false,
"suggestions": [
{
"value": "davvisámegiela",
"weight": 30.3018
},
{
"value": "davvisámegiella",
"weight": 38.3018
},
...
]
}
]
}
Speech synthesis / TTS
curl -s -X POST -H 'Content-Type: application/json' \
--data '{"text": "– Lea dehálaš ahte Stuorradiggi oažžu eanadoallošiehtadusa mollii."}' \
'https://api-giellalt.uit.no/tts/se/sunna' > test.wav
API web access
All end points can be opened in a web browser for easy testing. As the list of languages and services will expand over time, the list of links below may not be complete. Run the language query to get an updated list of languages and services.
NB! Note that these web pages are only intended for testing by developers, not for real usage. They are completely bare-bones, and not meant for actual use.
These are links directly to some pages:
Grammar
- Faroese/føroyskt
- Irish/gaeilge
- Greenlandic//kalaallisut
- Norwegian bokmål
- North Sámi/Davvisámigiella
- South Sámi/Åarjelsaemien gïele
- Lule Sámi/Julevsámegiella
- Inari Sámi/Anarâškielâ
- Skolt Sámi/Nuõrttsääʹmǩiõll
Speller
- North Sámi/Davvisámigiella
- South Sámi/Åarjelsaemien gïele
- Lule Sámi/Julevsámegiella
- Inari Sámi/Anarâškielâ
- Skolt Sámi/Nuõrttsääʹmǩiõll