SDKs

SDKs & Libraries

Official SDKs and libraries to integrate KhaleejiAPI into your favorite programming language.

All 7 SDKs are now available: TypeScript, Python, Go, Swift, Kotlin, PHP, and MCP Server. Install with your favorite package manager.

JavaScript / TypeScript

@khaleejiapi/sdkv1.1.0Published
View on GitHub
Full TypeScript types
Promise-based API
Automatic retries with backoff
Node.js 18+, Deno, Bun & browsers
Zero runtime dependencies

Installation

bash
npm install @khaleejiapi/sdk

Quick Example

javascript
import { KhaleejiAPI } from '@khaleejiapi/sdk';
const api = new KhaleejiAPI({ apiKey: 'your_api_key' });
// Validation
const email = await api.validation.validateEmail({ email: 'test@example.com' });
const saudiId = await api.validation.validateSaudiId({ id: '1234567890' });
// AI Translation
const translated = await api.communication.translateAI({
text: 'Hello World',
target: 'ar',
formality: 'formal',
});
console.log(translated.translatedText);
// Islamic & Arabic
const hijri = await api.islamic.convertHijri({ today: true });
const prayers = await api.islamic.getPrayerTimes({ city: 'dubai' });
// Finance
const rates = await api.finance.getExchangeRates({ base: 'AED' });
const bizDays = await api.finance.getBusinessDays({ country: 'AE', from: '2025-01-01', to: '2025-01-31' });

Python

khaleejiapiv1.1.0Published
View on GitHub
Full type hints (PEP 561)
Sync + async clients
Automatic retries with backoff
Python 3.9+
httpx-based

Installation

bash
pip install khaleejiapi

Quick Example

python
from khaleejiapi import KhaleejiAPI
api = KhaleejiAPI(api_key="your_api_key")
# Validation
result = api.validation.validate_email("test@example.com")
saudi = api.validation.validate_saudi_id("1234567890")
# AI Translation
translated = api.communication.translate_ai(
text="Hello World", target="ar", formality="formal"
)
print(translated["translatedText"])
# Islamic & Arabic
hijri = api.islamic.convert_hijri(today=True)
prayers = api.islamic.get_prayer_times(city="dubai")
arabic = api.islamic.process_arabic("transliterate", "مرحبا")
# Finance
rates = api.finance.get_exchange_rates()
biz = api.finance.get_business_days(country="AE", from_date="2025-01-01", to_date="2025-01-31")

Go

github.com/xidioda/khaleejiapi-gov1.0.0Published
View on GitHub
Idiomatic Go with generics
Context support
Automatic retries with backoff
Go 1.22+
Zero dependencies

Installation

bash
go get github.com/xidioda/khaleejiapi-go

Quick Example

go
package main
import (
"context"
"fmt"
khaleeji "github.com/xidioda/khaleejiapi-go"
)
func main() {
client := khaleeji.New("your_api_key")
ctx := context.Background()
// Validate an email
email, _ := client.Validation.ValidateEmail(ctx, "test@example.com")
fmt.Println("Valid:", email.Valid)
// Prayer times
prayers, _ := client.Islamic.GetPrayerTimes(ctx, khaleeji.PrayerTimesParams{
City: "Dubai",
})
fmt.Println("Fajr:", prayers.Prayers.Fajr)
// Exchange rates
rates, _ := client.Finance.GetExchangeRates(ctx, "AED", "USD,EUR,SAR")
fmt.Println("Rates:", rates.Rates)
}

Swift (iOS)

KhaleejiAPIv1.0.0Published
View on GitHub
Swift concurrency (async/await)
iOS 15+ / macOS 12+
Automatic retries with backoff
Full Codable models
SPM compatible

Installation

bash
.package(url: "https://github.com/xidioda/khaleejiapi-swift.git", from: "1.0.0")

Quick Example

javascript
import KhaleejiAPI
let api = KhaleejiAPI(apiKey: "your_api_key")
// Validate an email
let email = try await api.validation.validateEmail("test@example.com")
print(email.valid) // true
// Prayer times
let prayers = try await api.islamic.getPrayerTimes(city: "Dubai")
print(prayers.prayers.fajr)
// Exchange rates
let rates = try await api.finance.getExchangeRates(base: "AED", symbols: ["USD", "EUR"])
print(rates.rates)

Kotlin (Android)

dev.khaleejiapi:khaleejiapi-sdkv1.0.0Published
View on GitHub
Kotlin Coroutines
Ktor HTTP client
kotlinx.serialization
Android API 26+
JDK 17+

Installation

bash
implementation("dev.khaleejiapi:khaleejiapi-sdk:1.0.0")

Quick Example

javascript
import dev.khaleejiapi.KhaleejiAPI
val api = KhaleejiAPI("your_api_key")
// Validate an email
val email = api.validation.validateEmail("test@example.com")
println(email.valid) // true
// Prayer times
val prayers = api.islamic.getPrayerTimes(city = "Dubai")
println(prayers.prayers.fajr)
// Exchange rates
val rates = api.finance.getExchangeRates(base = "AED", symbols = listOf("USD", "EUR"))
println(rates.rates)

PHP

khaleejiapi/sdkv1.0.0Published
View on GitHub
PSR-4 autoloading
Guzzle HTTP client
PHP 8.1+
Laravel compatible
Automatic retries

Installation

bash
composer require khaleejiapi/sdk

Quick Example

php
<?php
use KhaleejiAPI\KhaleejiAPI;
$api = new KhaleejiAPI('your_api_key');
// Validate an email
$email = $api->validation->validateEmail('test@example.com');
echo $email['valid']; // true
// Prayer times
$prayers = $api->islamic->getPrayerTimes(city: 'Dubai');
echo $prayers['prayers']['fajr'];
// Exchange rates
$rates = $api->finance->getExchangeRates('AED', ['USD', 'EUR']);
print_r($rates['rates']);

Prefer REST?

Don't see your language listed? No problem! Our APIs are fully RESTful and can be accessed from any language that can make HTTP requests.

View REST API Docs