AI-Native API

Spatix API

The simplest way for AI agents and developers to create maps

Quick Start

Create a map with a single API call. No signup, no API key, no complex setup.

curl -X POST https://api.spatix.io/api/map \
  -H "Content-Type: application/json" \
  -d '{
    "data": {"type": "Point", "coordinates": [-122.4194, 37.7749]},
    "title": "San Francisco"
  }'

Response:

{
  "success": true,
  "id": "abc123",
  "url": "https://spatix.io/m/abc123",
  "embed": "<iframe src='https://spatix.io/m/abc123?embed=1' width='600' height='400'></iframe>",
  "preview_url": "https://spatix.io/m/abc123",
  "delete_token": "tok_..."
}

Authentication

No authentication required for basic usage. Just send your request and get a map back.

Rate limited to 100 maps/hour per IP. Authenticated users get higher limits (200 free / 500 pro). Need more? Get in touch.

Optional: JWT Authentication

Sign up at spatix.io/signup and use your JWT token for higher rate limits and map management.

curl -X POST https://api.spatix.io/api/map \
  -H "Authorization: Bearer YOUR_JWT_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"data": {...}}'

Create Map

POST /api/map

Accepts GeoJSON, coordinate arrays, or raw geometry. Returns a shareable map URL.

Request Body

FieldTypeDescription
dataobject | arrayGeoJSON, coordinate array, or geometry object
titlestringOptional map title
stylestring"light" | "dark" | "satellite" | "streets"
emailstringOptional. Links the map to your account for My Maps
layersarrayOptional. Array of layer objects for composable multi-layer maps

NLP Endpoints

Create maps from natural language. Ideal for AI agents that work with text descriptions rather than raw coordinates.

POST /api/map/from-text

Extracts locations from natural language text, geocodes them, and creates a map.

curl -X POST https://api.spatix.io/api/map/from-text \
  -H "Content-Type: application/json" \
  -d '{
    "text": "coffee shops near Union Square, San Francisco",
    "title": "Coffee Near Union Square"
  }'

POST /api/map/from-addresses

Geocodes a list of addresses and creates a map with markers for each.

curl -X POST https://api.spatix.io/api/map/from-addresses \
  -H "Content-Type: application/json" \
  -d '{
    "addresses": [
      "1600 Amphitheatre Parkway, Mountain View, CA",
      "1 Apple Park Way, Cupertino, CA",
      "1 Hacker Way, Menlo Park, CA"
    ],
    "title": "Tech HQs",
    "connect_line": true
  }'

POST /api/map/route

Creates a route map between an origin and destination, with optional waypoints.

curl -X POST https://api.spatix.io/api/map/route \
  -H "Content-Type: application/json" \
  -d '{
    "origin": "San Francisco, CA",
    "destination": "Los Angeles, CA",
    "waypoints": ["Santa Cruz, CA", "San Luis Obispo, CA"],
    "title": "California Road Trip"
  }'

Get Map

GET /api/map/:id

Retrieve map data, metadata, and view count.

curl https://api.spatix.io/api/map/abc123

MCP Server

Give any AI agent the ability to create maps. Install the Spatix MCP server and your AI assistant can create, manage, and share maps directly.

Install

pip install spatix-mcp

Claude Desktop Configuration

Add this to your Claude Desktop claude_desktop_config.json:

{
  "mcpServers": {
    "spatix": {
      "command": "uvx",
      "args": ["spatix-mcp"]
    }
  }
}

Available Tools (16)

Map Creation

  • create_map — GeoJSON + title
  • create_map_from_description — natural language
  • create_map_from_addresses — address list
  • create_route_map — A-to-B routing

Geocoding

  • geocode — address to coordinates
  • reverse_geocode — coordinates to address
  • search_places — nearby POI search

Dataset Management

  • upload_dataset — publish reusable data
  • search_datasets — find public datasets
  • get_dataset — retrieve dataset data

Community

  • get_leaderboard — top contributors
  • get_my_points — your contribution score

Full docs: pypi.org/project/spatix-mcp

Supported Formats

Input Formats (API)

  • GeoJSON (Point, LineString, Polygon, FeatureCollection)
  • Coordinate arrays [[lng, lat], ...]
  • Natural language text descriptions
  • Address lists

Input Formats (File Upload)

  • GeoJSON / JSON
  • Shapefile (.zip)
  • KML / KMZ
  • GPX
  • CSV (with lat/lng or WKT columns)
  • GeoPackage (.gpkg)
  • GML
  • DXF
  • FlatGeobuf (.fgb)
  • SQLite / SpatiaLite

Output

  • Shareable URL (spatix.io/m/ID)
  • Embeddable iframe
  • Embed script tag
  • GeoJSON export

Embed Options

<!-- iframe -->
<iframe src="https://spatix.io/m/ID?embed=1"
  width="600" height="400"></iframe>

<!-- script tag -->
<div data-spatix-map="ID"></div>
<script src="https://spatix.io/embed.js"></script>

Examples

Multiple Points

import requests

# Create a map with multiple cities
response = requests.post("https://api.spatix.io/api/map", json={
    "data": [
        [-122.4194, 37.7749],
        [-118.2437, 34.0522],
        [-73.9857, 40.7484]
    ],
    "title": "US Cities"
})

map_url = response.json()["url"]
print(f"Map: {map_url}")

GeoJSON FeatureCollection

{
  "data": {
    "type": "FeatureCollection",
    "features": [
      {
        "type": "Feature",
        "geometry": { "type": "Point", "coordinates": [-122.4194, 37.7749] },
        "properties": { "name": "San Francisco", "population": 873965 }
      },
      {
        "type": "Feature",
        "geometry": { "type": "Point", "coordinates": [-118.2437, 34.0522] },
        "properties": { "name": "Los Angeles", "population": 3898747 }
      }
    ]
  },
  "title": "California Cities"
}

AI Agent — Claude Tool Use

Use Spatix as a tool in your Claude-powered agent:

tools = [{
    "name": "create_map",
    "description": "Create an interactive web map from GeoJSON data",
    "input_schema": {
        "type": "object",
        "properties": {
            "data": {"type": "object", "description": "GeoJSON data"},
            "title": {"type": "string", "description": "Map title"}
        },
        "required": ["data"]
    }
}]

# In your tool handler:
def handle_create_map(data, title="Map"):
    response = requests.post("https://api.spatix.io/api/map",
        json={"data": data, "title": title})
    return response.json()["url"]

Full OpenAPI schema available at:

GET https://api.spatix.io/api/map/schema

Auto-generated API docs: api.spatix.io/docs