Biklo for developersTESTsandbox-api.biklo.comchange

Sub-county areas

GET/v1/geo/subdivisions

scope catalog.read

Sectors, districts and municipalities inside a county — what couriers often need for large cities.

Query parameters#

NameExample
county_id1Required unless q is given
q—Name prefix
level—Subdivision depth
limit50Max 100
cursor—next_cursor

Response#

FieldTypeDescription
countintegerHow many subdivisions in this page.
next_cursorstring|nullPass back as ?cursor= for the next page; null on the last.
dataarrayA further administrative level below the county — a sector, borough or district — for countries that have one. An empty array is the normal answer for a country that does not, and is not an error.
data[].idintegerThe subdivision id. Informational: an address is keyed on city_id, never on this.
data[].county_idinteger|nullThe county it belongs to, or null where it is not attached to one.
data[].namestringName in local script.
data[].latin_namestringLatin transliteration, for display where the local script will not render.
data[].levelinteger|nullHow deep below the county it sits, for countries that nest these more than one level.
data[].parent_idinteger|nullThe subdivision above it, or null at the top level.

Example

{
    "count": 1,
    "next_cursor": null,
    "data": [
        {
            "id": 12,
            "county_id": 39,
            "name": "Sectorul 3",
            "latin_name": "Sectorul 3",
            "level": 1,
            "parent_id": null
        }
    ]
}

Failures use the shared error envelope — a machine-readable code and a request_id to quote to support. Error handling.

curl -X GET "https://sandbox-api.biklo.com/v1/geo/subdivisions?county_id=1" \
  -H "Authorization: Bearer bk_test_YOUR_KEY"
<?php

$ch = curl_init('https://sandbox-api.biklo.com/v1/geo/subdivisions?county_id=1');

curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_CUSTOMREQUEST  => 'GET',
    CURLOPT_HTTPHEADER     => [
        'Authorization: Bearer bk_test_YOUR_KEY',
    ],
]);

$response = json_decode(curl_exec($ch), true);
curl_close($ch);
using System.Net.Http;
using System.Net.Http.Headers;

var client = new HttpClient();
client.DefaultRequestHeaders.Authorization =
    new AuthenticationHeaderValue("Bearer", "bk_test_YOUR_KEY");

var request = new HttpRequestMessage(
    new HttpMethod("GET"),
    "https://sandbox-api.biklo.com/v1/geo/subdivisions?county_id=1");

var response = await client.SendAsync(request);
var json = await response.Content.ReadAsStringAsync();
import requests

response = requests.get(
    "https://sandbox-api.biklo.com/v1/geo/subdivisions?county_id=1",
    headers={"Authorization": "Bearer bk_test_YOUR_KEY"},
)

data = response.json()
const response = await fetch("https://sandbox-api.biklo.com/v1/geo/subdivisions?county_id=1", {
  method: "GET",
  headers: {
    Authorization: "Bearer bk_test_YOUR_KEY"
  }
});

const data = await response.json();
import java.net.http.*;
import java.net.URI;

var client = HttpClient.newHttpClient();

var request = HttpRequest.newBuilder()
    .uri(URI.create("https://sandbox-api.biklo.com/v1/geo/subdivisions?county_id=1"))
    .header("Authorization", "Bearer bk_test_YOUR_KEY")
    .method("GET", HttpRequest.BodyPublishers.noBody())
    .build();

var response = client.send(request, HttpResponse.BodyHandlers.ofString());