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.2.0Published
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

Environment Variable Setup

bash
# .env (or .env.local in Next.js)
KHALEEJI_API_KEY=your_api_key_here

Quick Example

javascript
import { KhaleejiAPI } from '@khaleejiapi/sdk';
const apiKey = process.env.KHALEEJI_API_KEY;
if (!apiKey) throw new Error('Missing KHALEEJI_API_KEY environment variable. Get your key from https://khaleejiapi.dev/dashboard/api-keys');
const api = new KhaleejiAPI({ apiKey });
const result = await api.validation.validateEmail({ email: '[email protected]' });
console.log(result.valid);

Python

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

Installation

bash
pip install khaleejiapi

Environment Variable Setup

bash
# shell (add to ~/.bashrc or ~/.zshrc to persist)
export KHALEEJI_API_KEY=your_api_key_here
# .env option (with python-dotenv)
KHALEEJI_API_KEY=your_api_key_here

Quick Example

python
from khaleejiapi import KhaleejiAPI
import os
api_key = os.getenv("KHALEEJI_API_KEY")
if not api_key:
raise ValueError("Missing KHALEEJI_API_KEY environment variable. Get your key from https://khaleejiapi.dev/dashboard/api-keys")
api = KhaleejiAPI(api_key=api_key)
result = api.validation.validate_email("[email protected]")
print(result["valid"])

Go

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

Installation

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

Environment Variable Setup

bash
# shell
export KHALEEJI_API_KEY=your_api_key_here

Quick Example

go
package main
import (
"context"
"fmt"
"os"
khaleeji "github.com/xidioda/khaleejiapi-go"
)
func main() {
apiKey := os.Getenv("KHALEEJI_API_KEY")
if apiKey == "" {
panic("Missing KHALEEJI_API_KEY. Get your key from https://khaleejiapi.dev/dashboard/api-keys")
}
client := khaleeji.New(apiKey)
ctx := context.Background()
result, err := client.Validation.ValidateEmail(ctx, "[email protected]")
if err != nil {
panic(err)
}
fmt.Println("Valid:", result.Valid)
}

Swift (iOS)

KhaleejiAPIv1.0.0Published
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")

Environment Variable Setup

bash
# Xcode: Edit Scheme > Run > Arguments > Environment Variables
KHALEEJI_API_KEY=your_api_key_here

Quick Example

swift
import KhaleejiAPI
let apiKey = ProcessInfo.processInfo.environment["KHALEEJI_API_KEY"] ?? ""
guard !apiKey.isEmpty else { fatalError("Missing KHALEEJI_API_KEY. Get your key from https://khaleejiapi.dev/dashboard/api-keys") }
let api = KhaleejiAPI(apiKey: apiKey)
let result = try await api.validation.validateEmail("[email protected]")
print(result.valid)

Kotlin (Android)

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

Installation

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

Environment Variable Setup

bash
# runtime environment (local dev / JVM)
KHALEEJI_API_KEY=your_api_key_here

Quick Example

kotlin
import dev.khaleejiapi.KhaleejiAPI
val apiKey = System.getenv("KHALEEJI_API_KEY")
?: error("Missing KHALEEJI_API_KEY. Get your key from https://khaleejiapi.dev/dashboard/api-keys")
val api = KhaleejiAPI(apiKey)
val result = api.validation.validateEmail("[email protected]")
println(result.valid)

PHP

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

Installation

bash
composer require khaleejiapi/sdk

Environment Variable Setup

bash
# .env
KHALEEJI_API_KEY=your_api_key_here

Quick Example

php
<?php
use KhaleejiAPI\KhaleejiAPI;
$apiKey = getenv('KHALEEJI_API_KEY');
if (!$apiKey) {
throw new RuntimeException('Missing KHALEEJI_API_KEY. Get your key from https://khaleejiapi.dev/dashboard/api-keys');
}
$api = new KhaleejiAPI($apiKey);
$result = $api->validation->validateEmail('[email protected]');
echo $result['valid'];

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

Integration Guides

Need a fast setup for agent frameworks? Start with these focused guides: