curl --request GET \
--url https://api.loci.ng/v1/location/profile \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.loci.ng/v1/location/profile"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.loci.ng/v1/location/profile', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.loci.ng/v1/location/profile",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.loci.ng/v1/location/profile"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.loci.ng/v1/location/profile")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.loci.ng/v1/location/profile")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": {
"location": {
"lon": 7.4951,
"lat": 9.0579
},
"datasets": [
{
"layerId": "lyr_8142687a47796c6e",
"name": "Administrative baseline",
"category": "Administrative",
"kind": "frames",
"orgId": "org-milsat",
"values": {
"adm_lga": "ABUJA MUNICIPAL AREA COUNCIL",
"adm_lga_code": "436",
"adm_state": "FCT",
"adm_state_code": "14",
"adm_ward": "GARKI",
"adm_ward_code": "9470",
"adm_zone": "NORTH CENTRAL",
"adm_zone_code": "3"
}
},
{
"layerId": "lyr_07311eb9fddfe966",
"name": "Built environment baseline",
"category": "Built environment",
"kind": "frames",
"orgId": "org-milsat",
"values": {
"bld_ct": "608",
"bld_dens": "1237.337222089773"
}
},
{
"layerId": "lyr_96ed00bcae6ecbe5",
"name": "Cultural baseline",
"category": "Cultural",
"kind": "frames",
"orgId": "org-milsat",
"values": {
"cul_ctethnfrm": "1",
"cul_ctethnsta": "5",
"cul_ctlangfrm": "1",
"cul_ctlangsta": "8",
"cul_ethnfrm": "Gwandara",
"cul_ethnsta": "Gbari, Gwandara, Igbira, Koro, Nupe",
"cul_langfrm": "Gwandara",
"cul_langsta": "Ashe, Begbere-Ejar, Dibo, Gade, Gbagyi, Gbari, Gwandara, Ija-Zuba",
"cul_rururb": "Urban"
}
},
{
"layerId": "lyr_ee58d5508da410ea",
"name": "Physical baseline",
"category": "Physical",
"kind": "frames",
"orgId": "org-milsat",
"values": {
"phy_elevmean": "522.0260260260264",
"phy_landcov": "6",
"phy_sbsiltxtcls": "6",
"phy_slopemean": "6.229817091881695",
"phy_tpsiltxtcls": "9"
}
},
{
"layerId": "lyr_1b81b870d62fe092",
"name": "Population baseline",
"category": "Population",
"kind": "frames",
"orgId": "org-milsat",
"values": {
"pop_demest25": "5699",
"pop_demest26": "5805"
}
},
{
"layerId": "lyr_1c0ea62e30f89f79",
"name": "Urbanisation baseline",
"category": "Urbanisation",
"kind": "frames",
"orgId": "org-milsat",
"values": {
"urb_class": "Peri-urban",
"urb_index": "1"
}
}
]
}
}Location profile
Everything the datasets your key can read record at a point, in one call: a longitude and latitude in, the profile of that place out, named by dataset.
This is the recorded data of GET /v1/frames/data addressed by coordinate instead of frame id, for when what you hold is a device’s position, a geocoded address or a tapped point on a map. The grid stays behind the curtain: the point is resolved to the cell that contains it to read what is recorded there, but the answer names no frame — only the point echoed back and the datasets. A caller who wants the frame itself, its id, shape and box, asks GET /v1/frames/at. Naming frames directly remains GET /v1/frames/data, unchanged; this call is an addition, not a replacement.
A baseline dataset, one keyed by frame, contributes its row at the point as values: the administrative identity, population, buildings, physical and cultural attributes Milsat records, and any baseline your organisation has added or licensed. A feature dataset, one of points, lines or polygons, contributes the features bound there as features, at most 200 per dataset — their properties carry the dataset’s attributes, without the _frame marker /v1/frames/data adds. Feature datasets appear only for a key holding feature.read; a narrower key sees baselines alone.
An organisation’s connected sources answer here too: databases it runs elsewhere — postal codes, sensor readings, availability, anything keyed to a place — queried live when the profile is asked, never copied in. Their datasets arrive with kind: "live", an asOf timestamp, values for a single row or rows for several, and stale: true when the source was unreachable and the last good answer stands in. A connected source that cannot answer in time is named in leftOut, and the rest of the answer still arrives.
A dataset that records nothing at the location is simply absent from the list. A point outside the grid is a 404: unlike a frame id, which answers empty, a coordinate always claims a place, and off the grid there is none.
A dataset licensed per query is charged once per request in which it contributed something, and its id is listed in charged. One the organisation’s credits cannot cover is left out and named in leftOut with the reason, so the rest of the answer still arrives.
One location per request. lng is accepted as a spelling of lon. Needs frame.read.
curl --request GET \
--url https://api.loci.ng/v1/location/profile \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.loci.ng/v1/location/profile"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.loci.ng/v1/location/profile', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.loci.ng/v1/location/profile",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.loci.ng/v1/location/profile"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.loci.ng/v1/location/profile")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.loci.ng/v1/location/profile")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": {
"location": {
"lon": 7.4951,
"lat": 9.0579
},
"datasets": [
{
"layerId": "lyr_8142687a47796c6e",
"name": "Administrative baseline",
"category": "Administrative",
"kind": "frames",
"orgId": "org-milsat",
"values": {
"adm_lga": "ABUJA MUNICIPAL AREA COUNCIL",
"adm_lga_code": "436",
"adm_state": "FCT",
"adm_state_code": "14",
"adm_ward": "GARKI",
"adm_ward_code": "9470",
"adm_zone": "NORTH CENTRAL",
"adm_zone_code": "3"
}
},
{
"layerId": "lyr_07311eb9fddfe966",
"name": "Built environment baseline",
"category": "Built environment",
"kind": "frames",
"orgId": "org-milsat",
"values": {
"bld_ct": "608",
"bld_dens": "1237.337222089773"
}
},
{
"layerId": "lyr_96ed00bcae6ecbe5",
"name": "Cultural baseline",
"category": "Cultural",
"kind": "frames",
"orgId": "org-milsat",
"values": {
"cul_ctethnfrm": "1",
"cul_ctethnsta": "5",
"cul_ctlangfrm": "1",
"cul_ctlangsta": "8",
"cul_ethnfrm": "Gwandara",
"cul_ethnsta": "Gbari, Gwandara, Igbira, Koro, Nupe",
"cul_langfrm": "Gwandara",
"cul_langsta": "Ashe, Begbere-Ejar, Dibo, Gade, Gbagyi, Gbari, Gwandara, Ija-Zuba",
"cul_rururb": "Urban"
}
},
{
"layerId": "lyr_ee58d5508da410ea",
"name": "Physical baseline",
"category": "Physical",
"kind": "frames",
"orgId": "org-milsat",
"values": {
"phy_elevmean": "522.0260260260264",
"phy_landcov": "6",
"phy_sbsiltxtcls": "6",
"phy_slopemean": "6.229817091881695",
"phy_tpsiltxtcls": "9"
}
},
{
"layerId": "lyr_1b81b870d62fe092",
"name": "Population baseline",
"category": "Population",
"kind": "frames",
"orgId": "org-milsat",
"values": {
"pop_demest25": "5699",
"pop_demest26": "5805"
}
},
{
"layerId": "lyr_1c0ea62e30f89f79",
"name": "Urbanisation baseline",
"category": "Urbanisation",
"kind": "frames",
"orgId": "org-milsat",
"values": {
"urb_class": "Peri-urban",
"urb_index": "1"
}
}
]
}
}Authorizations
Query Parameters
Was this page helpful?

