unlein - the work need something new

API Documentation

Access real-time gold rates, silver rates, and Aadhar verification services through our REST APIs.

🔐 Authentication

All API requests require an API key to be included in the request headers:

X-API-Key: your_api_key_here
📊 API Usage Limits

Your API usage limits depend on your subscription plan. Check your subscription details for more information.

Gold Rate API

Get real-time and historical gold rates with comprehensive market data

GET

Current Gold Rate

GET https://api.unlein.com/v1/gold/current
Get the current gold rate for a specific city and purity level. The rates are updated every 5 minutes during market hours.
Sample Request
GET https://api.unlein.com/v1/gold/current?city=Mumbai&karat=24
Headers:
{
    "X-API-Key": "your_api_key"
}
Sample Response
{
    "status": "success",
    "timestamp": "2023-05-31T10:30:00Z",
    "data": {
        "city": "Mumbai",
        "karat": 24,
        "rate_per_gram": 5234.50,
        "rate_per_10_gram": 52345.00,
        "currency": "INR",
        "last_updated": "2023-05-31T10:25:00Z",
        "market_status": "open",
        "price_trend": "up",
        "day_change_percentage": 0.75
    }
}
Query Parameters
Parameter Type Description
city string Optional. City name for location-specific rates
karat number Optional. Gold purity (24, 22, 18). Default: 24
Response Example
{
    "status": "success",
    "timestamp": "2023-05-31T10:30:00Z",
    "data": {
        "city": "Mumbai",
        "karat": 24,
        "rate_per_gram": 5234.50,
        "rate_per_10_gram": 52345.00,
        "currency": "INR",
        "last_updated": "2023-05-31T10:25:00Z"
    }
}
GET

Historical Gold Rates

GET https://api.unlein.com/v1/gold/historical
Query Parameters
Parameter Type Description
from_date string Start date (YYYY-MM-DD)
to_date string End date (YYYY-MM-DD)

Silver Rate API

Get real-time and historical silver rates with market insights

GET

Current Silver Rate

GET https://api.unlein.com/v1/silver/current
Get the current silver rate for a specific city and purity level. The rates are updated every 5 minutes during market hours.
Sample Request
GET https://api.unlein.com/v1/silver/current?city=Mumbai&purity=999
Headers:
{
    "X-API-Key": "your_api_key"
}
Sample Response
{
    "status": "success",
    "timestamp": "2023-05-31T10:30:00Z",
    "data": {
        "city": "Mumbai",
        "purity": 999,
        "rate_per_kg": 72500.00,
        "rate_per_10_gram": 725.00,
        "currency": "INR",
        "last_updated": "2023-05-31T10:25:00Z",
        "market_status": "open",
        "price_trend": "stable",
        "day_change_percentage": 0.25
    }
}
Query Parameters
Parameter Type Description
city string Optional. City name for location-specific rates
purity number Optional. Silver purity (999, 925). Default: 999

Aadhar Verification API

Secure and reliable Aadhar verification service with instant results

POST

Verify Aadhar

POST https://api.unlein.com/v1/aadhar/verify
Verify Aadhar card details securely. The API performs real-time verification and returns instant results.
Sample Request
POST https://api.unlein.com/v1/aadhar/verify
Headers:
{
    "X-API-Key": "your_api_key",
    "Content-Type": "application/json"
}

Body:
{
    "aadhar_number": "1234-5678-9012",
    "name": "John Doe"
}
Sample Response
{
    "status": "success",
    "verified": true,
    "data": {
        "name_match": true,
        "verification_id": "ver_123456789",
        "timestamp": "2023-05-31T10:30:00Z",
        "verification_source": "UIDAI",
        "demographic_match": {
            "name": true,
            "dob": true,
            "gender": true
        }
    }
}
Request Body Parameters
Parameter Type Description
aadhar_number string 12-digit Aadhar number
name string Name as per Aadhar card
Response Example
{
    "status": "success",
    "verified": true,
    "data": {
        "name_match": true,
        "verification_id": "ver_123456789",
        "timestamp": "2023-05-31T10:30:00Z"
    }
}

Train PNR Status API

Real-time PNR status checking API for Indian Railways with complete passenger and journey details

GET

Check PNR Status

GET https://api.unlein.com/v1/train/pnr/
Get the current status of a train PNR number including booking status, journey details and passenger information.
Sample Request
GET https://api.unlein.com/v1/train/pnr/1234567890
Headers:
{
    "X-API-Key": "your_api_key"
}
Sample Response
{
    "status": "success",
    "timestamp": "2023-05-31T10:30:00Z",
    "data": {
        "pnr": "1234567890",
        "train_no": "12345",
        "train_name": "Rajdhani Express",
        "from_station": "NDLS",
        "to_station": "MMCT",
        "travel_date": "2023-06-07",
        "class": "3A",
        "booking_status": "CNF/B3/23",
        "current_status": "CNF/B3/23",
        "passengers": [
            {
                "no": 1,
                "booking_status": "CNF/B3/23", 
                "current_status": "CNF/B3/23"
            }
        ]
    }
}
Query Parameters
Parameter Type Description
pnr string 10-digit PNR number

Code Examples

Ready-to-use code snippets in popular programming languages

using System.Net.Http;
using System.Threading.Tasks;

public class ApiClient
{
    private readonly HttpClient _client;
    private const string BaseUrl = "https://api.unlein.com/v1";

    public ApiClient(string apiKey)
    {
        _client = new HttpClient();
        _client.DefaultRequestHeaders.Add("X-API-Key", apiKey);
    }

    public async Task GetGoldRateAsync(string city = null)
    {
        var url = $"{BaseUrl}/gold/current";
        if (!string.IsNullOrEmpty(city))
            url += $"?city={city}";

        var response = await _client.GetAsync(url);
        return await response.Content.ReadAsStringAsync();
    }

    public async Task CheckPnrStatusAsync(string pnr)
    {
        var url = $"{BaseUrl}/train/pnr?pnr={pnr}";
        var response = await _client.GetAsync(url);
        return await response.Content.ReadAsStringAsync();
    }
}
import requests

class ApiClient:
    BASE_URL = 'https://api.unlein.com/v1'

    def __init__(self, api_key):
        self.session = requests.Session()
        self.session.headers.update({'X-API-Key': api_key})

    def get_gold_rate(self, city=None):
        url = f"{self.BASE_URL}/gold/current"
        params = {'city': city} if city else None
        response = self.session.get(url, params=params)
        return response.json()

    def verify_aadhar(self, aadhar_number, name):
        url = f"{self.BASE_URL}/aadhar/verify"
        data = {
            'aadhar_number': aadhar_number,
            'name': name
        }
        response = self.session.post(url, json=data)
        return response.json()

    def check_pnr_status(self, pnr):
        url = f"{self.BASE_URL}/train/pnr"
        params = {'pnr': pnr}
        response = self.session.get(url, params=params)
        return response.json()
class ApiClient {
    constructor(apiKey) {
        this.baseUrl = 'https://api.unlein.com/v1';
        this.headers = {
            'X-API-Key': apiKey,
            'Content-Type': 'application/json'
        };
    }

    async getGoldRate(city = null) {
        const url = new URL(`${this.baseUrl}/gold/current`);
        if (city) url.searchParams.append('city', city);

        const response = await fetch(url, {
            headers: this.headers
        });
        return await response.json();
    }

    async getSilverRate(city = null, purity = null) {
        const url = new URL(`${this.baseUrl}/silver/current`);
        if (city) url.searchParams.append('city', city);
        if (purity) url.searchParams.append('purity', purity);

        const response = await fetch(url, {
            headers: this.headers
        });
        return await response.json();
    }

    async verifyAadhar(aadharNumber, name) {
        const url = `${this.baseUrl}/aadhar/verify`;
        const data = {
            aadhar_number: aadharNumber,
            name: name
        };

        const response = await fetch(url, {
            method: 'POST',
            headers: this.headers,
            body: JSON.stringify(data)
        });
        return await response.json();
    }

    async checkPnrStatus(pnr) {
        const url = new URL(`${this.baseUrl}/train/pnr`);
        url.searchParams.append('pnr', pnr);

        const response = await fetch(url, {
            headers: this.headers
        });
        return await response.json();
    }
}
apiKey = $apiKey;
    }

    public function getGoldRate($city = null) {
        $url = "{$this->baseUrl}/gold/current";
        if ($city) {
            $url .= "?city=" . urlencode($city);
        }

        $ch = curl_init($url);
        curl_setopt_array($ch, [
            CURLOPT_RETURNTRANSFER => true,
            CURLOPT_HTTPHEADER => [
                "X-API-Key: {$this->apiKey}",
                'Accept: application/json'
            ]
        ]);

        $response = curl_exec($ch);
        curl_close($ch);

        return json_decode($response, true);
    }

    public function verifyAadhar($aadharNumber, $name) {
        $url = "{$this->baseUrl}/aadhar/verify";

        $data = [
            'aadhar_number' => $aadharNumber,
            'name' => $name
        ];

        $ch = curl_init($url);
        curl_setopt_array($ch, [
            CURLOPT_RETURNTRANSFER => true,
            CURLOPT_POST => true,
            CURLOPT_POSTFIELDS => json_encode($data),
            CURLOPT_HTTPHEADER => [
                "X-API-Key: {$this->apiKey}",
                'Content-Type: application/json',
                'Accept: application/json'
            ]
        ]);

        $response = curl_exec($ch);
        curl_close($ch);

        return json_decode($response, true);
    }

    public function checkPnrStatus($pnr) {
        $url = "{$this->baseUrl}/train/pnr?pnr=" . urlencode($pnr);
        
        $ch = curl_init();
        curl_setopt($ch, CURLOPT_URL, $url);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
        curl_setopt($ch, CURLOPT_HTTPHEADER, [
            "X-API-Key: {$this->apiKey}",
            'Content-Type: application/json'
        ]);
        
        $response = curl_exec($ch);
        curl_close($ch);
        
        return json_decode($response, true);
    }
}

Subscribe to our Newsletter

Stay informed on our latest news!