# Publish once. Deliver everywhere

Build map apps without a backend. The Content Delivery API is a read-only, cacheable API that delivers what you've published to apps, websites and other media: places as JSON and GeoJSON, maps as vector tiles, and images and documents as files. Public, or private with API keys.

API reference: https://spatibase.com/docs/reference/delivery-api/. OpenAPI 3.1 spec: https://api.spatibase.com/delivery/v1/openapi.json

## Query by place, not just by field

Ask for what's near a visitor, inside the map view or inside an area, and combine it with field filters in one request.

- Inside a map area (bbox), near a point sorted by distance, or inside an area drawn on another entry or any GeoJSON polygon
- Typed filter operators per field: gte, in, contains, exists and more
- type=park includes every kind of park
- Groups keep the order your editors set
- include=references expands linked entries in the same request

```http
GET /delivery/v1/projects/{id}/entries
  ?type=campsite
  &near=-124.0,41.2&radius=5000&sort=distance
  &filter[rating][gte]=4
  &filter[open]=true
```

## Vector tiles and TileJSON

Point a map at one TileJSON URL: it frames the map on your published places and loads only the tiles on screen, so large datasets render fast.

- Always current: built on request from what you published
- Colour by type, filter by field values
- Private projects: the key on tiles.json carries into the tile URLs
- MapLibre, Mapbox GL and QGIS

```js
const API = 'https://api.spatibase.com/delivery/v1/projects/{id}'

map.on('load', () => {
  map.addSource('places', {
    type: 'vector', url: API + '/tiles.json'
  })
  map.addLayer({
    id: 'places', type: 'circle', source: 'places',
    'source-layer': 'entries',
    filter: ['==', ['geometry-type'], 'Point'],
    paint: { 'circle-color': ['get', 'color'] }
  })
})
```

## Predictable JSON

Every entry has the same shape: its type, title, geometry and your fields. The example is a real response, trimmed.

- Fields keyed by the API keys you chose for them
- Absolute image URLs, with width and height
- Geometry as plain GeoJSON
- The content model is an endpoint too: /types lists every type and its fields, and each project has a typed OpenAPI file for generating a client
- Errors say what is valid: Unknown type "parks". Available types: park, store

```json
{
  "data": {
    "id": "9d57e2e5-36ed-404a-99f0-c30d04be9fff",
    "type": "campsite",
    "title": "Gold Bluffs Beach Campground",
    "geometry": { "type": "Point", "coordinates": [-124.0656, 41.3818] },
    "fields": {
      "rating": 4.6,
      "open": true,
      "sites": 26,
      "photos": [{
        "url": "https://api.spatibase.com/assets/78bd0ca0-a774-4d55-bf94-18f90c9a6319/gold-bluffs.jpg",
        "width": 320,
        "height": 200
      }]
    },
    "groups": [],
    "publishedAt": "2026-10-20T08:42:56.447Z"
  }
}
```

## Fast, safe and always current

- **Cacheable.** ETag and 304, CDN-friendly Cache-Control and CORS. The ETag changes only when what the API serves changes, never when an editor saves a draft.
- **Images on the fly.** Add w, h and fmt=webp or avif to any image URL. Resized copies are cached for a year (immutable).
- **Consistent reads.** Every response reads one snapshot of your content, so totals, pages and entries always match, even during a publish.
- **GeoJSON and paging.** Up to 500 entries per page as JSON and up to 5,000 per request as a GeoJSON FeatureCollection, with the same filters.
- **OpenAPI 3.1 spec.** Every endpoint in one file, no key needed, and a typed file per project with your own fields. Generate a TypeScript client with autocomplete and compile-time checks.
- **Public or private.** Public projects need no key. Private projects use read-only API keys that you can rotate or revoke.
- **Published content only.** Drafts never reach the API: your app sees only what was published, from types that are switched on.
- **Webhooks.** One signed URL per project is called when entries are published, unpublished or deleted, or groups change.
- **Clear errors.** Every error is JSON with a code you can branch on and a message that says what is valid, such as which types or filter operators exist.

## Learn the API in the docs

Create a project, then open API in the app: Try it runs requests against your own content, and the Overview gives curl and JavaScript with your project's address, ready to copy. The Quickstart takes it from there to a map.

- [Quickstart](https://spatibase.com/docs/build/quickstart/): Publish an entry, fetch it from the API and show it on a map.
- [Content Delivery API reference](https://spatibase.com/docs/reference/delivery-api/): Every endpoint, query parameter, filter and error, plus the OpenAPI file.
- [GeoJSON and vector tiles](https://spatibase.com/docs/reference/geojson-and-tiles/): Load published entries into maps and GIS tools.
- [Field values](https://spatibase.com/docs/reference/field-values/): The JSON shape of every kind of field in API output.
- [Access and API keys](https://spatibase.com/docs/publish/access-and-keys/): Make a project public or private and manage its keys.
- [Webhooks](https://spatibase.com/docs/publish/webhooks/): Get notified on your server when published content changes.
- [All docs](https://spatibase.com/docs/) and [code recipes](https://spatibase.com/docs/build/recipes/)

Using an AI coding assistant? Point it at https://api.spatibase.com/delivery/v1/openapi.json, or connect it over MCP: https://spatibase.com/ai/
