curl --request GET \
--url https://api.staging.loci.ng/v1/frames \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.staging.loci.ng/v1/frames"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.staging.loci.ng/v1/frames', 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.staging.loci.ng/v1/frames",
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.staging.loci.ng/v1/frames"
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.staging.loci.ng/v1/frames")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.staging.loci.ng/v1/frames")
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": {
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"id": "2163725",
"geometry": {
"type": "Polygon",
"coordinates": [
[
[
7.4904,
9.05143
],
[
7.4805,
9.05143
],
[
7.4805,
9.06201
],
[
7.4904,
9.06201
],
[
7.4904,
9.05143
]
]
]
}
},
{
"type": "Feature",
"id": "2163731",
"geometry": {
"type": "Polygon",
"coordinates": [
[
[
7.4904,
9.04434
],
[
7.48158,
9.04434
],
[
7.48158,
9.05143
],
[
7.4904,
9.05143
],
[
7.4904,
9.04434
]
]
]
}
},
{
"type": "Feature",
"id": "2163732",
"geometry": {
"type": "Polygon",
"coordinates": [
[
[
7.49509,
9.04434
],
[
7.4904,
9.04434
],
[
7.4904,
9.05143
],
[
7.49509,
9.05143
],
[
7.49509,
9.04434
]
]
]
}
}
],
"truncated": true
}
}The frames around a location
Every frame that touches a bounding box, as a GeoJSON FeatureCollection carrying each frame’s id and shape.
To get the frames around a point, build a box around it. The grid is roughly 0.01° across, so a box of ±0.01° around a location returns the frame it is in and its neighbours; ±0.05° returns a neighbourhood. The box is minLon,minLat,maxLon,maxLat in degrees, GeoJSON axis order.
At most 5,000 frames come back in one response, or fewer with limit. When the box held more than that, the response says so with "truncated": true rather than failing: narrow the box.
Alternatively, pass ids instead of bbox to fetch up to 100 named frames in full, bounding boxes included. That form answers with an array of frames rather than a collection.
Needs frame.read.
curl --request GET \
--url https://api.staging.loci.ng/v1/frames \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.staging.loci.ng/v1/frames"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.staging.loci.ng/v1/frames', 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.staging.loci.ng/v1/frames",
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.staging.loci.ng/v1/frames"
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.staging.loci.ng/v1/frames")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.staging.loci.ng/v1/frames")
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": {
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"id": "2163725",
"geometry": {
"type": "Polygon",
"coordinates": [
[
[
7.4904,
9.05143
],
[
7.4805,
9.05143
],
[
7.4805,
9.06201
],
[
7.4904,
9.06201
],
[
7.4904,
9.05143
]
]
]
}
},
{
"type": "Feature",
"id": "2163731",
"geometry": {
"type": "Polygon",
"coordinates": [
[
[
7.4904,
9.04434
],
[
7.48158,
9.04434
],
[
7.48158,
9.05143
],
[
7.4904,
9.05143
],
[
7.4904,
9.04434
]
]
]
}
},
{
"type": "Feature",
"id": "2163732",
"geometry": {
"type": "Polygon",
"coordinates": [
[
[
7.49509,
9.04434
],
[
7.4904,
9.04434
],
[
7.4904,
9.05143
],
[
7.49509,
9.05143
],
[
7.49509,
9.04434
]
]
]
}
}
],
"truncated": true
}
}Authorizations
An API key minted in the Developers tab of the LOCI app, sent as Authorization: Bearer loci_sk_…. Acts for one organisation, is read-only, and expires.
Query Parameters
minLon,minLat,maxLon,maxLat in degrees. Required unless ids is given.
At most this many frames, up to 5,000, which is also the default.
1 <= x <= 5000Instead of bbox: comma-separated frame ids, at most 100. Returns full frames with bounding boxes.
Response
The frames in the box as a FeatureCollection, or, with ids, an array of frames. Empty when nothing matches.
- object
- object[]
Show child attributes
Show child attributes