This comprehensive guide will walk you through the steps of integrating the Trinka Grammar Checker API into your applications, empowering you to leverage its advanced language correction capabilities to improve the quality of your written content.
With Trinka, you can effortlessly identify and correct grammar errors, enhance sentence structure, and improve the overall readability of your text. Currently, Trinka supports three languages: English, German, and Spanish. Support for other languages will be added in future.
The Trinka API is organized around RESTFul architectural style. Our API accepts and returns JSON encoded bodies, and uses standard HTTP response codes, authentication and verbs.
All communication is over secure socket layer (SSL) protocol i.e. HTTPS. The Trinka API uses standard HTTP methods. The content-type of both request and response must be application/json. All the data must be UTF-8 encoded.
Notes: Currently, you can process a maximum of 500 words in one request.
POST
,https://trinka-grammar-checker.p.rapidapi.com/v2/para-check/{langCode}
langCode
can be en
, es
, or de
. For English use en
, for Spanish, use es
, for German, use de
.X-RapidAPI-Host
: trinka-grammar-checker.p.rapidapi.com
X-RapidAPI-Key
: your-api-key
paragraph
: <paragraph to be corrected>language
: US
or UK
(to select the dialect when correcting English paragraphs, default is US
). For languages other than English, this parameter will have no effect.curl --location 'https://trinka-grammar-checker.p.rapidapi.com/v2/para-check/en' \
--header 'X-RapidAPI-Host: trinka-grammar-checker.p.rapidapi.com' \
--header 'X-RapidAPI-Key: your-rapidapi-key' \
--data '{
"paragraph": "Once upon a time in a remote village in India, nestled deep within the lush forests of Kerala, there lived a young boy named Rajan. Rajan was an inquisitive and adventurous child, known for his insatiable curiosity and his love for exploring the dense jungles that surrounded his village. One bright morning, as the sun painted the sky with hues of orange and pink, Rajan decided to venture deeper into the forest than he had ever gone before. His heart pounded with excitement as he followed a narrow, winding trail that led him through a thick canopy of ancient trees.",
"language": "US"
}'
curl --location 'https://trinka-grammar-checker.p.rapidapi.com/v2/para-check/en' \
--header 'X-RapidAPI-Host: trinka-grammar-checker.p.rapidapi.com' \
--header 'X-RapidAPI-Key: your-rapidapi-key' \
--data '{
"paragraph": "Once upon a time in a remote village in India, nestled deep within the lush forests of Kerala, there lived a young boy named Rajan. Rajan was an inquisitive and adventurous child, known for his insatiable curiosity and his love for exploring the dense jungles that surrounded his village. One bright morning, as the sun painted the sky with hues of orange and pink, Rajan decided to venture deeper into the forest than he had ever gone before. His heart pounded with excitement as he followed a narrow, winding trail that led him through a thick canopy of ancient trees.",
"language": "UK"
}'
curl --location 'https://trinka-grammar-checker.p.rapidapi.com/v2/para-check/es' \
--header 'X-RapidAPI-Host: trinka-grammar-checker.p.rapidapi.com' \
--header 'X-RapidAPI-Key: your-rapidapi-key' \
--data '{
"paragraph": "Ayer yo ir a la tienda y comprar muchos manzanas. Mi amigos gusta las manzanas también, así que yo compartir con ellos. Nosotros comer las manzanas y reír mucho. Después, nosotros jugamos juegos y tener diversión. Fue un día muy bueno."
}'
curl --location 'https://trinka-grammar-checker.p.rapidapi.com/v2/para-check/de' \
--header 'X-RapidAPI-Host: trinka-grammar-checker.p.rapidapi.com' \
--header 'X-RapidAPI-Key: your-rapidapi-key' \
--data '{
"paragraph": "Rajan hrt oller Ehrfurcht zu und klammerte sich an jedes Wort."
}'
200 OK
Status Code and a JSON response which is an array of sentences, along with their indexes and errors/suggestions:[
{
"begin": begin index of sentence in the paragraph,
"end": end index of sentence in the paragraph,
"sentence": sentence text,
"result": [
{
"start_index": start index within the sentence,
"end_index": end index within the sentence,
"covered_text": text in the source sentence that needs to be replaced,
"output": [ replacement text ],
"comment": [ correction comment ],
"cta_present": [ boolean value indicating whether the change suggested is to be automatically applied (if true) or just raised as a comment (if false) ],
"error_category": [ grammar error category for the change suggested ]
}
]
}
]
Response Code | Note |
---|---|
200 - OK | Everything working as expected |
400 - Bad Request | The request was unacceptable, often due to missing a required parameter or file format not acceptable |
401 - Unauthorized | No valid API key provided |
403 - Forbidden | The API key doesn't have permission to perform the request |
404 - Not Found | The request resourse doesn't exist |
413 - Payload Too Large | The paragraph word count is greater than 500 words |
500 - Server Error | Trinka server issue |
For any queries feel free to connect with us at support@trinka.ai.