Developer Resources

API Documentation

Integrate spatial intelligence into your applications

Spatial Intelligence API

Integrate spatial intelligence into your applications with our NLP-powered API.

Overview

The Spatial Intelligence API extracts named entities (people, organizations, locations) from text and returns enriched GeoJSON with geocoded coordinates.

FeatureDescription
NEREntity Extraction - People, orgs, locations
GEOGeocoding - Coordinates & GeoJSON
AIML Models - spaCy + BERT

Base URL

EnvironmentURL
Productionhttps://spatial.kkrl.co.uk
Developmenthttps://dev.spatial.kkrl.co.uk

Authentication

All API requests require an API key passed in the X-API-Key header.

curl -X POST https://dev.spatial.kkrl.co.uk/flow/enrich \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"items": [{"id": "req-001", "text": "Meeting in London"}]}'

Obtaining an API Key

Register at https://dev.spatial.kkrl.co.uk/register to obtain an API key. Keys are tied to a subscription tier that determines your rate limits and quotas.

Endpoints

Health Check

Check if the API is operational. No authentication required.

GET /flow/health

Response:

{
  "status": "healthy",
  "service": "nifi-flow",
  "timestamp": "2026-01-04T12:00:00Z"
}

Entity Enrichment

Extract named entities from text and return enriched GeoJSON with geocoded locations.

POST /flow/enrich
Content-Type: application/json
X-API-Key: YOUR_API_KEY

Request Body:

{
  "items": [
    {"id": "req-001", "text": "Meeting with John Smith at Google in London."}
  ],
  "options": {
    "model": "hybrid"
  }
}
FieldTypeRequiredDescription
itemsarrayYesArray of text items to analyze
items[].idstringYesUnique identifier for the item
items[].textstringYesText content to analyze
items[].metadataobjectNoOptional metadata for the item
optionsobjectNoOptional processing settings
options.modelstringNoNER model: hybrid (default), bert, spacy, legal, finance
options.utm_precisionintNoUTM coordinate precision (0-6, default: 2)
options.military_modestringNoMilitary matching: standard (default), aggressive

Response (GeoJSON):

{
  "type": "FeatureCollection",
  "features": [
    {
      "type": "Feature",
      "geometry": {
        "type": "Point",
        "coordinates": [-0.1276, 51.5074]
      },
      "properties": {
        "name": "London",
        "entity_type": "LOC",
        "confidence": 0.97
      }
    }
  ],
  "metadata": {
    "entities": [
      {"text": "John Smith", "label": "PER"},
      {"text": "Google", "label": "ORG"},
      {"text": "London", "label": "LOC"}
    ]
  }
}

Entity Types

TypeDescriptionExamples
PERPerson namesJohn Smith, Dr. Jane Doe
ORGOrganizationsGoogle, United Nations
LOCLocationsLondon, Mount Everest
GPEGeopolitical entitiesUnited Kingdom, Texas
MISCMiscellaneousProject Apollo, COVID-19

Rate Limits

Rate limits are enforced per API key based on your subscription tier.

TierRate LimitDaily QuotaMonthly Price
Starter10 req/sec10,000£49
Professional50 req/sec100,000£199
Enterprise100 req/secUnlimitedCustom

Rate Limit Headers

All responses include rate limit information:

X-RateLimit-Limit: 10000
X-RateLimit-Remaining: 9500
X-RateLimit-Reset: 1704369600

Code Examples

Python

import requests

response = requests.post(
    "https://dev.spatial.kkrl.co.uk/flow/enrich",
    headers={
        "X-API-Key": "YOUR_API_KEY",
        "Content-Type": "application/json"
    },
    json={
        "items": [{"id": "req-001", "text": "Meeting in London with John Smith"}],
        "options": {"model": "hybrid"}
    }
)

data = response.json()
# GeoJSON response with entities in metadata
for entity in data["metadata"]["entities"]:
    print(f"{entity['label']}: {entity['text']}")

JavaScript

const response = await fetch('https://dev.spatial.kkrl.co.uk/flow/enrich', {
  method: 'POST',
  headers: {
    'X-API-Key': 'YOUR_API_KEY',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    items: [{ id: 'req-001', text: 'Meeting in London with John Smith' }],
    options: { model: 'hybrid' }
  })
});

const data = await response.json();
// GeoJSON response with entities in metadata
data.metadata.entities.forEach(e => console.log(`${e.label}: ${e.text}`));

cURL

curl -X POST https://dev.spatial.kkrl.co.uk/flow/enrich \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"items": [{"id": "req-001", "text": "Meeting in London with John Smith"}]}' | jq .

Error Codes

CodeDescription
400Bad Request - Invalid input
401Unauthorized - Missing API key
403Forbidden - Invalid API key
429Too Many Requests - Rate limit exceeded
500Internal Server Error

Error Response Format

{
  "error": "Rate limit exceeded",
  "retry_after": 60
}

Support

Ready to get started?

Try the API with our interactive demo or contact us for an API key.