Skip to content
API Endpoints

API Endpoints

This page lists all HTTP endpoints exposed by the Data Connector service. Use these endpoints to fetch tiles, search features, manage DataConnectors, and trigger data updates.

Data Retrieval Endpoints

URL Schema

https://dataconnector.maptoolkit.net/{account}/{names}...
ParameterDescription
accountYour account name (ex maptoolkit)
namesName of the DataConnector (ex pois). You can combine the data of multiple DataConnectors with a dash (ex pois-hotels)

Authentication

Add your API key as ?api_key=YOUR_API_KEY to every request. See Authentication for details.

TileJSON

GET /{account}/{names}.json

Returns a TileJSON 2.2.0 specification for one or more DataConnectors.

ParameterTypeRequiredDescription
filterstringNoJSON filter expression to restrict which features are included.
idsstringNoJSON array of feature IDs to restrict results to specific features.
querystringNoText query string passed to the backend for filtering.
optimizestringNoStyle-based tile optimization in the format styleid,source,prop1,....
rerenderstringNoWhen set, bypasses the tile cache and forces a fresh render.

Vector Tiles

GET /{account}/{names}/{z}/{x}/{y}.{pbf|png|webp|jpeg}

Returns a tile for the given zoom level and coordinates. Use pbf for vector tiles (Protocol Buffer format), or an image format for raster tiles. Combine multiple DataConnectors with a dash. Maximum zoom level is 20 for raster tiles and 18 for vector tiles.

ParameterTypeRequiredDescription
filterstringNoJSON filter expression to restrict which features are included.
idsstringNoJSON array of feature IDs to restrict results to specific features.
querystringNoText query string passed to the backend for filtering.
optimizestringNoStyle-based tile optimization in the format styleid,source,prop1,...; strips unused properties to reduce tile size.
rerenderstringNoWhen set, bypasses the tile cache and forces a fresh render.

Feature Export

GET /{account}/{name}/{id}.{geojson|kml|gpx}

Exports a single feature by ID as GeoJSON, KML (Keyhole Markup Language), or GPX (GPS Exchange Format). KML and GPX are only available for LineString geometries. For GeoJSON, you can export multiple features by passing a comma-separated list of IDs.

Query Cache

POST /{account}/{name}/querycache
GET  /{account}/{names}/querycache

Use POST to create a cached result set for a query. Use GET to retrieve the total count, bounding box, and optionally the IDs of matching features across one or more DataConnectors.

POST body parameters:

ParameterTypeRequiredDescription
filterstringNoJSON filter expression to restrict which features are cached.
idsstringNoJSON array of feature IDs to restrict the cached result.
querystringNoText query string passed to the backend for filtering.

GET query parameters:

ParameterTypeRequiredDescription
filterstringNoJSON filter expression to restrict which features are included.
idsstringNoJSON array of IDs to filter by; also includes matched IDs in the response when set.
querystringNoText query string passed to the backend for filtering.
remoteidsstringNoWhen set, includes the original source IDs from the backend in the response.

Search

GET /{account}/{name}/search

Searches the DataConnector and returns a GeoJSON FeatureCollection with matching features.

ParameterTypeRequiredDescription
querystringNoThe search text to match against indexed fields.
filterstringNoJSON filter expression to restrict which features are searched.
idsstringNoJSON array of feature IDs to restrict the search to specific features.
limitintegerNoMaximum number of features to return (max 1000). Default: 100.
offsetintegerNoNumber of features to skip, for pagination. Default: 0.

Map Preview

GET /{account}/{name}.html

Returns an HTML map preview of the DataConnector using the Maptoolkit JS library.

ParameterTypeRequiredDescription
iframebooleanNoWhen set to true, wraps the map in an <iframe> element.

REST API

All REST API endpoints require write permission and account ownership. Authenticate using your API key.

List DataConnectors

GET /api/{account}

Returns all DataConnectors for the account as a JSON array, sorted by last update time. Each entry includes the full configuration and any current fetch or insert errors.

curl https://dataconnector.maptoolkit.net/api/maptoolkit?api_key=YOUR_API_KEY

Create or Update DataConnector

POST /api/{account}

Creates a new DataConnector or updates an existing one. After saving, triggers a full data fetch automatically. Returns the saved resource object.

The name field must be unique within the account and may only contain lowercase letters, digits, and underscores (a-z, 0-9, _).

See Data Sources for detailed information on configuring the different data sources.

FieldTypeRequiredDescription
namestringYesUnique name for the DataConnector.
backendstringYesBackend type (e.g., postgres, solr, geojson). See Data Sources.
data_endpointobjectYesBackend-specific connection and query configuration.
permissionsobjectNoAccess control. Default: {} (private).
tagsarrayNoTags for grouping DataConnectors. Default: [].
tilejsonobjectNoTileJSON overrides (e.g., minzoom, maxzoom, center).
update_endpointobjectNoEndpoint config for query-based partial updates.
search_endpointobjectNoEndpoint config for backend-side search.
reload_intervalstringNoAuto-reload interval in hours (e.g., "24").
id_fieldstringNoField to use as the feature ID.
title_fieldstringNoField to use as the display title.
geometry_fieldstringNoField containing the geometry.
geometry_formatstringNoGeometry format (e.g., geojson, wkt).
data_fieldsarrayNoFields to store and index.
vectortile_fieldsarrayNoFields to include in vector tiles.
trie_fieldsarrayNoFields to index for prefix search.
order_fieldstringNoField to sort results by.
order_directionstringNoSort direction (asc or desc).
grid_sizenumberNoGrid cell size for cluster aggregation.
grid_thresholdnumberNoFeature count above which clustering activates.
field_renameobjectNoMap of source field names to renamed output fields.
curl -X POST https://dataconnector.maptoolkit.net/api/maptoolkit?api_key=YOUR_API_KEY \
  -H "Content-Type: application/json" \
  -d '{
    "name": "pois",
    "backend": "postgres",
    "data_endpoint": {
      "host": "localhost",
      "port": 5432,
      "database": "mydb",
      "user": "myuser",
      "password": "mypassword",
      "query": "SELECT id, name, ST_AsGeoJSON(geom) as geometry FROM pois"
    },
    "id_field": "id",
    "geometry_field": "geometry",
    "vectortile_fields": ["name"]
  }'

See Data Sources for detailed information on configuring the different data sources.

Get DataConnector Configuration

GET /api/{account}/{name}

Returns the full configuration and metadata for a single DataConnector.

curl https://dataconnector.maptoolkit.net/api/maptoolkit/pois?api_key=YOUR_API_KEY

Export All Items

GET /api/{account}/{name}/items.{ndjson|geojson}

Streams all items stored in the DataConnector. Use ndjson to get one JSON object per line, or geojson to get a full GeoJSON FeatureCollection. Closes the connection cleanly if you disconnect before the stream ends.

curl https://dataconnector.maptoolkit.net/api/maptoolkit/pois/items.geojson?api_key=YOUR_API_KEY

Trigger Data Update

POST /api/{account}/{name}

Triggers a data update. There are three modes depending on what you send in the request body:

Full re-fetch — Send an empty body. The DataConnector re-fetches all data from its configured data_endpoint, then clears the query cache and tile cache. Use this after your source data has changed.

curl -X POST https://dataconnector.maptoolkit.net/api/maptoolkit/pois?api_key=YOUR_API_KEY

Query-based partial update — Send a JSON body with a query field. The DataConnector fetches matching items from the configured update_endpoint using that query, and updates only those items. Requires update_endpoint to be configured on the DataConnector.

curl -X POST https://dataconnector.maptoolkit.net/api/maptoolkit/pois?api_key=YOUR_API_KEY \
  -H "Content-Type: application/json" \
  -d '{"query": "id:123"}'

Push data — Send a JSON body with feature data and no query field. The DataConnector parses the body using the backend’s own format and updates the matching items. Not supported by all backends — returns HTTP 501 if the backend does not support push. For Solr, the body must match the Solr response format ({ "response": { "docs": [...] } }).

curl -X POST https://dataconnector.maptoolkit.net/api/maptoolkit/pois?api_key=YOUR_API_KEY \
  -H "Content-Type: application/json" \
  -d '{"response": {"docs": [{"id": "123", "name": "My POI"}]}}'

Delete DataConnector

DELETE /api/{account}/{name}

Deletes the DataConnector and all its data. If the DataConnector uses the tag backend, also removes the tag reference from all associated DataConnectors. Returns "OK" on success.

curl -X DELETE https://dataconnector.maptoolkit.net/api/maptoolkit/pois?api_key=YOUR_API_KEY

Delete a Specific Item

DELETE /api/{account}/{name}/{id}

Deletes a single item by ID from the DataConnector and invalidates the affected tile and query cache. Returns "OK" on success.

curl -X DELETE https://dataconnector.maptoolkit.net/api/maptoolkit/pois/123?api_key=YOUR_API_KEY