GeoCzech API
Quickstart
Convert your first file with the API in about five minutes — no own data needed.
In this guide you will create an API key, convert a sample Shapefile into GeoJSON and download the result. Every step has a ready-made example; pick your language in the switcher (cURL works in any terminal).
1. Get an API key
- Sign in to the GeoCzech Console.
- Open Developers → API keys and click Create API key.
- Give the key a name (for example My first script) and copy it. It looks like
gcz_live_….
In every example, replace YOUR_API_KEY with your key.
API access
API keys are available in the Standard and Premium plans. Geodata and Coordinates calls are free; Converter jobs use a few credits — see Credits & pricing.
2. Choose how to run the examples
- cURL — already installed on macOS, Linux and Windows 10/11. On Windows use
Git Bash or WSL, because the examples use Unix-style line breaks (
\) and quotes. - Python 3 — install the
requestspackage:pip install requests. - JavaScript — Node.js 20 or newer; save the code as
example.mjsand runnode example.mjs. - PHP — PHP 8 with the
curlextension; runphp example.php. - C# — .NET 7 or newer; paste the code into
Program.csof a console app (dotnet new console) and rundotnet run.
3. Convert a sample file
The request on the right sends a link to our sample Shapefile with places on the island of Saint Helena and asks for GeoJSON.
file_urls— where the API downloads the input from. You can also upload a file from your computer instead — see Requests & tasks.params— the settings of the tool, as JSON. Here: the output format.wait=true— keep the connection open until the result is ready (up to 60 s).
The conversion takes about two seconds. Because the source data is in a projected
system (UTM zone 30S, coordinates in metres) and GeoJSON always uses WGS 84, the
Converter recalculated the coordinates automatically — it tells you so in decisions.
curl -X POST "https://api.geoczech.dev/v2/tool/converter" \
-H "X-API-Key: YOUR_API_KEY" \
-F "file_urls=https://cdn.geoczech.dev/docs-samples/v1/st-helena-places-utm.zip" \
--form-string 'params={"output": {"format": "geojson"}}' \
-F "wait=true"
import json
import requests
API_KEY = "YOUR_API_KEY"
response = requests.post(
"https://api.geoczech.dev/v2/tool/converter",
headers={"X-API-Key": API_KEY},
files={
"file_urls": (None, "https://cdn.geoczech.dev/docs-samples/v1/st-helena-places-utm.zip"),
"params": (None, json.dumps({
"output": {"format": "geojson"},
})),
"wait": (None, "true"),
},
timeout=120,
)
response.raise_for_status()
print(response.json())
const API_KEY = "YOUR_API_KEY";
const form = new FormData();
form.append("file_urls", "https://cdn.geoczech.dev/docs-samples/v1/st-helena-places-utm.zip");
form.append("params", JSON.stringify({
"output": {"format": "geojson"}
}));
form.append("wait", "true");
const response = await fetch("https://api.geoczech.dev/v2/tool/converter", {
method: "POST",
headers: { "X-API-Key": API_KEY },
body: form,
});
if (!response.ok) throw new Error(`HTTP ${response.status}: ${await response.text()}`);
console.log(await response.json());
<?php
$apiKey = "YOUR_API_KEY";
$curl = curl_init("https://api.geoczech.dev/v2/tool/converter");
curl_setopt_array($curl, [
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => ["X-API-Key: $apiKey"],
CURLOPT_POSTFIELDS => [
"file_urls" => "https://cdn.geoczech.dev/docs-samples/v1/st-helena-places-utm.zip",
"params" => json_encode([
"output" => ["format" => "geojson"],
]),
"wait" => "true",
],
CURLOPT_RETURNTRANSFER => true,
CURLOPT_TIMEOUT => 120,
]);
$response = curl_exec($curl);
print_r(json_decode($response, true));
using var client = new HttpClient { Timeout = TimeSpan.FromSeconds(120) };
client.DefaultRequestHeaders.Add("X-API-Key", "YOUR_API_KEY");
using var form = new MultipartFormDataContent();
form.Add(new StringContent("https://cdn.geoczech.dev/docs-samples/v1/st-helena-places-utm.zip"), "file_urls");
form.Add(new StringContent("""{"output": {"format": "geojson"}}"""), "params");
form.Add(new StringContent("true"), "wait");
var response = await client.PostAsync("https://api.geoczech.dev/v2/tool/converter", form);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
{
"task_id": "0dd2eebc-163d-41e5-870e-20fb9c15980e",
"status": "SUCCESS",
"message": "Success",
"duration_sec": 1.535,
"output_files": [
"https://…/output/result.json?…",
"https://…/output/st-helena-places-utm.geojson?…"
],
"json_data": {
"status": "ok",
"outputs": [{
"format": "geojson",
"crs": "EPSG:4326",
"layers": [{"name": "st-helena-places-utm", "featureCount": 58}],
"files": [{"name": "st-helena-places-utm.geojson", "sizeBytes": 12279, "role": "data"}]
}],
"decisions": [{
"code": "crs_forced_by_format",
"message": "Format 'geojson' mandates EPSG:4326; output is reprojected automatically."
}]
}
}
4. Download the result
output_files contains download links:
result.json— the full report (the same asjson_data).st-helena-places-utm.geojson— your converted file.
Open the link in a browser, or download it in code. The links are valid for 1 hour; ask for the task status to get fresh links. Files are kept for 7 days by default.
# Paste the link from output_files (keep the quotes — the link contains & characters)
curl -L -o st-helena-places-utm.geojson "PASTE_THE_DOWNLOAD_LINK_HERE"
import requests
# `result` is the JSON response from step 3
for url in result["output_files"]:
name = url.split("?")[0].rsplit("/", 1)[-1]
with open(name, "wb") as fh:
fh.write(requests.get(url, timeout=120).content)
print("saved", name)
import { writeFile } from "node:fs/promises";
// `result` is the JSON response from step 3
for (const url of result.output_files) {
const name = decodeURIComponent(new URL(url).pathname.split("/").pop());
const response = await fetch(url);
await writeFile(name, Buffer.from(await response.arrayBuffer()));
console.log("saved", name);
}
<?php
// $result is the decoded JSON response from step 3
foreach ($result["output_files"] as $url) {
$name = urldecode(basename(parse_url($url, PHP_URL_PATH)));
file_put_contents($name, file_get_contents($url));
echo "saved $name\n";
}
// `outputFiles` = the output_files array from the step 3 response
using var client = new HttpClient();
foreach (var url in outputFiles)
{
var name = Uri.UnescapeDataString(new Uri(url).Segments.Last());
await File.WriteAllBytesAsync(name, await client.GetByteArrayAsync(url));
Console.WriteLine($"saved {name}");
}
Next steps
- Learn how tasks, inputs and webhooks work in Requests & tasks.
- See everything the Converter can do — reprojection, filters, clipping, 100+ formats.
- Inspect unknown files with Geodata, or work with coordinates in Coordinates.
- Show your data as a map layer with MapServer.
Last updated 2026-11-17