import requests

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

headers = {
	"X-RapidAPI-Key": "068e8e71ccmsh9b3b0cf234e3d0dp15d891jsn4e9a94382eba",
	"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"])
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
import requests
import json


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

payload = "language=en-US&text=This%20is%20a%20error."
headers = {
	"content-type": "application/x-www-form-urlencoded",
	"X-RapidAPI-Key": "068e8e71ccmsh9b3b0cf234e3d0dp15d891jsn4e9a94382eba",
	"X-RapidAPI-Host": "dnaber-languagetool.p.rapidapi.com"
}

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

payload += text

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))
[
    {
        "message": "Use \u201can\u201d instead of \u2018a\u2019 if the following word starts with a vowel sound, e.g.\u00a0\u2018an article\u2019, \u2018an hour\u2019.",
        "shortMessage": "Wrong article",
        "replacements": [
            {
                "value": "an"
            }
        ],
        "offset": 8,
        "length": 1,
        "context": {
            "text": "This is a error.hello 67uh8i",
            "offset": 8,
            "length": 1
        },
        "sentence": "This is a error.hello 67uh8i",
        "type": {
            "typeName": "Other"
        },
        "rule": {
            "id": "EN_A_VS_AN",
            "description": "Use of 'a' vs. 'an'",
            "issueType": "misspelling",
            "urls": [
                {
                    "value": "https://languagetool.org/insights/post/indefinite-articles/"
                }
            ],
            "category": {
                "id": "MISC",
                "name": "Miscellaneous"
            },
            "isPremium": false
        },
        "ignoreForIncompleteSentence": false,
        "contextForSureMatch": 1
    },
    {
        "message": "If a new sentence starts here, add a space and start with an uppercase letter.",
        "shortMessage": "Capitalization",
        "replacements": [
            {
                "value": " Hello"
            },
            {
                "value": " hello"
            }
        ],
        "offset": 16,
        "length": 5,
        "context": {
            "text": "This is a error.hello 67uh8i",
            "offset": 16,
            "length": 5
        },
        "sentence": "This is a error.hello 67uh8i",
        "type": {
            "typeName": "Other"
        },
        "rule": {
            "id": "LC_AFTER_PERIOD",
            "subId": "1",
            "sourceFile": "grammar.xml",
            "description": "Lowercase word after word and no space in between",
            "issueType": "uncategorized",
            "category": {
                "id": "CASING",
                "name": "Upper/Lowercase"
            },
            "isPremium": false
        },
        "ignoreForIncompleteSentence": false,
        "contextForSureMatch": 3
    }
]