Sample rows
Fetch a free slice of dataset rows in JSON, CSV, GeoJSON, or KML to inspect the schema before spending credits on a full download.
Sample rows
Pull a small slice of a dataset to inspect its schema and real values. Samples are public and cost no credits, so use them throughout development before spending credits on a full download.
Endpoint
GET /v1/dataset/:table/sample/:format
Public, costs no credits. Supported format values: json, csv, geojson, kml. (SHP is not offered as a sample; use the JSON or GeoJSON sample to inspect geometry.)
Path parameters
| Parameter | Description |
|---|---|
table |
Dataset identifier, for example transport_infrastructure_bushaltes. |
format |
One of json, csv, geojson, kml. |
Request
curl "https://api.topolab.nl/v1/dataset/transport_infrastructure_bushaltes/sample/json"
Response
A sample returns representative rows from a dataset that ships one. Sample size depends on the dataset (small datasets may return all rows; very large datasets are capped). The sample is enough to confirm field names, types, and coordinate values before committing to a paid pull. The response Content-Type matches the requested format (application/json, text/csv, application/geo+json, or application/vnd.google-earth.kml+xml).
The json format returns a raw array of row objects, no wrapper, no metadata. Each object is one record with the dataset's real columns:
[
{
"location": "Stationsplein",
"street": "Stationsplein",
"city": "Amsterdam",
"postal_code": "1012 AB",
"country_code": "nl",
"category": "public_transport",
"sub_category": "bus_stop",
"geo_type": "point",
"admin_level_1": "Noord-Holland",
"admin_level_2": "Amsterdam",
"harvest_date": "2026-05-01",
"tags": ["bus", "public_transport"]
},
{
"location": "Kruisplein",
"street": "Kruisplein",
"city": "Rotterdam",
"postal_code": "3012 CC",
"country_code": "nl",
"category": "public_transport",
"sub_category": "bus_stop",
"geo_type": "point",
"admin_level_1": "Zuid-Holland",
"admin_level_2": "Rotterdam",
"harvest_date": "2026-05-01",
"tags": ["bus", "public_transport"]
}
]
The csv format returns the same rows as comma-separated text with a header row. The geojson and kml formats return the rows as features in WGS84 (EPSG:4326).
curl "https://api.topolab.nl/v1/dataset/transport_infrastructure_bushaltes/sample/geojson"
{
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"geometry": { "type": "Point", "coordinates": [4.9003, 52.3789] },
"properties": { "location": "Stationsplein", "city": "Amsterdam" }
}
]
}
GeoJSON coordinates are ordered [longitude, latitude] and are always WGS84 (EPSG:4326).
When to use samples
- Confirm field names and types before mapping them in your code.
- Verify coordinate ordering and reference system.
- Develop and test parsers without consuming your monthly credit allowance.
For a structured field profile (types, null ratios, distinct counts) without downloading rows at all, see fieldAnalysis on Get a dataset.
Errors
| Status | Meaning |
|---|---|
404 |
Unknown table or unsupported sample format. |
429 |
Rate limited, see Rate limits & credits. |
Next
- Download files, full exports once the schema looks right.
- Get a dataset, metadata, quality grade, and field analysis.