Home / API
API Documentation
Use your API key to integrate INS with external websites or Telegram bots. Simple HTTPS + JSON. Works with every programming language.
Simple, Powerful REST API
Use your API key to integrate with external websites or Telegram bots. No SDK required — works with Python, PHP, Node.js, Go, Ruby, Java, .NET, or any language that can call HTTP.
- Clean REST endpoints with JSON
- API key authentication via
x-api-keyheader - Built-in pagination on list endpoints
- Filter SMS by number, platform and date
- Live statistics endpoint
- Detailed error responses & status codes
- Free API access for all registered users
Base URL & Auth
http://203.161.58.20/api/functions/agent-api
Headers
x-api-key: your_api_key
Response Format
{
"ok": true,
"data": [...],
"pagination": {
"page": 1,
"limit": 100,
"total": 0,
"total_pages": 0
}
}
SDK Support
Any HTTP client works — see language examples below.
Endpoints
Available Endpoints
Two core endpoints power most integrations. Send your x-api-key header with every request.
1. GET /otp — Get SMS Messages
GET /otp?page=1&limit=100&number=216&platform=WhatsApp&since=2026-01-01 x-api-key: your_api_key
Query Parameters
page (optional) page number, default 1 limit (optional) results per page, default 100 number (optional) filter by phone number / country code platform (optional) filter by platform (e.g. WhatsApp, Facebook) since (optional) ISO date, e.g. 2026-01-01
Response
{
"ok": true,
"data": [
{
"id": "msg_9x8y7z",
"number": "+21650123456",
"platform": "WhatsApp",
"from": "WhatsApp",
"text": "Your WhatsApp code is 924183",
"otp": "924183",
"received_at": "2026-07-10T18:12:47Z"
}
],
"pagination": { "page": 1, "limit": 100, "total": 1, "total_pages": 1 }
}
2. GET /stats — Statistics
GET /stats x-api-key: your_api_key
Response
{
"ok": true,
"data": {
"total_sms": 128450,
"today_sms": 1187,
"numbers": 320,
"users": 2140
}
}
Code Examples
Quick Integration in Any Language
cURL
curl -H "x-api-key: your_api_key" \ "http://203.161.58.20/api/functions/agent-api/otp?page=1&limit=100&platform=WhatsApp"
PHP (cURL)
$ch = curl_init("http://203.161.58.20/api/functions/agent-api/otp?page=1&limit=100&platform=WhatsApp");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
"x-api-key: your_api_key"
]
]);
$result = json_decode(curl_exec($ch), true);
if ($result["ok"]) {
foreach ($result["data"] as $sms) {
echo $sms["otp"] . " from " . $sms["platform"] . PHP_EOL;
}
}
Python (requests)
import requests
r = requests.get(
"http://203.161.58.20/api/functions/agent-api/otp",
headers={"x-api-key": "your_api_key"},
params={"page": 1, "limit": 100, "platform": "WhatsApp", "since": "2026-01-01"}
)
data = r.json()
if data["ok"]:
for sms in data["data"]:
print(sms["otp"], sms["platform"])
Node.js (fetch)
const res = await fetch(
"http://203.161.58.20/api/functions/agent-api/otp?page=1&limit=100&platform=WhatsApp",
{ headers: { "x-api-key": "your_api_key" } }
);
const data = await res.json();
if (data.ok) {
data.data.forEach(sms => console.log(sms.otp, sms.platform));
}
Go (net/http)
package main
import (
"encoding/json"
"fmt"
"net/http"
)
func main() {
req, _ := http.NewRequest("GET",
"http://203.161.58.20/api/functions/agent-api/stats", nil)
req.Header.Set("x-api-key", "your_api_key")
resp, _ := http.DefaultClient.Do(req)
defer resp.Body.Close()
var out map[string]interface{}
json.NewDecoder(resp.Body).Decode(&out)
fmt.Println(out)
}
Ruby (net/http)
require "net/http"
require "json"
uri = URI("http://203.161.58.20/api/functions/agent-api/otp?page=1&limit=100")
req = Net::HTTP::Get.new(uri)
req["x-api-key"] = "your_api_key"
res = Net::HTTP.start(uri.hostname, uri.port) { |http| http.request(req) }
puts JSON.parse(res.body)
Java (HttpClient)
import java.net.URI;
import java.net.http.*;
HttpClient client = HttpClient.newHttpClient();
HttpRequest req = HttpRequest.newBuilder()
.uri(URI.create("http://203.161.58.20/api/functions/agent-api/stats"))
.header("x-api-key", "your_api_key")
.GET().build();
HttpResponse<String> res = client.send(req, HttpResponse.BodyHandlers.ofString());
System.out.println(res.body());
C# / .NET (HttpClient)
using System.Net.Http;
var client = new HttpClient();
client.DefaultRequestHeaders.Add("x-api-key", "your_api_key");
var res = await client.GetStringAsync(
"http://203.161.58.20/api/functions/agent-api/otp?page=1&limit=100&platform=WhatsApp");
Console.WriteLine(res);
Telegram Bot (Python + python-telegram-bot)
import requests
from telegram.ext import Application, CommandHandler
API_KEY = "your_api_key"
BASE = "http://203.161.58.20/api/functions/agent-api"
async def latest(update, ctx):
r = requests.get(f"{BASE}/otp",
headers={"x-api-key": API_KEY},
params={"page": 1, "limit": 5}).json()
if r.get("ok"):
lines = [f"{s['platform']}: {s['otp']}" for s in r["data"]]
await update.message.reply_text("\n".join(lines) or "No SMS yet.")
app = Application.builder().token("TELEGRAM_BOT_TOKEN").build()
app.add_handler(CommandHandler("latest", latest))
app.run_polling()
Get Your API Key
API keys are available inside your INS customer portal under Settings → API Access. All API access is free — keys are provisioned instantly on signup.
Go to PortalBuild with the INS API
Grab your API key, call /otp or /stats, and go live in minutes.