For: developer
Developer API
The catalogue runs CKAN 2.12. Everything on the web site is also available as an API.
- Base URL:
https://catalog.data.nextlogic-project.eu - API root:
https://catalog.data.nextlogic-project.eu/api/3/action/ - Responses are JSON:
{"success": true, "result": ...}. - Anonymous calls return public (Open) records only. With a token you also see what your account may see.
This page is for developers. For the Digital Tools Hub, see the Hub integration guide.
Get an API token
- Sign in. You need an approved account (see Roles and approvals).
- Open your profile, then API Tokens.
- Name the token and select Create. Copy it at once. It is shown only once.
Tokens expire after 365 days. Send the token in the Authorization header. Keep it out of source code and logs. Do not put it in a URL.
export CKAN_URL=https://catalog.data.nextlogic-project.eu
export CKAN_TOKEN=... # your token, from a secret store
curl -s -H "Authorization: $CKAN_TOKEN" \
"$CKAN_URL/api/3/action/package_search?rows=0&include_private=true"
If the call succeeds, the token works. count includes the private records you may see. You cannot create accounts through the API. Registration needs approval.
Search records
package_search supports Solr syntax. The catalogue indexes these facet fields:
| Facet field | Example value |
|---|---|
vocab_solution |
mh, slz, 15m, ir, el |
vocab_city |
wro, hag, dub, aar ... |
vocab_mobility_data_category |
freight-and-logistics |
vocab_available_via |
download, api, mds |
vocab_sensitivity_class |
open, controlled (signed-in only) |
vocab_record_kind |
source, output |
vocab_release_status |
available, withdrawn ... |
res_format, license_id, organization, tags |
standard CKAN facets |
# Microhub (MH) records in Wroclaw, 20 per page, with facet counts
curl -s -G "$CKAN_URL/api/3/action/package_search" \
--data-urlencode 'q=loading zone' \
--data-urlencode 'fq=vocab_solution:mh AND vocab_city:wro' \
--data-urlencode 'facet.field=["vocab_city","vocab_available_via"]' \
--data-urlencode 'rows=20' --data-urlencode 'start=0'
Page with rows (maximum 1000) and start. Use the count in the result to know when to stop.
vocab_available_via:mds finds records with a published MDS offer that are not withdrawn.
Read one record
curl -s "$CKAN_URL/api/3/action/package_show?id=mh-wro-007-s01"
id is the lower-case ID (name) or the CKAN UUID. The framework ID is in result.framework_id.
Discover fields and allowed values
The schema endpoint lists every field and the valid choice values. Read it rather than hard-coding values.
curl -s "$CKAN_URL/api/3/action/scheming_dataset_schema_show?type=dataset" \
| python3 -c "import sys,json; s=json.load(sys.stdin)['result']; \
[print(f['field_name'], [c['value'] for c in f.get('choices',[])]) for f in s['dataset_fields']]"
Choice values are stable lower-case slugs, for example open-access and near-real-time. Labels are in the same response. The Glossary shows the common ones.
Create or update a record
Organisation editors can create and patch records. Records are created private. Making one public needs an organisation administrator, and passes the rule that it must be Open, Open Access, openly licensed and free of personal data.
curl -s -X POST "$CKAN_URL/api/3/action/package_create" \
-H "Authorization: $CKAN_TOKEN" -H "Content-Type: application/json" \
-d '{
"framework_id": "MH-WRO-099-S01",
"requirement_id": "MH-WRO-099",
"title": "Example source for documentation",
"notes": "Plain-language description of the data.",
"owner_org": "my-organisation",
"private": true,
"solution": "mh",
"city": "wro",
"data_domain": "geospatial-and-network-data",
"source_type": "public-sector",
"data_provider": "Example provider",
"contact": [{"name": "Data Steward", "email": "data-platform@nextlogic-project.eu"}],
"access_point": "To Be Determined",
"access_model": "open-access",
"sensitivity_class": "tbd",
"personal_data": "no",
"license_id": "CC-BY-4.0",
"update_frequency": "daily",
"crs": "EPSG:4326"
}'
Notes:
nameis derived fromframework_idand cannot be changed later.record_kindis derived from the ID pattern.solutionandcitymust match the ID.requirement_idmust be the start of a source ID.- Other required fields depend on the record. Validation errors come back per field in
error, with HTTP 409. - Text fields are scanned for credentials. Anything that looks like a password, key or token is rejected.
Update with package_patch. Send id and only the fields that change:
curl -s -X POST "$CKAN_URL/api/3/action/package_patch" \
-H "Authorization: $CKAN_TOKEN" -H "Content-Type: application/json" \
-d '{"id": "mh-wro-099-s01", "update_frequency": "hourly"}'
To withdraw an output, use the Withdraw button. package_delete is limited to catalogue administrators.
Upload a file
curl -s -X POST "$CKAN_URL/api/3/action/resource_create" \
-H "Authorization: $CKAN_TOKEN" \
-F "package_id=mh-wro-099-s01" \
-F "name=Sample data" \
-F "format=CSV" \
-F "access_route=download" \
-F "upload=@sample.csv"
The upload limit is 100 MB. For a link instead of a file, send url instead of upload. access_route is download, api or mds.
Query tabular data (DataStore)
CSV and similar files are loaded into the DataStore in the background. When the load has finished, the resource has datastore_active: true.
curl -s -G "$CKAN_URL/api/3/action/datastore_search" \
--data-urlencode "resource_id=<resource-uuid>" \
--data-urlencode "limit=5" --data-urlencode "q=hourly"
Use limit and offset to page, and fields, filters and sort to shape the result. A record that is private requires your token.
DCAT: machine-readable catalogue
| URL | Returns |
|---|---|
/catalog.ttl, /catalog.jsonld |
The public catalogue as DCAT-AP, paged |
/catalog.ttl?page=2 |
The next page. Follow the Hydra next link in the output. |
/catalog.jsonld?modified_since=2026-11-01T00:00:00Z |
Only records changed since that time |
/dataset/<name>.jsonld, .ttl |
One record |
/id/dataset/<ID> |
The persistent URI of a record. It redirects with HTTP 303 to the HTML page, Turtle or JSON-LD according to your Accept header. |
Always write modified_since in UTC with a trailing Z. Offsets such as +01:00 trip a parser bug.
curl -sL -H "Accept: application/ld+json" "$CKAN_URL/id/dataset/MH-WRO-OUT-001"
The catalogue uses the persistent URI https://catalog.data.nextlogic-project.eu/id/dataset/<ID> as the identifier of a record. The framework ID is also stored as adms:identifier.
CORS
The API allows any origin (Access-Control-Allow-Origin: *), so browser apps can read public data directly. Do not embed a token in a public web page. Anyone can read it.
Be a polite client
- Page large result sets. Do not ask for everything in one request.
- Harvest incrementally. Take a full snapshot once, then call
/catalog.jsonld?modified_since=...with the time of your last successful run. - Rate. The pilot has no published quota. Please keep to about one request per second and a single connection. Back off if you receive 429 or 5xx, and wait longer each time.
- Identify yourself. Set a
User-Agentthat names your tool and a page about it, for exampleNextlogicToolHarvester/1.0 (+https://example.org/about). - Cache. Do not fetch the same record twice in a short period.
- Respect visibility. Do not republish records you can see only because you are signed in.
Python with ckanapi
import os
from ckanapi import RemoteCKAN
ckan = RemoteCKAN(
"https://catalog.data.nextlogic-project.eu",
apikey=os.environ["CKAN_TOKEN"], # omit for anonymous reads
user_agent="NextlogicToolHarvester/1.0 (+https://example.org/about)",
)
found = ckan.action.package_search(fq="vocab_solution:slz", rows=10)
print(found["count"])
for pkg in found["results"]:
print(pkg["framework_id"], pkg["title"])
ckan.action.package_patch(id="mh-wro-099-s01", update_frequency="hourly")
Python with requests
import os, time, requests
BASE = "https://catalog.data.nextlogic-project.eu"
session = requests.Session()
session.headers["User-Agent"] = "NextlogicToolHarvester/1.0 (+https://example.org/about)"
if "CKAN_TOKEN" in os.environ:
session.headers["Authorization"] = os.environ["CKAN_TOKEN"]
def search(fq, rows=100):
start = 0
while True:
r = session.get(f"{BASE}/api/3/action/package_search",
params={"fq": fq, "rows": rows, "start": start}, timeout=30)
r.raise_for_status()
result = r.json()["result"]
yield from result["results"]
start += rows
if start >= result["count"]:
break
time.sleep(1) # be polite
for pkg in search("vocab_available_via:mds"):
print(pkg["framework_id"], pkg["title"])
Errors
| Code | Meaning |
|---|---|
| 400 | Malformed request, such as bad JSON |
| 403 | Not allowed. Your account may lack the organisation level. |
| 404 | Not found, or private and not visible to you |
| 409 | Validation failed, including a duplicate ID. Read error for the field messages. |