The states
curl --request GET \
--url https://api.loci.ng/v1/statesimport requests
url = "https://api.loci.ng/v1/states"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.loci.ng/v1/states', 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/states",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$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/states"
req, _ := http.NewRequest("GET", url, nil)
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/states")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.loci.ng/v1/states")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"data": {
"level": "state",
"units": [
{
"level": "state",
"name": "ABIA",
"code": "31",
"zone": "SOUTH EAST",
"frames": 6981,
"bbox": [
7.14158,
4.82227,
7.98629,
6.04485
]
},
{
"level": "state",
"name": "ADAMAWA",
"code": "7",
"zone": "NORTH EAST",
"frames": 49533,
"bbox": [
11.34152,
7.37867,
13.72762,
10.94946
]
},
{
"level": "state",
"name": "AKWA IBOM",
"code": "30",
"zone": "SOUTH SOUTH",
"frames": 10071,
"bbox": [
7.46147,
4.45754,
8.34618,
5.51828
]
}
]
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}Frames
The states
Every state the frames lie in, by name, with its code, geopolitical zone, frame count and extent. No key is needed: the hierarchy is reference data about the grid, not anyone’s dataset, and the response is cacheable for an hour. The same answer is on GET /v1/frames/admin for a key holder.
GET
/
v1
/
states
The states
curl --request GET \
--url https://api.loci.ng/v1/statesimport requests
url = "https://api.loci.ng/v1/states"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.loci.ng/v1/states', 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/states",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$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/states"
req, _ := http.NewRequest("GET", url, nil)
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/states")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.loci.ng/v1/states")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"data": {
"level": "state",
"units": [
{
"level": "state",
"name": "ABIA",
"code": "31",
"zone": "SOUTH EAST",
"frames": 6981,
"bbox": [
7.14158,
4.82227,
7.98629,
6.04485
]
},
{
"level": "state",
"name": "ADAMAWA",
"code": "7",
"zone": "NORTH EAST",
"frames": 49533,
"bbox": [
11.34152,
7.37867,
13.72762,
10.94946
]
},
{
"level": "state",
"name": "AKWA IBOM",
"code": "30",
"zone": "SOUTH SOUTH",
"frames": 10071,
"bbox": [
7.46147,
4.45754,
8.34618,
5.51828
]
}
]
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}Response
The units, by name.
Show child attributes
Show child attributes