To use Unirest for Python, install it using pip:
pip install unirest
After installing the pip package, you can now begin making API requests by importing unirest and forming a request:
import unirest
apikey = "key_from_rapidapi"
text_for_detection = "Some text needed to detect its language"
response = unirest.post("https://language-identification-prediction.p.rapidapi.com/v1/recognize-language/",
headers={
"X-RapidAPI-Host": "language-identification-prediction.p.rapidapi.com",
"X-RapidAPI-Key": apikey,
"Content-Type": "application/x-www-form-urlencoded"
},
params={
"text": text_for_detection
}
)
response.body # The parsed response
# full description of response here: https://rapidapi.com/BigLobster/api/language-identification-prediction/details