Regions & categories
Two read-only endpoints expose the integer ids used by filters.regions[] and filters.categories[] on forecasts and drivers. Use them to build pickers in your UI or to validate ids on your side before submitting.
| Endpoint | Returns |
|---|---|
GET /api/v1/regions | All regions, sorted by integer id ascending. |
GET /api/v1/categories | All categories, sorted by integer id ascending. |
Both are discovery only — the forecast and drivers endpoints do not cross-check ids against these listings. They only enforce the 1–9999 integer range.
Regions
bash
curl -sS -H "Authorization: Bearer $SYBILION_API_TOKEN" \
https://api.sybilion.dev/api/v1/regions \
| jq '{count: (.items | length), first: .items[0]}'python
import os
from sybilion import Client
client = Client(token=os.environ["SYBILION_API_TOKEN"])
regions = client.raw.api_v1_regions_get()
print(len(regions.items), "regions; first:", regions.items[0])go
package main
import (
"context"
"fmt"
"log"
"os"
"go.sybilion.dev/sybilion"
)
func main() {
c := sybilion.New(sybilion.Options{
Token: os.Getenv("SYBILION_API_TOKEN"),
})
resp, _, err := c.DefaultAPI().ApiV1RegionsGet(context.Background()).Execute()
if err != nil {
log.Fatal(err)
}
fmt.Println(len(resp.Items), "regions")
}Categories
bash
curl -sS -H "Authorization: Bearer $SYBILION_API_TOKEN" \
https://api.sybilion.dev/api/v1/categories \
| jq '{count: (.items | length), first: .items[0]}'python
categories = client.raw.api_v1_categories_get()
print(len(categories.items), "categories; first:", categories.items[0])go
resp, _, err := c.DefaultAPI().ApiV1CategoriesGet(context.Background()).Execute()
if err != nil {
log.Fatal(err)
}
fmt.Println(len(resp.Items), "categories")Response shape
Both endpoints return the same JSON envelope:
json
{
"items": [
{
"id": 42,
"name": "Example",
"code": 100,
"parent_id": null,
"path": "/…",
"latitude": 0.0,
"longitude": 0.0
}
]
}itemsis the complete listing — there is no pagination.- Every entry includes integer
id. Other fields (names, codes, hierarchy) depend on the dimension.
Cache the result on your side if you call frequently — payload size grows with the dataset.
Availability
If the dimensions backend is not enabled for your account, both endpoints return 503 with {"error": "…"}. Contact [email protected] if you need this feature.
See also
- API reference: GET /api/v1/regions · GET /api/v1/categories
- Forecasts and drivers consume these ids via
filters: Forecasts · Drivers - Clients: Using curl · Python SDK · Go SDK.