API Access
Production API reference for datasets, recommendations, and AI-assisted query/discovery workflows.
Endpoint Index
Quick list of currently available endpoints.
| Endpoint | Method | Purpose |
|---|---|---|
/api/zones | GET | Zone master data. |
/api/footfall | GET | Footfall records by zone and hour. |
/api/mobility_od | GET | Origin-destination mobility flows. |
/api/audience_profile | GET | Audience and SES indicators. |
/api/device_digital_profile | GET | Device and digital readiness metrics. |
/api/weekend_patterns | GET | Weekend vs weekday behavior. |
/api/inflow_diversity | GET | Catchment diversity signals. |
/api/affinity_segments | GET | Affinity segment distributions. |
/api/query | POST | Natural language query interpretation. |
/api/chat | POST | Conversational analysis assistant. |
/api/discover | POST | Insight discovery with chart recommendations. |
/api/recommendation | GET | Top recommended zones and rationale. |
/api/kpis | GET | Executive KPI snapshot for reports. |
Detailed API Spec
Parameters, payload schemas, and sample requests/responses.
GET /api/zones
Returns the zone master list used across all analytics modules.
Response fields:
zone_id(string): Zone identifier.zone_name(string): Human-readable zone name.city(string): City classification.
curl -X GET "http://127.0.0.1:5000/api/zones"
[
{
"zone_id": "Z001",
"zone_name": "Blok M",
"city": "Jakarta Selatan"
}
]
GET /api/footfall
Returns hourly footfall records by zone.
Response fields:
zone_id(string)hour(number, 0-23)estimated_people(number)avg_dwell_minutes(number, optional)repeat_visitor_pct(number, optional)
curl -X GET "http://127.0.0.1:5000/api/footfall"
GET /api/mobility_od
Returns origin-destination trip flow records.
Response fields:
origin_zone_id(string)destination_zone_id(string)trip_count(number)peak_hour(number or string, optional)commute_flag(boolean, optional)
curl -X GET "http://127.0.0.1:5000/api/mobility_od"
GET /api/audience_profile
Returns zone-level audience and SES attributes.
Response fields:
zone_id(string)ses_low_pct,ses_mid_pct,ses_high_pct(number)worker_pct,resident_pct,visitor_pct(number)mobility_radius_km(number, optional)
curl -X GET "http://127.0.0.1:5000/api/audience_profile"
GET /api/device_digital_profile, /api/weekend_patterns, /api/inflow_diversity, /api/affinity_segments, /api/poi_clusters
Returns additional telco-derived profile layers used in reports and discovery.
curl -X GET "http://127.0.0.1:5000/api/device_digital_profile"
POST /api/query
Parses natural-language query into structured dashboard intent.
Request body:
{
"q": "Which zones are attractive for banking branch expansion?"
}
Sample request:
curl -X POST "http://127.0.0.1:5000/api/query" \
-H "Content-Type: application/json" \
-d '{"q":"Which zones are attractive for banking branch expansion?"}'
Response:
{
"intent": "site_selection",
"filters": {
"industry": "banking_insurance",
"time_window": "evening"
}
}
POST /api/chat
Conversational assistant for guided analytics exploration.
Request body:
{
"message": "How does mobility consistency help fraud detection?",
"history": [
{"role": "user", "content": "What signals support location verification for KYC?"}
]
}
Response:
{
"reply": "Mobility consistency checks compare claimed location and observed movement patterns..."
}
Error modes:
400whenmessageis empty.200witherrorpayload if API key is not configured.
POST /api/discover
Maps a business question to recommended data products and chart types.
Request body:
{
"message": "Where should we expand our branch network to reach affluent customers?"
}
Response:
{
"reply": "Use audience SES and evening footfall to shortlist high-value branch zones.",
"chart_types": ["audience_ses", "footfall"]
}
Allowed chart_types:
footfall,mobility_od,audience_ses,device_digitalweekend_patterns,catchment_diversity,affinity_segments,poi_commercial
GET /api/recommendation
Returns top ranked zones for recommendation workflows.
Query params:
geography(string, default:South Jakarta)time_window(string, default:evening)top_n(number, default:3)
curl -X GET "http://127.0.0.1:5000/api/recommendation?geography=South%20Jakarta&time_window=evening&top_n=3"
GET /api/zone_scores
Returns computed zone scoring outputs for ranking and map overlays.
Query params:
time_window(string, default:evening)
curl -X GET "http://127.0.0.1:5000/api/zone_scores?time_window=evening"
GET /api/kpis
Returns executive KPI aggregate snapshot for reports header cards.
Response fields:
total_daily_footfallnighttime_footfalltotal_od_tripstop_hotspot_zonestrongest_commuter_corridordominant_ses_segmentavg_digital_readinesstop_weekend_zone
curl -X GET "http://127.0.0.1:5000/api/kpis"