# OGC API Tiles Extractor (`datamule/ogc-api-tiles-extractor`) Actor

Point at ANY OGC API - Tiles endpoint (the JSON-native successor to WMTS) — ldproxy, GNOSIS, GeoServer, pygeoapi. Inventory vector/map tileset offerings, list tile matrix sets (CRS, zoom levels, axes), or discovery-scan a server's tiles capabilities as flat rows. Pay per record.

- **URL**: https://apify.com/datamule/ogc-api-tiles-extractor.md
- **Developed by:** [Datamule](https://apify.com/datamule) (community)
- **Categories:** Developer tools, Business
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.35 / 1,000 records

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.
Actors are written with capital "A".

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.
The best way to integrate Actors is as follows.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js/docs.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python/docs.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/integrations/mcp.md).

If your project is in a different language, use the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).


# README

## OGC API Tiles Extractor

A generic **"point at any OGC API - Tiles endpoint"** scraper. [OGC API -
Tiles](https://ogcapi.ogc.org/tiles/) is the modern **JSON-native** standard for
publishing tiled **vector** and **map/raster** data — the successor to the older
XML **Web Map Tile Service (WMTS)**. Basemaps, vector tilesets, land-cover,
imagery and thematic layers are all published as *tileset offerings* over
standard *tile matrix sets* by national mapping agencies, spatial data
infrastructures and modern map servers.

**One actor spans them all.** Point it at any OGC API landing/root URL and it
inventories every tileset offering, lists the tile matrix sets, or discovery-scans
the server — with the **same normalized row shape regardless of the server
software** (ldproxy, Ecere GNOSIS, GeoServer, pygeoapi, …). No per-server scraper
needed.

### Three modes

| Mode | What you get (one flat row per…) |
|------|----------------------------------|
| **tilesets** (default) | …tileset offering — `tileset_title`, `data_type` (vector/map), `tileMatrixSet_id`, `tileMatrixSet_uri`, `crs`, `tile_url_templates`, `tileset_url`, `zoom_levels`, `bbox` |
| **tilematrixsets** | …tile matrix set the server publishes — `tms_id`, `tms_title`, `tms_crs`, `tileMatrix_count`, `tileMatrix_ids`, `ordered_axes`, `well_known_scale_set` |
| **discovery** | …source — `api_title`, `tileset_endpoints`, `tileMatrixSet_ids`, `tileMatrixSet_count`, `collection_count` (one reconnaissance row per endpoint) |

Every row also carries provenance (`_sourceService`, `_ogcApi`,
`_serverSoftware`, `_mode`) and a lossless, size-capped `_raw`.

### Why it's a genuine generic runner

OGC API - Tiles servers advertise tilesets two different ways, and this actor
normalizes both to one row:

- **Tile matrix set id** — some servers (ldproxy) give an explicit
  `tileMatrixSetId`; others (GNOSIS) give only a `tileMatrixSetURI`. The actor
  reads the explicit id when present and otherwise derives it from the URI's
  last path segment.
- **Where tiles are advertised** — some servers advertise a per-collection
  tileset listing (`tilesets-vector` link relation on a collection); others
  advertise a server-level global listing (`/tiles`, `/map/tiles`). The actor
  follows the advertised link relations **and** probes the spec's standard entry
  points, so both conventions resolve.

### Input

```json
{
  "sources": ["https://demo.ldproxy.net/vineyards", "https://maps.gnosis.earth/ogcapi"],
  "mode": "tilesets",
  "collections": [],
  "maxRecords": 1000
}
````

- **sources** (required) — one or more OGC API landing/root URLs. Point at the
  root, not `/tiles` or `/tileMatrixSets`.
- **mode** — `tilesets` (default), `tilematrixsets`, or `discovery`.
- **collections** — in `tilesets` mode, restrict to specific collection ids and
  drill into each collection's tiles; leave empty to read the fast server-level
  global tileset listing. Ignored in the other modes.
- **maxRecords** — total row cap (each row is one billable event). Default 1000.
- **bearerToken** / **extraHeaders** — optional, for auth-gated deployments.
  Not required for public OGC API endpoints. Never logged.

### Output (tilesets mode, example row)

```json
{
  "_mode": "tilesets",
  "collectionId": "vineyards",
  "tileset_title": "Vineyards",
  "data_type": "vector",
  "tileMatrixSet_id": "WebMercatorQuad",
  "tileMatrixSet_uri": "http://www.opengis.net/def/tilematrixset/OGC/1.0/WebMercatorQuad",
  "crs": null,
  "tile_url_templates": ["https://demo.ldproxy.net/vineyards/tiles/WebMercatorQuad/{tileMatrix}/{tileRow}/{tileCol}?f=mvt"],
  "tileset_url": "https://demo.ldproxy.net/vineyards/tiles/WebMercatorQuad",
  "zoom_levels": 12,
  "bbox": [6.3021348, 49.0087017, 8.4179034, 50.6138935],
  "_sourceService": "https://demo.ldproxy.net/vineyards",
  "_ogcApi": "tiles",
  "_serverSoftware": "ldproxy"
}
```

### Behaviour & honesty

- **Content negotiation handled.** Every request asks for `f=json`; if a server
  returns HTML (a content-negotiation miss) the resource is skipped with a
  warning — HTML is never parsed as tiles.
- **Link-relation driven.** Tileset availability is discovered from the server's
  own `links[]` relations (`tilesets-vector`, `tilesets-map`, `tiling-schemes`),
  not hard-coded paths beyond the standard entry points.
- **Zero tilesets is a real state.** A reachable endpoint that exposes no
  tilesets / tile matrix sets returns 0 rows and exits cleanly — no fabricated
  data.
- **Bad sources are skipped** with a warning and the run continues; if *every*
  source fails, the run fails fast so nothing broken ships.

### Pricing

Pay-per-event: one **record** charge per row returned.

### Verified

Tested live against two independent server families: interactive-instruments
**ldproxy** (vineyard vector tilesets) and Ecere **GNOSIS** (NaturalEarth vector +
map tilesets across nine tile matrix sets), confirming identical normalized output
across vendors.

# Actor input Schema

## `sources` (type: `array`):

One or more root URLs of ANY OGC API - Tiles endpoint (the modern JSON-native successor to WMTS for tiled vector/map data). Examples: https://demo.ldproxy.net/vineyards (interactive-instruments ldproxy, vector tilesets) and https://maps.gnosis.earth/ogcapi (Ecere GNOSIS, NaturalEarth vector + map tilesets). Point at the landing/API root — do NOT include /tiles or /tileMatrixSets.

## `mode` (type: `string`):

What to extract. "tilesets" (default): one row per tileset OFFERING (collection id, tileset title, tile matrix set id/URI, data type vector/map, CRS, tile-URL templates, zoom-level count, bbox). Leave "Collection id(s)" empty to read the fast server-level global listing, or name collections to drill into each. "tilematrixsets": one row per TileMatrixSet the server publishes (id, title, CRS, tile-matrix count + ids, axis order). "discovery": one reconnaissance row per source summarizing its tiles capabilities (tileset endpoints, available TileMatrixSet ids, collection count).

## `collections` (type: `array`):

Collection id(s) to drill into for tileset offerings (used only by "tilesets" mode), e.g. vineyards. Leave EMPTY to read the endpoint's server-level global tileset listing (fastest). Ignored in "tilematrixsets" and "discovery" modes.

## `maxRecords` (type: `integer`):

Maximum total number of rows to emit across all sources and collections. Each returned row is one billable event. Default 1000.

## `bearerToken` (type: `string`):

Optional OAuth2 bearer token for auth-gated deployments. Sent as Authorization: Bearer \*\*\* — NOT required for public OGC API endpoints (ldproxy, GNOSIS demos), leave empty. Never logged.

## `extraHeaders` (type: `object`):

Optional extra HTTP headers to send with every request, as a JSON object, e.g. {"api-key": "..."} for a service that takes an API key in a header. Leave empty for public services.

## Actor input object example

```json
{
  "sources": [
    "https://demo.ldproxy.net/vineyards"
  ],
  "mode": "tilesets",
  "collections": [],
  "maxRecords": 1000
}
```

# Actor output Schema

## `results` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "sources": [
        "https://demo.ldproxy.net/vineyards"
    ],
    "collections": [],
    "maxRecords": 1000
};

// Run the Actor and wait for it to finish
const run = await client.actor("datamule/ogc-api-tiles-extractor").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "sources": ["https://demo.ldproxy.net/vineyards"],
    "collections": [],
    "maxRecords": 1000,
}

# Run the Actor and wait for it to finish
run = client.actor("datamule/ogc-api-tiles-extractor").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "sources": [
    "https://demo.ldproxy.net/vineyards"
  ],
  "collections": [],
  "maxRecords": 1000
}' |
apify call datamule/ogc-api-tiles-extractor --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=datamule/ogc-api-tiles-extractor",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "OGC API Tiles Extractor",
        "description": "Point at ANY OGC API - Tiles endpoint (the JSON-native successor to WMTS) — ldproxy, GNOSIS, GeoServer, pygeoapi. Inventory vector/map tileset offerings, list tile matrix sets (CRS, zoom levels, axes), or discovery-scan a server's tiles capabilities as flat rows. Pay per record.",
        "version": "0.1",
        "x-build-id": "PfaL1vd6P4YnjeaCN"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/datamule~ogc-api-tiles-extractor/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-datamule-ogc-api-tiles-extractor",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/datamule~ogc-api-tiles-extractor/runs": {
            "post": {
                "operationId": "runs-sync-datamule-ogc-api-tiles-extractor",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/datamule~ogc-api-tiles-extractor/run-sync": {
            "post": {
                "operationId": "run-sync-datamule-ogc-api-tiles-extractor",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "required": [
                    "sources"
                ],
                "properties": {
                    "sources": {
                        "title": "OGC API service root URL(s)",
                        "type": "array",
                        "description": "One or more root URLs of ANY OGC API - Tiles endpoint (the modern JSON-native successor to WMTS for tiled vector/map data). Examples: https://demo.ldproxy.net/vineyards (interactive-instruments ldproxy, vector tilesets) and https://maps.gnosis.earth/ogcapi (Ecere GNOSIS, NaturalEarth vector + map tilesets). Point at the landing/API root — do NOT include /tiles or /tileMatrixSets.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "mode": {
                        "title": "Mode",
                        "enum": [
                            "tilesets",
                            "tilematrixsets",
                            "discovery"
                        ],
                        "type": "string",
                        "description": "What to extract. \"tilesets\" (default): one row per tileset OFFERING (collection id, tileset title, tile matrix set id/URI, data type vector/map, CRS, tile-URL templates, zoom-level count, bbox). Leave \"Collection id(s)\" empty to read the fast server-level global listing, or name collections to drill into each. \"tilematrixsets\": one row per TileMatrixSet the server publishes (id, title, CRS, tile-matrix count + ids, axis order). \"discovery\": one reconnaissance row per source summarizing its tiles capabilities (tileset endpoints, available TileMatrixSet ids, collection count).",
                        "default": "tilesets"
                    },
                    "collections": {
                        "title": "Collection id(s)",
                        "type": "array",
                        "description": "Collection id(s) to drill into for tileset offerings (used only by \"tilesets\" mode), e.g. vineyards. Leave EMPTY to read the endpoint's server-level global tileset listing (fastest). Ignored in \"tilematrixsets\" and \"discovery\" modes.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "maxRecords": {
                        "title": "Max records (total)",
                        "minimum": 1,
                        "type": "integer",
                        "description": "Maximum total number of rows to emit across all sources and collections. Each returned row is one billable event. Default 1000.",
                        "default": 1000
                    },
                    "bearerToken": {
                        "title": "Bearer token (optional)",
                        "type": "string",
                        "description": "Optional OAuth2 bearer token for auth-gated deployments. Sent as Authorization: Bearer *** — NOT required for public OGC API endpoints (ldproxy, GNOSIS demos), leave empty. Never logged."
                    },
                    "extraHeaders": {
                        "title": "Extra request headers",
                        "type": "object",
                        "description": "Optional extra HTTP headers to send with every request, as a JSON object, e.g. {\"api-key\": \"...\"} for a service that takes an API key in a header. Leave empty for public services."
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
