{"openapi": "3.1.0", "info": {"title": "LEKANDO API CENTER", "version": "1.0.0", "description": "Unified REST API for Lekando.com data: verified country guides, central\nfigures (rates, fees, thresholds) and browser-tool calculators, bilingual\n(Arabic + English). Every response carries source, as-of date and\nverification status in `meta`. Data is free with attribution.\n", "contact": {"name": "Lekando", "url": "https://www.lekando.com", "email": "developers@lekando.com"}, "license": {"name": "Lekando Data Terms", "url": "https://developers.lekando.com/terms"}}, "servers": [{"url": "https://api.lekando.com", "description": "Production"}, {"url": "https://staging-api.lekando.com", "description": "Staging (password-protected)"}], "security": [{"bearerAuth": []}, {"apiKeyHeader": []}, {"apiKeyQuery": []}], "tags": [{"name": "meta"}, {"name": "figures"}, {"name": "countries"}, {"name": "tools"}], "paths": {"/v1/status": {"get": {"tags": ["meta"], "summary": "Service status and catalog counts", "security": [], "operationId": "getStatus", "responses": {"200": {"description": "Operational status, catalog counts, endpoint list", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/StatusResponse"}}}}}}}, "/v1/plans": {"get": {"tags": ["meta"], "summary": "Public plan catalog", "security": [], "operationId": "getPlans", "responses": {"200": {"description": "Plans with limits and scopes (payments currently disabled)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/PlansResponse"}}}}}}}, "/v1/figures": {"get": {"tags": ["figures"], "summary": "List central figures (rates, fees, thresholds)", "operationId": "listFigures", "parameters": [{"name": "prefix", "in": "query", "schema": {"type": "string", "example": "ae.tool-salik-toll-cost"}, "description": "Namespace prefix filter"}, {"name": "page", "in": "query", "schema": {"type": "integer", "default": 1}}, {"name": "per_page", "in": "query", "schema": {"type": "integer", "default": 50, "maximum": 200}}], "responses": {"200": {"description": "Paginated figures with unit, as-of date and source", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/FigureListResponse"}}}}, "401": {"$ref": "#/components/responses/KeyRequired"}, "429": {"$ref": "#/components/responses/RateLimited"}}}}, "/v1/figures/{key}": {"get": {"tags": ["figures"], "summary": "One figure by exact key", "operationId": "getFigure", "parameters": [{"name": "key", "in": "path", "required": true, "schema": {"type": "string", "example": "iq.exchange-rate.usd"}}], "responses": {"200": {"description": "The figure", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/FigureResponse"}}}}, "404": {"$ref": "#/components/responses/NotFound"}}}}, "/v1/countries": {"get": {"tags": ["countries"], "summary": "List countries with live page counts", "operationId": "listCountries", "responses": {"200": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/CountryListResponse"}}}}}}}, "/v1/countries/{cc}": {"get": {"tags": ["countries"], "summary": "One country: profile and page index", "operationId": "getCountry", "parameters": [{"name": "cc", "in": "path", "required": true, "schema": {"type": "string", "pattern": "^[a-z]{2}$", "example": "ae"}}], "responses": {"200": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/CountryResponse"}}}}, "404": {"$ref": "#/components/responses/NotFound"}}}}, "/v1/pages/{slug}": {"get": {"tags": ["countries"], "summary": "One guide page with provenance (sources, reviewed date)", "operationId": "getPage", "parameters": [{"name": "slug", "in": "path", "required": true, "schema": {"type": "string", "example": "ae/apps"}}], "responses": {"200": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/PageResponse"}}}}, "404": {"$ref": "#/components/responses/NotFound"}}}}, "/v1/search": {"get": {"tags": ["countries"], "summary": "Search page titles and descriptions", "operationId": "searchPages", "parameters": [{"name": "q", "in": "query", "required": true, "schema": {"type": "string", "minLength": 2}}, {"name": "limit", "in": "query", "schema": {"type": "integer", "default": 20, "maximum": 50}}], "responses": {"200": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/SearchResponse"}}}}, "400": {"$ref": "#/components/responses/BadRequest"}}}}, "/v1/tools": {"get": {"tags": ["tools"], "summary": "List available calculators/tools", "operationId": "listTools", "responses": {"200": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ToolListResponse"}}}}}}}, "/v1/tools/{id}": {"get": {"tags": ["tools"], "summary": "One tool's input/output spec", "operationId": "getTool", "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "string", "example": "iq-tool-usd-iqd-converter"}}], "responses": {"200": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/ToolResponse"}}}}, "404": {"$ref": "#/components/responses/NotFound"}}}}, "/v1/tools/{id}/calculate": {"post": {"tags": ["tools"], "summary": "Run a tool server-side with the same spec the website uses", "operationId": "calculateTool", "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "string"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object", "properties": {"inputs": {"type": "object", "additionalProperties": true, "example": {"amount": 100, "direction": 0}}}}}}}, "responses": {"200": {"description": "Results, figures used (with as-of dates), warnings and sources", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CalculateResponse"}}}}, "400": {"$ref": "#/components/responses/BadRequest"}, "404": {"$ref": "#/components/responses/NotFound"}}}}, "/v1/webhooks": {"get": {"tags": ["webhooks"], "summary": "List your webhook subscriptions (secrets are never shown after creation)", "operationId": "listWebhooks", "security": [{"bearerAuth": []}, {"apiKeyQuery": []}], "responses": {"200": {"description": "Your subscriptions"}}}, "post": {"tags": ["webhooks"], "summary": "Create a webhook subscription (secret shown once)", "operationId": "createWebhook", "security": [{"bearerAuth": []}, {"apiKeyQuery": []}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object", "required": ["url"], "properties": {"url": {"type": "string", "description": "https:// endpoint that receives POSTs"}, "events": {"type": "array", "items": {"type": "string", "enum": ["usage.threshold", "webhook.test"]}, "example": ["usage.threshold"]}}}}}}, "responses": {"201": {"description": "Created. Deliveries are signed: X-Lekando-Signature: sha256=<HMAC-SHA256 of raw body with the secret>"}, "400": {"$ref": "#/components/responses/BadRequest"}}}}, "/v1/webhooks/{id}/delete": {"post": {"tags": ["webhooks"], "summary": "Delete a webhook subscription", "operationId": "deleteWebhook", "security": [{"bearerAuth": []}, {"apiKeyQuery": []}], "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}], "responses": {"200": {"description": "Deleted"}, "404": {"$ref": "#/components/responses/NotFound"}}}}, "/v1/webhooks/{id}/test": {"post": {"tags": ["webhooks"], "summary": "Send a webhook.test delivery to verify your endpoint", "operationId": "testWebhook", "security": [{"bearerAuth": []}, {"apiKeyQuery": []}], "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "integer"}}], "responses": {"200": {"description": "Delivery result (delivered, http_code, error)"}, "404": {"$ref": "#/components/responses/NotFound"}}}}, "/v1/mcp": {"get": {"tags": ["mcp"], "summary": "MCP server discovery card (public)", "operationId": "mcpInfo", "responses": {"200": {"description": "Protocol version, transport, methods and tool names"}}}, "post": {"tags": ["mcp"], "summary": "MCP server (Model Context Protocol, JSON-RPC 2.0 over HTTP POST)", "description": "Requires a key whose plan includes the mcp scope (Enterprise). Methods: initialize, ping, tools/list, tools/call. Every MCP tool maps 1:1 onto a v1 REST endpoint and runs the same engine; results carry source, as_of and verification status in structuredContent.meta.", "operationId": "mcpRpc", "security": [{"bearerAuth": []}, {"apiKeyQuery": []}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object", "properties": {"jsonrpc": {"type": "string", "enum": ["2.0"]}, "id": {}, "method": {"type": "string", "enum": ["initialize", "ping", "tools/list", "tools/call"]}, "params": {"type": "object"}}}, "example": {"jsonrpc": "2.0", "id": 1, "method": "tools/call", "params": {"name": "tools.calculate", "arguments": {"id": "iq-tool-usd-iqd-converter", "inputs": {"amount": 100, "direction": 0}}}}}}}, "responses": {"200": {"description": "JSON-RPC 2.0 response (result or error)"}, "401": {"$ref": "#/components/responses/KeyRequired"}, "403": {"description": "Key valid but the plan lacks the mcp scope"}}}}}, "components": {"securitySchemes": {"bearerAuth": {"type": "http", "scheme": "bearer", "description": "Authorization: Bearer lk_live_..."}, "apiKeyHeader": {"type": "apiKey", "in": "header", "name": "X-API-Key"}, "apiKeyQuery": {"type": "apiKey", "in": "query", "name": "api_key"}}, "responses": {"KeyRequired": {"description": "Missing or invalid API key", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "NotFound": {"description": "Resource not found", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "BadRequest": {"description": "Invalid request", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "RateLimited": {"description": "Rate limit or daily quota exceeded", "headers": {"Retry-After": {"schema": {"type": "integer"}}, "X-RateLimit-Limit-Minute": {"schema": {"type": "integer"}}, "X-RateLimit-Remaining-Minute": {"schema": {"type": "integer"}}, "X-RateLimit-Limit-Day": {"schema": {"type": "integer"}}, "X-RateLimit-Remaining-Day": {"schema": {"type": "integer"}}, "X-RateLimit-Reset": {"schema": {"type": "integer"}}}, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}, "schemas": {"LangPair": {"type": "object", "properties": {"ar": {"type": "string"}, "en": {"type": "string"}}}, "Source": {"type": "object", "properties": {"name": {"type": "string"}, "url": {"type": "string", "format": "uri"}, "verified": {"type": "boolean"}}}, "Meta": {"type": "object", "description": "Present on every response — provenance is not optional", "properties": {"version": {"type": "string", "example": "v1"}, "generated_at": {"type": "string", "format": "date-time"}, "attribution": {"type": "string"}, "license": {"type": "string", "format": "uri"}, "docs": {"type": "string", "format": "uri"}, "source": {"type": "array", "items": {"$ref": "#/components/schemas/Source"}}, "as_of": {"type": "string", "format": "date", "nullable": true}, "last_updated": {"type": "string", "format": "date", "nullable": true}, "verified": {"type": "boolean", "nullable": true}, "cache": {"type": "string", "enum": ["hit", "miss"]}}}, "Error": {"type": "object", "properties": {"ok": {"type": "boolean", "example": false}, "error": {"type": "object", "properties": {"code": {"type": "string", "example": "key_required"}, "message": {"type": "string"}}}, "meta": {"$ref": "#/components/schemas/Meta"}}}, "Figure": {"type": "object", "properties": {"key": {"type": "string"}, "value": {"description": "number or string"}, "unit": {"type": "string"}, "as_of": {"type": "string", "format": "date"}, "source": {"type": "string", "format": "uri"}, "pages": {"type": "array", "items": {"type": "string"}}}}, "FigureResponse": {"type": "object", "properties": {"ok": {"type": "boolean"}, "data": {"$ref": "#/components/schemas/Figure"}, "meta": {"$ref": "#/components/schemas/Meta"}}}, "FigureListResponse": {"type": "object", "properties": {"ok": {"type": "boolean"}, "data": {"type": "object", "properties": {"figures": {"type": "array", "items": {"$ref": "#/components/schemas/Figure"}}, "pagination": {"type": "object", "properties": {"page": {"type": "integer"}, "per_page": {"type": "integer"}, "total": {"type": "integer"}, "pages": {"type": "integer"}}}}}, "meta": {"$ref": "#/components/schemas/Meta"}}}, "CountryListResponse": {"type": "object", "properties": {"ok": {"type": "boolean"}, "data": {"type": "object", "properties": {"countries": {"type": "array", "items": {"type": "object", "properties": {"code": {"type": "string"}, "name": {"$ref": "#/components/schemas/LangPair"}, "short": {"$ref": "#/components/schemas/LangPair"}, "timezone": {"type": "string"}, "pages": {"type": "integer"}}}}, "total": {"type": "integer"}}}, "meta": {"$ref": "#/components/schemas/Meta"}}}, "CountryResponse": {"type": "object", "properties": {"ok": {"type": "boolean"}, "data": {"type": "object", "properties": {"code": {"type": "string"}, "name": {"$ref": "#/components/schemas/LangPair"}, "timezone": {"type": "string"}, "main_pages": {"type": "array", "items": {"type": "object"}}, "pages": {"type": "array", "items": {"type": "object"}}, "total": {"type": "integer"}}}, "meta": {"$ref": "#/components/schemas/Meta"}}}, "PageResponse": {"type": "object", "properties": {"ok": {"type": "boolean"}, "data": {"type": "object", "properties": {"slug": {"type": "string"}, "kind": {"type": "string"}, "title": {"$ref": "#/components/schemas/LangPair"}, "description": {"$ref": "#/components/schemas/LangPair"}, "reviewed": {"type": "string", "format": "date"}, "sources": {"type": "array", "items": {"$ref": "#/components/schemas/Source"}}, "url": {"type": "string", "format": "uri"}, "url_en": {"type": "string", "format": "uri"}}}, "meta": {"$ref": "#/components/schemas/Meta"}}}, "SearchResponse": {"type": "object", "properties": {"ok": {"type": "boolean"}, "data": {"type": "object", "properties": {"query": {"type": "string"}, "results": {"type": "array", "items": {"type": "object"}}, "total": {"type": "integer"}}}, "meta": {"$ref": "#/components/schemas/Meta"}}}, "ToolListResponse": {"type": "object", "properties": {"ok": {"type": "boolean"}, "data": {"type": "object", "properties": {"tools": {"type": "array", "items": {"type": "object"}}, "total": {"type": "integer"}}}, "meta": {"$ref": "#/components/schemas/Meta"}}}, "ToolResponse": {"type": "object", "properties": {"ok": {"type": "boolean"}, "data": {"type": "object"}, "meta": {"$ref": "#/components/schemas/Meta"}}}, "CalculateResponse": {"type": "object", "properties": {"ok": {"type": "boolean"}, "data": {"type": "object", "properties": {"tool": {"type": "string"}, "inputs": {"type": "object"}, "figures_used": {"type": "object"}, "results": {"type": "array", "items": {"type": "object", "properties": {"key": {"type": "string"}, "label": {"$ref": "#/components/schemas/LangPair"}, "value": {"description": "rounded result"}, "raw_value": {"description": "unrounded result"}, "unit": {"type": "array", "nullable": true}}}}, "warnings": {"type": "array", "items": {"$ref": "#/components/schemas/LangPair"}}}}, "meta": {"$ref": "#/components/schemas/Meta"}}}, "StatusResponse": {"type": "object", "properties": {"ok": {"type": "boolean"}, "data": {"type": "object", "properties": {"status": {"type": "string"}, "version": {"type": "string"}, "catalog": {"type": "object", "properties": {"figures": {"type": "integer"}, "pages": {"type": "integer"}, "tools": {"type": "integer"}}}}}, "meta": {"$ref": "#/components/schemas/Meta"}}}, "PlansResponse": {"type": "object", "properties": {"ok": {"type": "boolean"}, "data": {"type": "object", "properties": {"plans": {"type": "array", "items": {"type": "object"}}}}, "meta": {"$ref": "#/components/schemas/Meta"}}}}}}