District boundaries
සංවර්ධක API
සිවිල් දත්ත, නැවුම් බව සහ දිස්ත්රික් පැතිකඩ සඳහා පොදු කියවීම-only endpoints — සියල්ල ලංකාවෙන්.
ආරම්භ කිරීම
සියලු endpoints same-origin JSON APIs වේ. කියවීමට API key අවශ්ය නොවේ. ප්රතිචාරවල නැවුම් බව tier සහ අභ්යන්තර ප්රවේණි paths ඇත.
Base URL: /api/v1
Data export
Download curated datasets from the Lankawa API.
Election results
Public services
Fuel history
Land change indices
Foreign debt composition
Embeddable widgets
Same-origin iframe widgets for today, pulse, fuel, and FX.
Open embed previewWidget SDK snippet
Beyond iframes — drop-in script scaffold that mounts a same-origin embed. Prefer iframe for production until the npm package ships.
<div id="lankawa-widget" data-widget="brief"></div> <script src="https://lankawa.vercel.app/embed/widget.js" defer></script>
Signed change webhooks
Partners can verify changelog deliveries with HMAC-SHA256. Sign the raw JSON body; send header X-Lankawa-Signature: sha256=<hex>. Helper: signWebhookBody / verifyWebhookSignature in src/lib/webhook-hmac.ts. Set LANKAWA_WEBHOOK_SECRET when a delivery endpoint is enabled.
X-Lankawa-Signature: sha256=<hmac-sha256-hex-of-body>Endpoints
/api/v1/healthමූලාශ්ර සෞඛ්ය
සියලු ලියාපදිංචි දත්ත මූලාශ්ර සඳහා නැවුම් බව tier සහ අවසන් පරීක්ෂා timestamps.
{ "generatedAt": "2026-07-19T06:00:00.000Z", "sources": [...] }/api/v1/pulseසජීවී නාඩි
වත්මන් විනිමය අනුපාත, ඉන්ධන මිල, ගංවතුර මධ්යස්ථාන ගණන් සහ සබැඳි මිනුම්.
{ "generatedAt": "...", "metrics": [...], "flood": [...], "sources": [...] }/api/v1/districtsදිස්ත්රික් ලැයිස්තුව
ජනගහනය, ප්රදේශය සහ පළාත metadata සහිත ශ්රී ලංකාවේ දිස්ත්රික් 25.
{ "districts": [{ "slug": "colombo", "name": "Colombo", ... }] }/api/v1/districts/{slug}දිස්ත්රික් විස්තර
slug මගින් තනි දිස්ත්රික් පැතිකඩ.
{ "slug": "colombo", "name": "Colombo", "population": 2427285, ... }/api/v1/provincesProvince list
All 9 Sri Lankan provinces with slug and trilingual names.
{ "count": 9, "provinces": [{ "slug": "western", "name": "Western", ... }] }/api/v1/provinces/{slug}Province detail
Single province profile with aggregated population, area, and district list.
{ "slug": "western", "districtCount": 3, "population": 5846400, ... }/api/v1/electionsPresidential election 2024
National summary and district-level first-preference results with provenance paths.
{ "election": { "id": "presidential-2024", ... }, "districts": [...] }/api/v1/elections/parliamentaryParliamentary election 2024
National seat summary and all electoral district results.
{ "election": { "id": "parliamentary-2024", ... }, "districts": [...] }/api/v1/elections/parliamentary/{slug}Parliamentary electoral district
Seat allocation for a single electoral district.
{ "slug": "colombo", "totalSeats": 18, "seats": { "npp": 14, ... } }/api/v1/services?district=colombo&type=hospitalPublic services
Filter hospitals, schools, and GN offices by district, type, or search query.
{ "count": 2, "facilities": [{ "id": "colombo-national-hospital", ... }] }/api/v1/services/{id}Service facility detail
Single public service facility by ID.
{ "id": "colombo-national-hospital", "type": "hospital", ... }/api/v1/flood/history?station=Peradeniya&limit=24Flood station history
Historical water levels for a river monitoring station with freshness tier.
{ "points": [{ "timestamp": "...", "waterLevel": 1.39 }], "tier": "fresh" }/api/v1/fuel/history?days=90Fuel price history
Octane partner API හරහා CPC petrol 92 සහ auto diesel මිල series.
{ "days": 90, "series": [{ "fuelType": "petrol_92", "points": [...] }] }/api/v1/fuel/revisions?limit=8Fuel revision steps
CPC petrol 92 and auto diesel official revision events with price deltas from Octane.
{ "limit": 8, "steps": [{ "fuelType": "petrol_92", "deltaLkr": -20 }] }/api/v1/budgetජාතික අයවැය
FY 2024/25 සහ 2025/26 revanue, expenditure සහ sector allocations (seed).
{ "fiscalYears": [{ "id": "fy2025-26", "revenue": 4580, ... }] }/api/v1/health/dengueසaptama දengue සංඛyāna
Epidemiology Unit seed dataset හරහා දිස්ත්රික්-level දengue rog counts.
{ "nationalTotal": 3842, "districts": [{ "slug": "colombo", "cases": 612 }] }/api/v1/propertyProperty price bands
District-level median land price bands with low/high ranges.
{ "districts": [{ "slug": "colombo", "medianPerPerch": 9500000, ... }] }/api/v1/elections/historyElection history
Multi-cycle presidential summaries and parliamentary seat history.
{ "presidential": { "cycles": [{ "year": 2024, ... }] }, "parliamentary": { ... } }/api/v1/local-government?district=colombo&type=MCLocal government directory
Filter MC, UC, and PS bodies by district, type, or search query.
{ "totalCount": 327, "count": 1, "bodies": [{ "id": "...", "type": "MC" }] }/api/v1/transport?district=colomboTransport directory
Bus routes, railway stations, and airports filterable by district.
{ "busRoutes": [...], "railwayStations": [...], "airports": [...] }/api/v1/cost-of-livingCost of living index
District composite index from fuel, property, and food basket seeds.
{ "nationalIndex": 72, "districts": [{ "slug": "colombo", "index": 98 }] }/api/v1/vehiclesVehicle market snapshot
District median used-vehicle prices, popular makes, and listing counts.
{ "totalListings": 112609, "districts": [{ "slug": "colombo", "medianPriceLkr": 9314924 }] }/api/v1/foodFood price snapshot
Staple prices, essentials basket, and district meal-cost bands.
{ "essentialsBasketLkr": 8650, "stapleItems": [{ "name": "Rice", "priceLkr": 320 }] }/api/v1/lifeLife platform overview
Unified living-cost domain health from the Ariva Life Platform orchestrator.
{ "headline": "...", "domains": [{ "key": "food", "status": "degraded" }] }/api/v1/export/districtsExport districts GeoJSON
Download simplified district boundaries, including CSV.
GeoJSON FeatureCollection download; add ?format=csv for CSV
/api/v1/export/electionsExport elections
Download presidential and parliamentary 2024 seed datasets as JSON or CSV.
{ "presidential": {...}, "parliamentary": {...} }; add ?format=csv for CSV/api/v1/export/servicesExport services
Download the full public services directory seed as JSON or CSV.
{ "facilities": [...], "sourceId": "public_services_seed" }; add ?format=csv for CSV/api/v1/export/fuel-history?format=csvExport fuel history
Download petrol and diesel price history as JSON or CSV.
fuelType,label,recordedAt,priceLkr,...
/api/v1/environment/land-changeLand Change Pulse
District greenery and built-up indices (2018→2024) with national deltas and top movers.
{ "national": { "greeneryDelta": -4 }, "districts": [...], "provenancePath": "/sources/lankawa_land_pulse" }/api/v1/economy/debtForeign debt composition
Commercial vs concessionary external debt share series (2004–2020), normalized for Lankawa.
{ "latest": { "year": 2020, "commercialPct": 53.8 }, "series": [...], "provenancePath": "/sources/lankawa_debt_pulse" }/api/v1/economy/ncpiNCPI inflation
Latest NCPI headline YoY/MoM, core, food/non-food splits, and recent monthly series from DCS.
{ "periodLabel": "March 2026", "latest": { "yoyPct": 2.4, "momPct": 0.7 }, "provenancePath": "/sources/dcs_ncpi" }/api/v1/economy/tariffsPUCSL domestic tariffs
Residential electricity energy and fixed charges by consumption block with effective date.
{ "effectiveFrom": "2025-06-12", "tracks": [{ "id": "above_60", "slabs": [...] }], "provenancePath": "/sources/pucsl_tariff" }/api/v1/economy/water-bill?units=20NWSDB water bill estimate
Domestic/Samurdhi water tariff slabs with seed estimate and optional live BillCalculator totals.
{ "seedEstimate": { "totalLkr": 2537 }, "liveAvailable": true, "provenancePath": "/sources/nwsdb_tariff" }/api/v1/cse/quotes?symbols=JKH.N0000,COMB.N0000CSE per-symbol quotes
Company quotes from cse.lk companyInfoSummery for a comma-separated symbol list, with seed fallback.
{ "generatedAt": "...", "quotes": [{ "symbol": "JKH.N0000", "price": 22.1 }], "provenancePath": "/sources/cse_lk" }/api/v1/export/land-change?format=csvExport land change
Download district greenery and built-up indices as JSON or CSV.
slug,greenery2018,greenery2024,greeneryDelta,...
/api/v1/export/foreign-debt?format=csvExport foreign debt composition
Download commercial vs concessionary debt share series as JSON or CSV.
year,commercialPct,concessionaryPct,...
/api/v1/disaster/landslideLandslide early warning
District watch/warning from lk_dmc tip layout parse, with seed honesty when unavailable.
{ "watchCount": 5, "warningCount": 0, "districts": [...], "isSeed": true }/api/v1/changesProduct changelog
Curated Lankawa surface changelog entries.
{ "count": 4, "entries": [{ "date": "2026-07-19", "title": "..." }] }/api/v1/subscribeMorning brief subscribe
Double opt-in email subscription for the cached morning brief.
{ "ok": true, "message": "Check your email to confirm the morning brief." }/api/v1/openapi.jsonOpenAPI specification
පොදු API සඳහා machine-readable OpenAPI 3.1 document.
{ "openapi": "3.1.0", "info": { ... }, "paths": { ... } }/api/v1/statusවේදිකා තත්ත්වය
Database connectivity, source freshness counts, API version, සහ ingest schedule.
{ "version": "0.6.0", "database": { "configured": true, "connected": true }, "sources": { "fresh": 3 } }/api/v1/pulse/historyPulse history
Stored pulse snapshots for the last 30 days (database අවශ්ය).
{ "days": 30, "count": 42, "snapshots": [...] }/api/v1/assistantCivic assistant
POST a question; receive an answer grounded on Lankawa API data with citations.
{ "question": "USD rate?", "answer": "...", "citations": [...], "mode": "rule" }දත්ත ප්රවේණිය
සෑම මිනුමක්ම source ID සහ අභ්යන්තර ප්රවේණි path එකක් reference කරයි. ක්රමවේදය සහ නැවුම් බව තේරුම් ගැනීමට මූලාශ්ර registry භාවිතා කරන්න.
දත්ත මූලාශ්ර browse කරන්නOpenAPI document
ලංකාව තුළ render කළ සම්පූර්ණ OpenAPI specification බලන්න, හෝ API වෙතින් raw JSON fetch කරන්න.
OpenAPI JSON බලන්න