GeoCzech logo GeoCzech Docs

GeoCzech API

Requests & tasks

How to send data to a tool, wait for the result or check it later, and download the outputs.

Endpoints

The whole API has three endpoints you need to know:

Method & path What it does
POST /v2/tool/{tool} Starts a task. {tool} is converter, geodata or coordinates.
GET /v2/status/{task_id} Returns the current state and the results of a task.
DELETE /v2/task/{task_id} Deletes the inputs and outputs of a finished task right away — see Deleting your data.

Requests to /v2/tool/… must be sent as multipart/form-data (a web form, like curl -F). JSON bodies are not accepted — JSON goes inside the form, in the params field.

MapServer is different: it is a map service called with plain GET URLs.

Form fields

These fields work the same for every tool. Tool-specific settings go into params — see the page of each tool.

Request fields

params JSON string default {}

Tool settings, for example {"method": "analyze"} or {"output": {"format": "geojson"}}. Simple settings can also be sent as separate form fields (-F method=search -F q=UTM) — the API merges them into params and converts true/false and numbers automatically.

files file

A file uploaded from your computer. Repeat the field to send more files. Uploads are limited to about 6 MB per request — for bigger files use file_urls.

file_urls string (URL)

A public http(s) link the API downloads the input from (no login, no cookies). Repeat the field for more files. Works with any size and is faster for big files. Links to cloud drives must be direct download links.

wait boolean default false

true = answer only when the task is finished (or after wait_timeout). false = answer immediately with a task_id.

wait_timeout integer (seconds) default 60

How long to wait with wait=true. Keep it at most 100 s; if the task is not finished by then you get "status": "PENDING" and continue with status checks.

callback_url string (URL)

A webhook: when the task finishes, the API sends its final status to this URL with an HTTP POST.

response_type string

json puts the main JSON result directly into the response as json_data (needed for the Coordinates tool). The Converter and Geodata reports are always included.

Allowed values: json

Advanced parameters (3)
retention_days integer (days) default 7

How long inputs and outputs are kept, 1–365 days (rounded up to 1, 3, 7, 14 or 28). After that the files are deleted. To delete them sooner, use DELETE /v2/task/{task_id}.

estimated_complexity string default small

heavy runs the task on a bigger worker with more memory and no 15-minute time limit. Use it for large datasets (hundreds of MB and more). Pricing is the same.

Allowed values: small · heavy

api_key string

Your API key, if you cannot send the X-API-Key header — see Authentication.

Giving the API your data

Upload (files) is the simplest way for small files on your computer. Link (file_urls) is better for bigger files, for data that already lives on a web server or cloud storage, and when you process many files — nothing has to go through your connection twice.

  • Archives (ZIP, 7z, RAR, TAR, GZ) are unpacked automatically, including nested archives. A zipped Shapefile is the recommended way to send a Shapefile (it needs its .shp, .shx, .dbf and ideally .prj together).
  • Formats that are ZIP files by nature — KMZ, .gdb.zip, .shz — are read as they are.
  • You can combine several inputs in one request.
Upload a file from your computer

Download st-helena-places.geojson first, or use any file of your own.

curl -X POST "https://api.geoczech.dev/v2/tool/geodata" \
  -H "X-API-Key: YOUR_API_KEY" \
  -F "files=@st-helena-places.geojson" \
  --form-string 'params={"method": "analyze"}' \
  -F "wait=true"

Synchronous or asynchronous?

With wait=true you get the finished result in one call — perfect for scripts and small files. Without it, the API answers immediately with a task_id and the task runs in the background; you then check its status. Use that for big files, for many files at once, and in web applications that must stay responsive.

State Meaning
PENDING Accepted, waiting for a worker.
PROCESSING Running.
SUCCESS Done — results are available. message says if there were warnings.
FAILED Something went wrong — see error, error_code and Errors.
Start a task without waiting
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": "gpkg"}}'
Response
{
  "task_id": "248fea42-6dfa-4556-ad7d-bb2a3b5c0d3c",
  "status": "PENDING",
  "reserved_mc": 32000,
  "reserved_credits": 32.0
}

Checking the status

Call GET /v2/status/{task_id} with the same API key. You can only see tasks of your own account. A good rhythm is to check every 2–5 seconds; most tasks finish within a few seconds.

Every status call returns fresh download links, so you can come back later (within the retention period) and download the results again.

Get the status of a task
curl "https://api.geoczech.dev/v2/status/248fea42-6dfa-4556-ad7d-bb2a3b5c0d3c" \
  -H "X-API-Key: YOUR_API_KEY"
Response
{
  "task_id": "248fea42-6dfa-4556-ad7d-bb2a3b5c0d3c",
  "status": "SUCCESS",
  "message": "Success",
  "error": "",
  "created_at": "2026-10-14T09:17:35.946328+00:00",
  "updated_at": "2026-10-14T09:17:37.287106+00:00",
  "duration_sec": 1.251,
  "reserved_mc": 32000,
  "charged_mc": 6000,
  "output_files": [
    "https://…/output/result.json?…",
    "https://…/output/st-helena-places-utm.gpkg?…"
  ],
  "json_data": {"status": "ok", "outputs": ["…"]}
}
Start a task and wait for it in a loop
# Start the task and remember its id (needs jq: https://jqlang.org)
TASK_ID=$(curl -s -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": "gpkg"}}' | jq -r .task_id)

# Check every 3 seconds until the task is finished
while true; do
  STATUS=$(curl -s "https://api.geoczech.dev/v2/status/$TASK_ID" -H "X-API-Key: YOUR_API_KEY")
  STATE=$(echo "$STATUS" | jq -r .status)
  echo "$STATE"
  if [ "$STATE" = "SUCCESS" ] || [ "$STATE" = "FAILED" ]; then break; fi
  sleep 3
done
echo "$STATUS" | jq .output_files

The result

A finished task contains:

Field Meaning
status SUCCESS or FAILED.
message Short summary, e.g. Success or Succeeded with warnings.
output_files Download links. Valid for 1 hour; no API key needed to download.
json_data The main JSON result (report, list of results …) — no extra download needed.
warnings Things worth knowing, e.g. a field that had to be renamed.
duration_sec Net processing time — the base of the price.
reserved_mc, charged_mc Credits reserved / charged, in thousandths of a credit.
error, error_code, error_details Only for FAILED tasks.

Inputs and outputs are kept for 7 days by default (see retention_days), then they are deleted automatically. To delete them sooner, see Deleting your data.

Deleting your data

Call DELETE /v2/task/{task_id} with the same API key once you have downloaded the results. The uploaded inputs, the output files and the report of the task are deleted from storage immediately and permanently, and the download links stop working.

  • Only tasks of your own account can be deleted; another task answers 404.
  • The task must be finished (SUCCESS or FAILED). A task that is still running answers 409 with the code task_running — try again when it has finished.
  • The record of the task stays: its state, times and credits charged. Its status then contains data_deleted_at and no output_files.

All data is stored and processed in Amazon Web Services (AWS), region US East (N. Virginia), USA. Transfers use HTTPS and stored files are encrypted at rest.

Delete the data of a finished task
curl -X DELETE "https://api.geoczech.dev/v2/task/248fea42-6dfa-4556-ad7d-bb2a3b5c0d3c" \
  -H "X-API-Key: YOUR_API_KEY"
Response
{
  "task_id": "248fea42-6dfa-4556-ad7d-bb2a3b5c0d3c",
  "deleted": true,
  "deleted_files": 3,
  "data_deleted_at": "2026-11-23T10:15:02.118204+00:00"
}

Webhooks

Instead of checking the status repeatedly, give the API a callback_url. When the task finishes, the API sends an HTTP POST with a JSON body — the same content as GET /v2/status/{task_id} — to your URL.

  • The URL must be publicly reachable over the internet.
  • Delivery is best effort. If your server was down, the task is still fine — just ask for its status.
  • Treat the webhook as a notification: take the task_id from it and read the authoritative result with GET /v2/status/{task_id}.
Ask for a webhook
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": "gpkg"}}' \
  -F "callback_url=https://example.com/hooks/geoczech"
What your server receives (POST, JSON)
{
  "task_id": "248fea42-6dfa-4556-ad7d-bb2a3b5c0d3c",
  "status": "SUCCESS",
  "service_name": "converter",
  "updated_at": "2026-10-14T09:17:37.287106+00:00",
  "output_files": ["https://…/output/result.json?…", "https://…/output/st-helena-places-utm.gpkg?…"],
  "json_data": {"status": "ok", "outputs": ["…"]}
}

Last updated 2026-11-23