Dialects
List all supported dialects.
Request
GEThttps://api.fliki.ai/v1/dialects
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 dialect (e.g., “American English”, “British English”). |
slug | string | Shortened, URL-friendly version of the dialect name (e.g., “en-us”, “en-gb”). |
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/dialects
TypeScript Request
const apiKey = '<API_KEY>'; // Replace with your actual API key
const url = 'https://api.fliki.ai/v1/dialects';
async function getDialects(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 dialects:', error);
}
}
getDialects(apiKey);
Python Request
import requests
api_key = "<API_KEY>"
url = "https://api.fliki.ai/v1/dialects"
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/dialects"
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)
}