Hello World: Your First KhaleejiAPI Call
Make your first successful API call in under 60 seconds. We'll validate an email address — one of the simplest endpoints — so you can confirm your auth, path, and response format are all correct before building further.
Get your API key
Every request must carry your API key in the Authorization header using the Bearer scheme. Do not omit the Bearer prefix or send the key via the x-api-key header — both return 401 Unauthorized.
Install an SDK (optional — skip if using cURL or fetch)
The official SDKs handle auth, retries, and type safety automatically. All examples in Step 3 produce the same result — pick the one that fits your stack.
# JavaScript / TypeScriptnpm install @khaleejiapi/sdk # Pythonpip install khaleejiapi # Gogo get github.com/khaleejiapi/sdk-goMake the call
Replace your_api_key_here with your real key from the dashboard.
Endpoint: GET https://khaleejiapi.dev/api/v1/email/[email protected]
cURL
curl -X GET "https://khaleejiapi.dev/api/v1/email/[email protected]" \ -H "Authorization: Bearer your_api_key_here"TypeScript SDK
import { KhaleejiAPI } from '@khaleejiapi/sdk'; const client = new KhaleejiAPI('your_api_key_here'); const result = await client.validation.validateEmail('[email protected]');console.log(result.valid); // trueconsole.log(result.deliverabilityScore); // 98TypeScript (fetch)
const response = await fetch( 'https://khaleejiapi.dev/api/v1/email/[email protected]', { headers: { 'Authorization': 'Bearer your_api_key_here' } });const { data } = await response.json();console.log(data.valid); // trueconsole.log(data.deliverabilityScore); // 98Python SDK
from khaleejiapi import KhaleejiAPI with KhaleejiAPI('your_api_key_here') as client: result = client.validation.validate_email('[email protected]') print(result['valid']) # True print(result['deliverabilityScore']) # 98Python (requests)
import requests response = requests.get( "https://khaleejiapi.dev/api/v1/email/validate", params={"email": "[email protected]"}, headers={"Authorization": "Bearer your_api_key_here"})data = response.json()["data"]print(data["valid"]) # Trueprint(data["deliverabilityScore"]) # 98Go
package main import ( "context" "fmt" khaleejiapi "github.com/khaleejiapi/sdk-go") func main() { client := khaleejiapi.New("your_api_key_here") result, err := client.Validation.ValidateEmail( context.Background(), "[email protected]", ) if err != nil { panic(err) } fmt.Println("Valid:", result.Valid) // Valid: true fmt.Println("Score:", result.DeliverabilityScore) // Score: 98}PHP
<?php$key = 'your_api_key_here';$email = '[email protected]'; $ch = curl_init( "https://khaleejiapi.dev/api/v1/email/validate?email=" . urlencode($email));curl_setopt_array($ch, [ CURLOPT_HTTPHEADER => ["Authorization: " . $key], CURLOPT_RETURNTRANSFER => true,]);$response = json_decode(curl_exec($ch), true); echo $response['data']['valid']; // trueecho $response['data']['deliverabilityScore']; // 98Read the response
Every KhaleejiAPI response wraps results in a data key. For email validation you receive:
{ "data": { "email": "[email protected]", "valid": true, "deliverabilityScore": 98, "reason": "Valid email address", "checks": { "syntax": true, "disposable": false, "mx": true, "role": false, "freeProvider": false }, "domain": "example.com", "localPart": "hello" }, "meta": { "timestamp": "2026-01-01T00:00:00.000Z" }}data.valid— boolean; the primary signal you needdata.deliverabilityScore— 0–100 confidence scoredata.checks— granular sub-checks (syntax, MX, disposable, role account)meta.timestamp— ISO 8601 server timestamp
Common first-call errors
401Key sent without the Bearer prefix, as a raw value, or via the x-api-key header. Use Authorization: Bearer your_api_key_here.404Wrong endpoint path. The API base is /api/v1/ — not /v1/.429Rate limit reached. The free tier allows 1,000 requests/month. See Rate Limits.Next steps
Full Quick Start
Account setup, SDK installation, and monitoring your API status.
Authentication
Key management, scopes, and security best practices.
Explore APIs
30+ APIs: validation, geolocation, Islamic finance, translation, and more.
SDKs & Libraries
TypeScript, Python, Go, Swift, Kotlin, PHP, MCP, and LangChain SDKs.