import requests

url = "https://dnaber-languagetool.p.rapidapi.com/v2/languages"

headers = {
	"X-RapidAPI-Key": "7798c19b40msh9672054d4a4cb3cp176d9cjsn9d6a5cf1b9bf",
	"X-RapidAPI-Host": "dnaber-languagetool.p.rapidapi.com"
}

response = requests.request("GET", url, headers=headers)

print(response.text)

print("Languages Supported")
languagelist = response.json() 


for language in languagelist:
	print(language["name"], " = ", language["code"])
[{"name":"Arabic","code":"ar","longCode":"ar"},{"name":"Asturian","code":"ast","longCode":"ast-ES"},{"name":"Belarusian","code":"be","longCode":"be-BY"},{"name":"Breton","code":"br","longCode":"br-FR"},{"name":"Catalan","code":"ca","longCode":"ca-ES"},{"name":"Catalan (Valencian)","code":"ca","longCode":"ca-ES-valencia"},{"name":"Chinese","code":"zh","longCode":"zh-CN"},{"name":"Danish","code":"da","longCode":"da-DK"},{"name":"Dutch","code":"nl","longCode":"nl"},{"name":"Dutch","code":"nl","longCode":"nl"},{"name":"Dutch (Belgium)","code":"nl","longCode":"nl-BE"},{"name":"English","code":"en","longCode":"en"},{"name":"English","code":"en","longCode":"en"},{"name":"English (Australian)","code":"en","longCode":"en-AU"},{"name":"English (Australian)","code":"en","longCode":"en-AU"},{"name":"English (Canadian)","code":"en","longCode":"en-CA"},{"name":"English (Canadian)","code":"en","longCode":"en-CA"},{"name":"English (GB)","code":"en","longCode":"en-GB"},{"name":"English (GB)","code":"en","longCode":"en-GB"},{"name":"English (New Zealand)","code":"en","longCode":"en-NZ"},{"name":"English (New Zealand)","code":"en","longCode":"en-NZ"},{"name":"English (South African)","code":"en","longCode":"en-ZA"},{"name":"English (South African)","code":"en","longCode":"en-ZA"},{"name":"English (US)","code":"en","longCode":"en-US"},{"name":"English (US)","code":"en","longCode":"en-US"},{"name":"Esperanto","code":"eo","longCode":"eo"},{"name":"French","code":"fr","longCode":"fr"},{"name":"French","code":"fr","longCode":"fr"},{"name":"Galician","code":"gl","longCode":"gl-ES"},{"name":"German","code":"de","longCode":"de"},{"name":"German","code":"de","longCode":"de"},{"name":"German (Austria)","code":"de","longCode":"de-AT"},{"name":"German (Austria)","code":"de","longCode":"de-AT"},{"name":"German (Germany)","code":"de","longCode":"de-DE"},{"name":"German (Germany)","code":"de","longCode":"de-DE"},{"name":"German (Swiss)","code":"de","longCode":"de-CH"},{"name":"German (Swiss)","code":"de","longCode":"de-CH"},{"name":"Greek","code":"el","longCode":"el-GR"},{"name":"Irish","code":"ga","longCode":"ga-IE"},{"name":"Italian","code":"it","longCode":"it"},{"name":"Japanese","code":"ja","longCode":"ja-JP"},{"name":"Khmer","code":"km","longCode":"km-KH"},{"name":"Norwegian (Bokmål)","code":"nb","longCode":"nb"},{"name":"Norwegian (Bokmål)","code":"no","longCode":"no"},{"name":"Persian","code":"fa","longCode":"fa"},{"name":"Polish","code":"pl","longCode":"pl-PL"},{"name":"Portuguese","code":"pt","longCode":"pt"},{"name":"Portuguese (Angola preAO)","code":"pt","longCode":"pt-AO"},{"name":"Portuguese (Angola preAO)","code":"pt","longCode":"pt-AO"},{"name":"Portuguese (Brazil)","code":"pt","longCode":"pt-BR"},{"name":"Portuguese (Brazil)","code":"pt","longCode":"pt-BR"},{"name":"Portuguese (Moçambique preAO)","code":"pt","longCode":"pt-MZ"},{"name":"Portuguese (Moçambique preAO)","code":"pt","longCode":"pt-MZ"},{"name":"Portuguese (Portugal)","code":"pt","longCode":"pt-PT"},{"name":"Portuguese (Portugal)","code":"pt","longCode":"pt-PT"},{"name":"Romanian","code":"ro","longCode":"ro-RO"},{"name":"Russian","code":"ru","longCode":"ru-RU"},{"name":"Simple German","code":"de-DE-x-simple-language","longCode":"de-DE-x-simple-language"},{"name":"Slovak","code":"sk","longCode":"sk-SK"},{"name":"Slovenian","code":"sl","longCode":"sl-SI"},{"name":"Spanish","code":"es","longCode":"es"},{"name":"Spanish","code":"es","longCode":"es"},{"name":"Spanish (voseo)","code":"es","longCode":"es-AR"},{"name":"Swedish","code":"sv","longCode":"sv"},{"name":"Tagalog","code":"tl","longCode":"tl-PH"},{"name":"Tamil","code":"ta","longCode":"ta-IN"},{"name":"Ukrainian","code":"uk","longCode":"uk-UA"}]
Languages Supported
Arabic  =  ar
Asturian  =  ast
Belarusian  =  be
Breton  =  br
Catalan  =  ca
Catalan (Valencian)  =  ca
Chinese  =  zh
Danish  =  da
Dutch  =  nl
Dutch  =  nl
Dutch (Belgium)  =  nl
English  =  en
English  =  en
English (Australian)  =  en
English (Australian)  =  en
English (Canadian)  =  en
English (Canadian)  =  en
English (GB)  =  en
English (GB)  =  en
English (New Zealand)  =  en
English (New Zealand)  =  en
English (South African)  =  en
English (South African)  =  en
English (US)  =  en
English (US)  =  en
Esperanto  =  eo
French  =  fr
French  =  fr
Galician  =  gl
German  =  de
German  =  de
German (Austria)  =  de
German (Austria)  =  de
German (Germany)  =  de
German (Germany)  =  de
German (Swiss)  =  de
German (Swiss)  =  de
Greek  =  el
Irish  =  ga
Italian  =  it
Japanese  =  ja
Khmer  =  km
Norwegian (Bokmål)  =  nb
Norwegian (Bokmål)  =  no
Persian  =  fa
Polish  =  pl
Portuguese  =  pt
Portuguese (Angola preAO)  =  pt
Portuguese (Angola preAO)  =  pt
Portuguese (Brazil)  =  pt
Portuguese (Brazil)  =  pt
Portuguese (Moçambique preAO)  =  pt
Portuguese (Moçambique preAO)  =  pt
Portuguese (Portugal)  =  pt
Portuguese (Portugal)  =  pt
Romanian  =  ro
Russian  =  ru
Simple German  =  de-DE-x-simple-language
Slovak  =  sk
Slovenian  =  sl
Spanish  =  es
Spanish  =  es
Spanish (voseo)  =  es
Swedish  =  sv
Tagalog  =  tl
Tamil  =  ta
Ukrainian  =  uk

This is the proccess of gramatically checking the text. It displays the errors in the text and how to fix it.

import requests
import json

url = "https://dnaber-languagetool.p.rapidapi.com/v2/check"

payload = "language=en-US&text=" #checking in English bc of use of code'en'
headers = {
	"content-type": "application/x-www-form-urlencoded",
	"X-RapidAPI-Key": "7b146afe20msh92e84c02ae27c6ap1185b5jsnb7a574f24cbe",
	"X-RapidAPI-Host": "dnaber-languagetool.p.rapidapi.com"
}

text = input("Please enter the text you would like checked")

payload += text #this appends the string defined above to add the text that needs to be checked

response = requests.request("POST", url, data=payload, headers=headers)

# print(response.text)


#print(json.dumps(response.json(), indent=4))

print(json.dumps(response.json()["matches"], indent=4)) #the json.dumps formats the data to look better
[
    {
        "message": "Possible spelling mistake found.",
        "shortMessage": "Spelling mistake",
        "replacements": [
            {
                "value": "Hello"
            },
            {
                "value": "Hellos"
            }
        ],
        "offset": 0,
        "length": 6,
        "context": {
            "text": "Helloe Im Alexa",
            "offset": 0,
            "length": 6
        },
        "sentence": "Helloe Im Alexa",
        "type": {
            "typeName": "Other"
        },
        "rule": {
            "id": "MORFOLOGIK_RULE_EN_US",
            "description": "Possible spelling mistake",
            "issueType": "misspelling",
            "category": {
                "id": "TYPOS",
                "name": "Possible Typo"
            },
            "isPremium": false
        },
        "ignoreForIncompleteSentence": false,
        "contextForSureMatch": 0
    },
    {
        "message": "Possible spelling mistake found.",
        "shortMessage": "Spelling mistake",
        "replacements": [
            {
                "value": "I'm"
            }
        ],
        "offset": 7,
        "length": 2,
        "context": {
            "text": "Helloe Im Alexa",
            "offset": 7,
            "length": 2
        },
        "sentence": "Helloe Im Alexa",
        "type": {
            "typeName": "Other"
        },
        "rule": {
            "id": "EN_CONTRACTION_SPELLING",
            "description": "Spelling of English contractions",
            "issueType": "misspelling",
            "category": {
                "id": "TYPOS",
                "name": "Possible Typo"
            },
            "isPremium": false
        },
        "ignoreForIncompleteSentence": false,
        "contextForSureMatch": 0
    }
]