Archive
Spell Check
Check and correct spelling errors in a text.
POST
/
v1
/
validate
/
spell_check
import { JigsawStack } from "jigsawstack";
const jigsaw = JigsawStack({ apiKey: "your-api-key" });
const response = await jigsaw.validate.spellcheck({
"text": "This sentense has a speling mistake."
})
from jigsawstack import JigsawStack
jigsaw = JigsawStack(api_key="your-api-key")
response = jigsaw.validate.spellcheck({
"text": "This sentense has a speling mistake."
})
curl https://api.jigsawstack.com/v1/validate/spell_check \
-X POST \
-H 'Content-Type: application/json' \
-H 'x-api-key: your-api-key' \
-d '{"text":"This sentense has a speling mistake."}'
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://api.jigsawstack.com/v1/validate/spell_check');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Content-Type: application/json',
'x-api-key: your-api-key',
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"text":"This sentense has a speling mistake."}');
$response = curl_exec($ch);
curl_close($ch);
require 'net/http'
require 'json'
uri = URI('https://api.jigsawstack.com/v1/validate/spell_check')
req = Net::HTTP::Post.new(uri)
req.content_type = 'application/json'
req['x-api-key'] = 'your-api-key'
req.body = {
'text' => 'This sentense has a speling mistake.'
}.to_json
req_options = {
use_ssl: uri.scheme == 'https'
}
res = Net::HTTP.start(uri.hostname, uri.port, req_options) do |http|
http.request(req)
end
package main
import (
"fmt"
"io"
"log"
"net/http"
"strings"
)
func main() {
client := &http.Client{}
var data = strings.NewReader(`{"text":"This sentense has a speling mistake."}`)
req, err := http.NewRequest("POST", "https://api.jigsawstack.com/v1/validate/spell_check", data)
if err != nil {
log.Fatal(err)
}
req.Header.Set("Content-Type", "application/json")
req.Header.Set("x-api-key", "your-api-key")
resp, err := client.Do(req)
if err != nil {
log.Fatal(err)
}
defer resp.Body.Close()
bodyText, err := io.ReadAll(resp.Body)
if err != nil {
log.Fatal(err)
}
fmt.Printf("%s\n", bodyText)
}
import java.io.IOException;
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpRequest.BodyPublishers;
import java.net.http.HttpResponse;
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.jigsawstack.com/v1/validate/spell_check"))
.POST(BodyPublishers.ofString("{\"text\":\"This sentense has a speling mistake.\"}"))
.setHeader("Content-Type", "application/json")
.setHeader("x-api-key", "your-api-key")
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
import Foundation
let jsonData = [
"text": "This sentense has a speling mistake."
] as [String : Any]
let data = try! JSONSerialization.data(withJSONObject: jsonData, options: [])
let url = URL(string: "https://api.jigsawstack.com/v1/validate/spell_check")!
let headers = [
"Content-Type": "application/json",
"x-api-key": "your-api-key"
]
var request = URLRequest(url: url)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = data as Data
let task = URLSession.shared.dataTask(with: request) { (data, response, error) in
if let error = error {
print(error)
} else if let data = data {
let str = String(data: data, encoding: .utf8)
print(str ?? "")
}
}
task.resume()
import 'package:http/http.dart' as http;
void main() async {
final headers = {
'Content-Type': 'application/json',
'x-api-key': 'your-api-key',
};
final data = '{"text":"This sentense has a speling mistake."}';
final url = Uri.parse('https://api.jigsawstack.com/v1/validate/spell_check');
final res = await http.post(url, headers: headers, body: data);
final status = res.statusCode;
if (status != 200) throw Exception('http.post error: statusCode= $status');
print(res.body);
}
import java.io.IOException
import okhttp3.MediaType.Companion.toMediaType
import okhttp3.OkHttpClient
import okhttp3.Request
import okhttp3.RequestBody.Companion.toRequestBody
val client = OkHttpClient()
val MEDIA_TYPE = "application/json".toMediaType()
val requestBody = "{\"text\":\"This sentense has a speling mistake.\"}"
val request = Request.Builder()
.url("https://api.jigsawstack.com/v1/validate/spell_check")
.post(requestBody.toRequestBody(MEDIA_TYPE))
.header("Content-Type", "application/json")
.header("x-api-key", "your-api-key")
.build()
client.newCall(request).execute().use { response ->
if (!response.isSuccessful) throw IOException("Unexpected code $response")
response.body!!.string()
}
using System.Net.Http.Headers;
using System.Net.Http.Json;
HttpClient client = new HttpClient();
HttpRequestMessage request = new HttpRequestMessage(HttpMethod.Post, "https://api.jigsawstack.com/v1/validate/spell_check");
request.Headers.Add("x-api-key", "your-api-key");
request.Content = JsonContent.Create(new
{
text = "This sentense has a speling mistake."
});
request.Content.Headers.ContentType = new MediaTypeHeaderValue("application/json");
HttpResponseMessage response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
string responseBody = await response.Content.ReadAsStringAsync();
Console.WriteLine(responseBody);
{
"success": true,
"misspellings_found": true,
"misspellings": [
{
"word": "sentense",
"startIndex": 5,
"endIndex": 13,
"expected": [
"sentence"
],
"auto_corrected": true
},
{
"word": "speling",
"startIndex": 20,
"endIndex": 27,
"expected": [
"spelling",
"spewing",
"spieling"
],
"auto_corrected": true
}
],
"auto_correct_text": "This sentence has a spelling mistake.",
"_usage": {
"input_tokens": 13,
"output_tokens": 83,
"inference_time_tokens": 1095,
"total_tokens": 1191
}
}
Params
The text to check.
The language code of the target language to translate to. All supported
language codes can be found
here.
Header
Your JigsawStack API key
Response
Indicates whether the call was successful.
A unique identifier for the request
Whether any misspellings were found in the text.
Array of misspelling objects found in the text.
Show Misspelling Object Properties
Show Misspelling Object Properties
The misspelled word found in the text.
The starting index position of the misspelled word in the text.
The ending index position of the misspelled word in the text.
Array of suggested correct spellings for the misspelled word.
Whether the word was automatically corrected.
The auto corrected text.If no misspellings were found, the original text is returned.
import { JigsawStack } from "jigsawstack";
const jigsaw = JigsawStack({ apiKey: "your-api-key" });
const response = await jigsaw.validate.spellcheck({
"text": "This sentense has a speling mistake."
})
from jigsawstack import JigsawStack
jigsaw = JigsawStack(api_key="your-api-key")
response = jigsaw.validate.spellcheck({
"text": "This sentense has a speling mistake."
})
curl https://api.jigsawstack.com/v1/validate/spell_check \
-X POST \
-H 'Content-Type: application/json' \
-H 'x-api-key: your-api-key' \
-d '{"text":"This sentense has a speling mistake."}'
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://api.jigsawstack.com/v1/validate/spell_check');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Content-Type: application/json',
'x-api-key: your-api-key',
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"text":"This sentense has a speling mistake."}');
$response = curl_exec($ch);
curl_close($ch);
require 'net/http'
require 'json'
uri = URI('https://api.jigsawstack.com/v1/validate/spell_check')
req = Net::HTTP::Post.new(uri)
req.content_type = 'application/json'
req['x-api-key'] = 'your-api-key'
req.body = {
'text' => 'This sentense has a speling mistake.'
}.to_json
req_options = {
use_ssl: uri.scheme == 'https'
}
res = Net::HTTP.start(uri.hostname, uri.port, req_options) do |http|
http.request(req)
end
package main
import (
"fmt"
"io"
"log"
"net/http"
"strings"
)
func main() {
client := &http.Client{}
var data = strings.NewReader(`{"text":"This sentense has a speling mistake."}`)
req, err := http.NewRequest("POST", "https://api.jigsawstack.com/v1/validate/spell_check", data)
if err != nil {
log.Fatal(err)
}
req.Header.Set("Content-Type", "application/json")
req.Header.Set("x-api-key", "your-api-key")
resp, err := client.Do(req)
if err != nil {
log.Fatal(err)
}
defer resp.Body.Close()
bodyText, err := io.ReadAll(resp.Body)
if err != nil {
log.Fatal(err)
}
fmt.Printf("%s\n", bodyText)
}
import java.io.IOException;
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpRequest.BodyPublishers;
import java.net.http.HttpResponse;
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.jigsawstack.com/v1/validate/spell_check"))
.POST(BodyPublishers.ofString("{\"text\":\"This sentense has a speling mistake.\"}"))
.setHeader("Content-Type", "application/json")
.setHeader("x-api-key", "your-api-key")
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
import Foundation
let jsonData = [
"text": "This sentense has a speling mistake."
] as [String : Any]
let data = try! JSONSerialization.data(withJSONObject: jsonData, options: [])
let url = URL(string: "https://api.jigsawstack.com/v1/validate/spell_check")!
let headers = [
"Content-Type": "application/json",
"x-api-key": "your-api-key"
]
var request = URLRequest(url: url)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = data as Data
let task = URLSession.shared.dataTask(with: request) { (data, response, error) in
if let error = error {
print(error)
} else if let data = data {
let str = String(data: data, encoding: .utf8)
print(str ?? "")
}
}
task.resume()
import 'package:http/http.dart' as http;
void main() async {
final headers = {
'Content-Type': 'application/json',
'x-api-key': 'your-api-key',
};
final data = '{"text":"This sentense has a speling mistake."}';
final url = Uri.parse('https://api.jigsawstack.com/v1/validate/spell_check');
final res = await http.post(url, headers: headers, body: data);
final status = res.statusCode;
if (status != 200) throw Exception('http.post error: statusCode= $status');
print(res.body);
}
import java.io.IOException
import okhttp3.MediaType.Companion.toMediaType
import okhttp3.OkHttpClient
import okhttp3.Request
import okhttp3.RequestBody.Companion.toRequestBody
val client = OkHttpClient()
val MEDIA_TYPE = "application/json".toMediaType()
val requestBody = "{\"text\":\"This sentense has a speling mistake.\"}"
val request = Request.Builder()
.url("https://api.jigsawstack.com/v1/validate/spell_check")
.post(requestBody.toRequestBody(MEDIA_TYPE))
.header("Content-Type", "application/json")
.header("x-api-key", "your-api-key")
.build()
client.newCall(request).execute().use { response ->
if (!response.isSuccessful) throw IOException("Unexpected code $response")
response.body!!.string()
}
using System.Net.Http.Headers;
using System.Net.Http.Json;
HttpClient client = new HttpClient();
HttpRequestMessage request = new HttpRequestMessage(HttpMethod.Post, "https://api.jigsawstack.com/v1/validate/spell_check");
request.Headers.Add("x-api-key", "your-api-key");
request.Content = JsonContent.Create(new
{
text = "This sentense has a speling mistake."
});
request.Content.Headers.ContentType = new MediaTypeHeaderValue("application/json");
HttpResponseMessage response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
string responseBody = await response.Content.ReadAsStringAsync();
Console.WriteLine(responseBody);
{
"success": true,
"misspellings_found": true,
"misspellings": [
{
"word": "sentense",
"startIndex": 5,
"endIndex": 13,
"expected": [
"sentence"
],
"auto_corrected": true
},
{
"word": "speling",
"startIndex": 20,
"endIndex": 27,
"expected": [
"spelling",
"spewing",
"spieling"
],
"auto_corrected": true
}
],
"auto_correct_text": "This sentence has a spelling mistake.",
"_usage": {
"input_tokens": 13,
"output_tokens": 83,
"inference_time_tokens": 1095,
"total_tokens": 1191
}
}
Was this page helpful?
⌘I
import { JigsawStack } from "jigsawstack";
const jigsaw = JigsawStack({ apiKey: "your-api-key" });
const response = await jigsaw.validate.spellcheck({
"text": "This sentense has a speling mistake."
})
from jigsawstack import JigsawStack
jigsaw = JigsawStack(api_key="your-api-key")
response = jigsaw.validate.spellcheck({
"text": "This sentense has a speling mistake."
})
curl https://api.jigsawstack.com/v1/validate/spell_check \
-X POST \
-H 'Content-Type: application/json' \
-H 'x-api-key: your-api-key' \
-d '{"text":"This sentense has a speling mistake."}'
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://api.jigsawstack.com/v1/validate/spell_check');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Content-Type: application/json',
'x-api-key: your-api-key',
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"text":"This sentense has a speling mistake."}');
$response = curl_exec($ch);
curl_close($ch);
require 'net/http'
require 'json'
uri = URI('https://api.jigsawstack.com/v1/validate/spell_check')
req = Net::HTTP::Post.new(uri)
req.content_type = 'application/json'
req['x-api-key'] = 'your-api-key'
req.body = {
'text' => 'This sentense has a speling mistake.'
}.to_json
req_options = {
use_ssl: uri.scheme == 'https'
}
res = Net::HTTP.start(uri.hostname, uri.port, req_options) do |http|
http.request(req)
end
package main
import (
"fmt"
"io"
"log"
"net/http"
"strings"
)
func main() {
client := &http.Client{}
var data = strings.NewReader(`{"text":"This sentense has a speling mistake."}`)
req, err := http.NewRequest("POST", "https://api.jigsawstack.com/v1/validate/spell_check", data)
if err != nil {
log.Fatal(err)
}
req.Header.Set("Content-Type", "application/json")
req.Header.Set("x-api-key", "your-api-key")
resp, err := client.Do(req)
if err != nil {
log.Fatal(err)
}
defer resp.Body.Close()
bodyText, err := io.ReadAll(resp.Body)
if err != nil {
log.Fatal(err)
}
fmt.Printf("%s\n", bodyText)
}
import java.io.IOException;
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpRequest.BodyPublishers;
import java.net.http.HttpResponse;
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.jigsawstack.com/v1/validate/spell_check"))
.POST(BodyPublishers.ofString("{\"text\":\"This sentense has a speling mistake.\"}"))
.setHeader("Content-Type", "application/json")
.setHeader("x-api-key", "your-api-key")
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
import Foundation
let jsonData = [
"text": "This sentense has a speling mistake."
] as [String : Any]
let data = try! JSONSerialization.data(withJSONObject: jsonData, options: [])
let url = URL(string: "https://api.jigsawstack.com/v1/validate/spell_check")!
let headers = [
"Content-Type": "application/json",
"x-api-key": "your-api-key"
]
var request = URLRequest(url: url)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = data as Data
let task = URLSession.shared.dataTask(with: request) { (data, response, error) in
if let error = error {
print(error)
} else if let data = data {
let str = String(data: data, encoding: .utf8)
print(str ?? "")
}
}
task.resume()
import 'package:http/http.dart' as http;
void main() async {
final headers = {
'Content-Type': 'application/json',
'x-api-key': 'your-api-key',
};
final data = '{"text":"This sentense has a speling mistake."}';
final url = Uri.parse('https://api.jigsawstack.com/v1/validate/spell_check');
final res = await http.post(url, headers: headers, body: data);
final status = res.statusCode;
if (status != 200) throw Exception('http.post error: statusCode= $status');
print(res.body);
}
import java.io.IOException
import okhttp3.MediaType.Companion.toMediaType
import okhttp3.OkHttpClient
import okhttp3.Request
import okhttp3.RequestBody.Companion.toRequestBody
val client = OkHttpClient()
val MEDIA_TYPE = "application/json".toMediaType()
val requestBody = "{\"text\":\"This sentense has a speling mistake.\"}"
val request = Request.Builder()
.url("https://api.jigsawstack.com/v1/validate/spell_check")
.post(requestBody.toRequestBody(MEDIA_TYPE))
.header("Content-Type", "application/json")
.header("x-api-key", "your-api-key")
.build()
client.newCall(request).execute().use { response ->
if (!response.isSuccessful) throw IOException("Unexpected code $response")
response.body!!.string()
}
using System.Net.Http.Headers;
using System.Net.Http.Json;
HttpClient client = new HttpClient();
HttpRequestMessage request = new HttpRequestMessage(HttpMethod.Post, "https://api.jigsawstack.com/v1/validate/spell_check");
request.Headers.Add("x-api-key", "your-api-key");
request.Content = JsonContent.Create(new
{
text = "This sentense has a speling mistake."
});
request.Content.Headers.ContentType = new MediaTypeHeaderValue("application/json");
HttpResponseMessage response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
string responseBody = await response.Content.ReadAsStringAsync();
Console.WriteLine(responseBody);
{
"success": true,
"misspellings_found": true,
"misspellings": [
{
"word": "sentense",
"startIndex": 5,
"endIndex": 13,
"expected": [
"sentence"
],
"auto_corrected": true
},
{
"word": "speling",
"startIndex": 20,
"endIndex": 27,
"expected": [
"spelling",
"spewing",
"spieling"
],
"auto_corrected": true
}
],
"auto_correct_text": "This sentence has a spelling mistake.",
"_usage": {
"input_tokens": 13,
"output_tokens": 83,
"inference_time_tokens": 1095,
"total_tokens": 1191
}
}