Languages
List all supported languages.
Request
GEThttps://api.fliki.ai/v1/languages
Headers
{
"Content-type": "application/json",
"Authorization": "Bearer API_KEY"
}
Key | Value | Description |
---|---|---|
Content-Type | application/json | Specifies that the request body format is JSON, allowing the server to parse the data correctly. |
Authorization | Bearer YOUR_API_KEY | Generate your API Key in the account/api. section and replace YOUR_API_KEY with your actual key. |
Response
[
{
"_id": String,
"name": String,
"slug": String,
},
]
Key | Type | Description |
---|---|---|
_id | string | Unique identifier for each language. |
name | string | Name of the language (e.g., “English”, “Spanish”). |
slug | string | Shortened, URL-friendly version of the language name (e.g., “en”, “es”). |
Example
- Bash
- TypeScript
- Python
- Go
cURL Request
curl \
-H "Authorization: Bearer <API_KEY>" \
-H "Content-Type: application/json" \
-X GET https://api.fliki.ai/v1/languages
TypeScript Request
const apiKey = '<API_KEY>'; // Replace with your actual API key
const url = 'https://api.fliki.ai/v1/languages';
async function getLanguages(apiKey: string) {
try {
const response = await fetch(url, {
method: 'GET',
headers: {
'Authorization': `Bearer ${apiKey}`,
'Content-Type': 'application/json',
},
});
if (!response.ok) {
throw new Error(`Error: ${response.status} - ${response.statusText}`);
}
const data = await response.json();
console.log(data);
} catch (error) {
console.error('Error fetching languages:', error);
}
}
getLanguages(apiKey);
Python Request
import requests
api_key = "<API_KEY>"
url = "https://api.fliki.ai/v1/languages"
headers = {
"Authorization": f"Bearer {api_key}",
"Content-Type": "application/json"
}
response = requests.get(url, headers=headers)
print(response.json())
Go Request
package main
import (
"encoding/json"
"fmt"
"net/http"
)
func main() {
apiKey := "<API_KEY>"
url := "https://api.fliki.ai/v1/languages"
req, err := http.NewRequest("GET", url, nil)
if err != nil {
panic(err)
}
req.Header.Set("Authorization", "Bearer "+apiKey)
req.Header.Set("Content-Type", "application/json")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
var result map[string]interface{}
json.NewDecoder(resp.Body).Decode(&result)
fmt.Println(result)
}