Spell Check
Check spelling and get correction suggestions. Returns a corrected version of the input text and a list of individual corrections with their positions.
Vue d'ensemble
Cas d'utilisation
- Writing assistants and text editors
- User-generated content quality checks
- Form validation and input sanitisation
- Educational platforms and grammar tools
Fonctionnalités
Points de terminaison de l'API
Check Spelling
Checks the input text for spelling mistakes and returns a corrected version along with per-word corrections.
https://requiems.xyz/v1/text/spellcheck
Paramètres
| Nom | Type | Requis | Description |
|---|---|---|---|
| text | string |
Requis | The text to spell-check. |
Essayez-le
Démo en directRequête
The text to spell-check.
Champs de réponse
| Champ | Type | Description |
|---|---|---|
| corrected | string |
The full input text with all misspelled words replaced by the top-ranked suggestion |
| corrections | array<object> |
List of individual corrections. Each item contains: original (the misspelled word), suggested (the top-ranked replacement applied to corrected), suggestions (up to 3 ranked alternatives returned by LanguageTool, from most to least likely), and position (0-based Unicode character offset in the original text) |
Exemples de code
curl -X POST https://requiems.xyz/v1/text/spellcheck \
-H "requiems-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"text": "Ths is a smiple tset"}'
import requests
url = "https://requiems.xyz/v1/text/spellcheck"
headers = {
"requiems-api-key": "YOUR_API_KEY",
"Content-Type": "application/json"
}
payload = {"text": "Ths is a smiple tset"}
response = requests.post(url, headers=headers, json=payload)
print(response.json())
const response = await fetch('https://requiems.xyz/v1/text/spellcheck', {
method: 'POST',
headers: {
'requiems-api-key': 'YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({ text: 'Ths is a smiple tset' })
});
const data = await response.json();
console.log(data.data.corrected);
console.log(data.data.corrections);
require 'net/http'
require 'json'
uri = URI('https://requiems.xyz/v1/text/spellcheck')
request = Net::HTTP::Post.new(uri)
request['requiems-api-key'] = 'YOUR_API_KEY'
request['Content-Type'] = 'application/json'
request.body = { text: 'Ths is a smiple tset' }.to_json
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|
http.request(request)
end
data = JSON.parse(response.body)
puts data['data']['corrected']
data['data']['corrections'].each { |c| puts "#{c['original']} -> #{c['suggested']}" }
Réponses d'erreur
The text field is missing or empty.
The request body is missing or malformed.
Unexpected server error.
Check Spelling (Batch)
Checks multiple texts for spelling mistakes in a single request. Returns a corrected version and per-word corrections for each input text. Results are returned in the same order as the input array.
https://requiems.xyz/v1/text/spellcheck/batch
Paramètres
| Nom | Type | Requis | Description |
|---|---|---|---|
| texts | array<string> |
Requis | The list of texts to spell-check. Between 1 and 50 items. |
Essayez-le
Démo en directRequête
The list of texts to spell-check. Between 1 and 50 items.
Champs de réponse
| Champ | Type | Description |
|---|---|---|
| results | array<object> |
One entry per input text, in the same order as the input array. Each item contains corrected (the fixed text) and corrections (list of individual corrections with original, suggested, suggestions, and position). |
| total | integer |
Number of texts processed. Equals the length of the input array. |
Exemples de code
curl -X POST https://requiems.xyz/v1/text/spellcheck/batch \
-H "requiems-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"texts": ["Ths is a tset", "Smiple example"]}'
import requests
url = "https://requiems.xyz/v1/text/spellcheck/batch"
headers = {
"requiems-api-key": "YOUR_API_KEY",
"Content-Type": "application/json"
}
payload = {"texts": ["Ths is a tset", "Smiple example"]}
response = requests.post(url, headers=headers, json=payload)
data = response.json()
for item in data["data"]["results"]:
print(item["corrected"])
const response = await fetch('https://requiems.xyz/v1/text/spellcheck/batch', {
method: 'POST',
headers: {
'requiems-api-key': 'YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({ texts: ['Ths is a tset', 'Smiple example'] })
});
const data = await response.json();
data.data.results.forEach(item => console.log(item.corrected));
require 'net/http'
require 'json'
uri = URI('https://requiems.xyz/v1/text/spellcheck/batch')
request = Net::HTTP::Post.new(uri)
request['requiems-api-key'] = 'YOUR_API_KEY'
request['Content-Type'] = 'application/json'
request.body = { texts: ['Ths is a tset', 'Smiple example'] }.to_json
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|
http.request(request)
end
data = JSON.parse(response.body)
data['data']['results'].each { |item| puts item['corrected'] }
Réponses d'erreur
The texts field is missing, empty, or exceeds 50 items.
The request body is missing or malformed.
Unexpected server error.