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.
Descripción general
Casos de uso
- Writing assistants and text editors
- User-generated content quality checks
- Form validation and input sanitisation
- Educational platforms and grammar tools
Funcionalidades
Puntos finales de la 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
Parámetros
| Nombre | Tipo | Obligatorio | Descripción |
|---|---|---|---|
| text | string |
Obligatorio | The text to spell-check. |
Pruébalo
Demostración en vivoSolicitud
The text to spell-check.
Campos de respuesta
| Campo | Tipo | Descripción |
|---|---|---|
| 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) |
Ejemplos de código
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']}" }
Respuestas de error
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
Parámetros
| Nombre | Tipo | Obligatorio | Descripción |
|---|---|---|---|
| texts | array<string> |
Obligatorio | The list of texts to spell-check. Between 1 and 50 items. |
Pruébalo
Demostración en vivoSolicitud
The list of texts to spell-check. Between 1 and 50 items.
Campos de respuesta
| Campo | Tipo | Descripción |
|---|---|---|
| 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. |
Ejemplos de código
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'] }
Respuestas de error
The texts field is missing, empty, or exceeds 50 items.
The request body is missing or malformed.
Unexpected server error.