curl --request GET \
--url https://data.kushiro.app/api/v1/points/facetsimport requests
url = "https://data.kushiro.app/api/v1/points/facets"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://data.kushiro.app/api/v1/points/facets', 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://data.kushiro.app/api/v1/points/facets",
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://data.kushiro.app/api/v1/points/facets"
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://data.kushiro.app/api/v1/points/facets")
.asString();require 'uri'
require 'net/http'
url = URI("https://data.kushiro.app/api/v1/points/facets")
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{
"source": "kushiro_council_decisions",
"group_by": "bill_type",
"buckets": [
{
"value": "予算",
"count": 423
}
],
"total": 4523,
"truncated": false
}{
"error": "invalid query parameters",
"issues": [
{
"path": "source",
"message": "Invalid input: expected string, received undefined"
}
]
}{
"error": "internal server error"
}Aggregate facility/location data
Returns DB-side facet aggregation (GROUP BY + COUNT) over fact_point, for example “how many records per committee”. source and group_by are required. group_by must be category or an attribute key whitelisted for the source. Optional category, attr.<key>=<value>, name_contains, address_contains, and the bounding-box set pre-filter records before aggregation. Buckets are ordered by count descending and capped at limit; truncated flags when more buckets exist.
curl --request GET \
--url https://data.kushiro.app/api/v1/points/facetsimport requests
url = "https://data.kushiro.app/api/v1/points/facets"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://data.kushiro.app/api/v1/points/facets', 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://data.kushiro.app/api/v1/points/facets",
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://data.kushiro.app/api/v1/points/facets"
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://data.kushiro.app/api/v1/points/facets")
.asString();require 'uri'
require 'net/http'
url = URI("https://data.kushiro.app/api/v1/points/facets")
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{
"source": "kushiro_council_decisions",
"group_by": "bill_type",
"buckets": [
{
"value": "予算",
"count": 423
}
],
"total": 4523,
"truncated": false
}{
"error": "invalid query parameters",
"issues": [
{
"path": "source",
"message": "Invalid input: expected string, received undefined"
}
]
}{
"error": "internal server error"
}Query Parameters
Source ID to query.
1Aggregation axis: category or an attribute key whitelisted for the source.
1Pre-filter by exact point category.
1Pre-filter by name substring (same semantics as on /api/v1/points).
1Pre-filter by address substring (same semantics as on /api/v1/points).
1South edge latitude of the bounding box (supply all four bbox parameters).
-90 <= x <= 90North edge latitude of the bounding box.
-90 <= x <= 90West edge longitude of the bounding box.
-180 <= x <= 180East edge longitude of the bounding box.
-180 <= x <= 180Maximum number of buckets to return. Defaults to 100.
1 <= x <= 1000Response
Point facet aggregation result.