Skip to content

Hosted API limits and uptime

The community API at https://api.umbra-py.space/ is umbra serve --public on Railway. The catalog index is rebuilt by the Publish catalog index workflow (Mondays 06:17 UTC) and published on the catalog-index GitHub release. This page is the operational contract for that host.

There is no service-level agreement and no credits. The uptime target below is best effort.

Uptime

Target: 99% monthly uptime, best effort.

Uptime is measured by an external probe, not by the process's own view of itself. GitHub Actions requests GET /healthz on a */15 cron. GitHub often starts that cron hours late; the history records when the probe actually ran. A probe counts as up when the response is HTTP 200 and degraded is false. Latency is stored with each result. The client waits 60 seconds. A timeout is a failed probe and the opened issue says so. A catalog read that misses the server's own deadline is HTTP 503, which is also a failed probe.

/healthz is readiness: the same JSON document as before, including ready, degraded, and stale. /livez (and /healthz/live) is liveness: {"status":"ok"}, no catalog read. Railway's deploy check uses /livez. /readyz and /healthz/ready are the same document as /healthz.

/healthz, /livez, and /readyz do not count against the rate limit.

Results are appended to healthz.jsonl on the monitoring branch. That branch is not main. One bad probe fails the Actions run. Three consecutive failures (about 45 minutes) open or update a GitHub issue, and the issue is commented on at most every 12 hours while the failure holds. A recovery closes it.

An uptime percentage is not published until that file covers 7 days.

degraded: true means the thumbnail sidecar did not merge. Search still answers; the probe counts it as down so a preview gap is visible. Only an index that exists but cannot be opened is HTTP 503.

Freshness

/healthz includes built_at (the index build date, YYYY-MM-DD) and snapshot (the published catalog.db ETag). It also sets stale: true when built_at is missing or more than 9 days before today (UTC). A build exactly 9 days old is still fresh. The weekly job runs every 7 days, so 9 days means a Monday publish was missed.

stale: true is still HTTP 200. It is not downtime. The same probe opens a separate issue for it. ok in healthz.jsonl stays true when the API is up and the index is stale.

The same two values are on the STAC collection GET /collections/umbra-open-data:

  • umbra-py:built_at — the build date
  • umbra-py:snapshot — the ETag
  • updated — that date at midnight UTC (2026-10-08T00:00:00Z). The midnight is the date. The workflow does not store a clock time.

They are omitted when the process has no index stamp (live mode, or a server that is still fetching).

Rate limit

120 requests per minute, sustained, per client IP, with a burst of 16. That is a token bucket. PUBLIC_RATE_LIMIT tokens refill across the 60-second window (PUBLIC_RATE_WINDOW_S); the bucket holds PUBLIC_RATE_BURST tokens. A client may spend the burst at once, including several /search calls in parallel, and then continues at about 2 requests per second. The average stays 120 requests per minute. A --rate-limit lower than the burst uses that lower number as the burst. --rate-limit 0 disables the limit.

A client is the address Railway's edge accepted. --public reads X-Real-IP and ignores Authorization. A bearer token is not a separate bucket. X-Forwarded-For is only the fallback: the rightmost UMBRA_TRUSTED_PROXY_HOPS entries (default 1), never the leftmost. Railway overwrites X-Real-IP and does not promise a fixed hop count, so leave that fallback at the default. IPv4 is the full address. IPv6 collapses to its /64. A loopback peer (a laptop --public with no proxy) ignores those headers and is keyed on the socket address.

These paths do not count: /healthz, /healthz/live, /healthz/ready, /livez, /readyz, /docs, /openapi.json, /redoc.

Over the cap the response is HTTP 429, body RateLimited. message states the sustained rate and the burst (sustained 120 requests/min per IP, burst 16). hint says to call serially or back off and honor Retry-After (integer seconds until one token is free), or to run umbra index fetch and search locally, which has no rate limit. X-RateLimit-Limit is the sustained allowance. X-RateLimit-Remaining is whole tokens left in the bucket. The bucket is per process. A request body over 1 MiB counts as well (HTTP 413, or 429 when that hit crosses the cap).

Concurrent catalog reads

One client may hold 8 catalog reads at once (PUBLIC_CLIENT_CONCURRENCY). A further read is HTTP 429, body RateLimited, before it takes a database slot. message states that cap (and, when the token bucket is on, the sustained rate and burst). hint is the rate-limit hint: call serially or back off and honor Retry-After (1 second), or run umbra index fetch and search locally. The process still runs UMBRA_DB_CONCURRENCY catalog reads at once (default 4). A read that finds every slot taken waits for one to free, up to UMBRA_DB_ACQUIRE_TIMEOUT (default 3 seconds). At most twice UMBRA_DB_CONCURRENCY reads may be waiting; a further read is HTTP 503 at once. That wait holds the caller's in-flight slot, so one IP cannot queue more than its cap. If no slot frees in time the response is HTTP 503, body Busy, with Retry-After. message states the process cap and how long the call waited. hint is the same pacing hint. A read that passes UMBRA_REQUEST_TIMEOUT_S (default 15s) is HTTP 503 with Retry-After and that same hint, and the SQLite statement is interrupted so the slot is released.

Page size

limit defaults to 10. On this host, /search and /collections/{id}/items return at most 500 items (PUBLIC_SEARCH_LIMIT). A larger numeric limit is clamped, not rejected, including a number above 10,000, and the next link advances by that page. A self-hosted server without --public still accepts up to 10,000 (MAX_LIMIT). GET /sites ranks sites, and its top parameter caps at 100. Its limit sizes a live-backend pool and is ignored on the index, so it is not part of the page cap.

MCP search_catalog keeps its argument and its default of 20. On this host a limit above 100 is clamped to 100 and the result includes note telling the caller to take the next page. A default call has no note.

Request body

POST bodies larger than 1 MiB (PUBLIC_MAX_BODY_BYTES) are HTTP 413 and are not parsed. On this host, a POST /search body with the wrong JSON types (a non-numeric token or limit, a non-array ids, a scalar where an object is required, NaN/Infinity, or nesting the parser cannot walk) is HTTP 400. A numeric limit or token outside the page range is clamped. A server without --public keeps the previous body handling.

Geocoding

Public geocode_place, a place filter, and an area that falls back to geocoding share one Nominatim throttle of about 1 request per second and one LRU cache of 256 names. A repeated name does not call out. A place that does not resolve is remembered for about 10 minutes. A miss that would spend more than about 5 seconds waiting for the in-flight call and the gap, or join more than 5 waiters, fails immediately. geocode_place and a place filter return that as an error. An area fallback that is busy, cannot reach Nominatim, or finds the quick outbound pool full returns the empty result with hint no task named X; geocoding was unavailable instead. A live catalog's task-name check takes a long outbound permit, the same pool as the catalog walk; an index check does not. A cached name does not take a quick outbound permit. GET/POST /search keeps that fallback's Nominatim wait and HTTP timeout inside half the request deadline, so a slow geocode is the unavailable hint rather than HTTP 503. /sites is not on that deadline. Local umbra serve uses the same cache, without the throttle, so a next link does not geocode again. Local MCP place= and the CLI call Nominatim directly.

STAC links[].href on this host uses UMBRA_PUBLIC_BASE_URL when that optional variable is a bare http(s)://host[:port] origin (a trailing slash is removed). Any other value is ignored. When it is unset, --public builds the origin from X-Forwarded-Proto and X-Forwarded-Host (or Host) if the socket peer is not loopback. Railway's edge overwrites those headers, which is how https://api.umbra-py.space stays the link base without a new variable. The same proto is what GET /mcp/ redirects with, so the trailing-slash redirect stays https. A loopback peer, or a header that is not http/https plus a plain host, keeps the request URL. A server without --public does not read UMBRA_PUBLIC_BASE_URL.

CORS

The server is read-only. Browser clients on another origin, including a static umbra demo page, can call it. A fetch() of GET /search is in From a browser.

Setting Value
allow_origins *
allow_methods GET, POST, OPTIONS
allow_headers *
expose_headers Link, Retry-After, X-RateLimit-Limit, X-RateLimit-Remaining, X-Umbra-Attribution, X-Umbra-License
preflight Access-Control-Max-Age 600 (seconds)
credentials not allowed (* origins cannot be credentialed)

Every response also sends X-Umbra-License, X-Umbra-Attribution, and Link: rel="license". An OPTIONS preflight sends Access-Control-Max-Age: 600, so a browser may reuse that answer for 600 seconds. The server does not pass max_age; 600 is the CORS middleware default. GET /search with no custom headers does not send a preflight. GET /stats is the same kind of request: the docs site fetches it with fetch() and no custom headers.

Usage stats

GET /stats returns a small JSON document. The docs home page reads https://api.umbra-py.space/stats and, if that fetch fails or takes longer than a few seconds, shows a quiet "stats unavailable" line. The same token bucket as every other route applies. /stats is not a health check.

The process recomputes the document at most once an hour and sends Cache-Control: public, max-age=3600. Until that hour is up it serves the copy it already computed.

GET /stats is mounted only by umbra serve --public. A local umbra serve does not start the counter, write usage-stats.json, or serve the route.

searches_served counts, since counting_since, the first page of a successful GET or POST /search and one successful call to each of these MCP tools: search_catalog, find_repeat_sites, find_similar, find_similar_text, and watch_site. A first page is a request with no paging token or offset, or with that value at zero. A later page is the same search and is not counted again. An HTTP 200 with no features still counts. That timestamp is when the counter file was first created. The total starts at zero then. It is not backfilled and it is not an estimate. These do not count: any path other than /search (including /livez, /healthz, and exploit probes); HEAD and OPTIONS; HTTP 429 and any error status; a request carrying X-Umbra-Smoke: 1 (or true / yes / on), which is what this project's replace-crawler canary sends; user agents that look like uptime monitors or bots, including this project's own umbra-py-healthz-monitor and umbra-py-mcp-smoke; MCP tools that read one item or the index, render, or stamp a description. A blank user agent is not counted. A request that does not clearly qualify is not counted.

scenes_indexed, thumbnails, and index_built_at are read from the catalog index and the thumbnail sidecar this process loaded. They are null when that read fails. generated_at is when the cached document was built.

top_places is at most ten coarse names. A name is included only when at least three distinct clients reached it on the same UTC day. The published figure is the high-water mark of that daily count. A client is a salted hash of the address the rate limiter already uses. The salt is random, kept in memory, and replaced each UTC day. It is not written. The file stores the coarse name and the count. It does not store the hash, the address, the user agent, or the query.

A place name comes from geocoder output (resolved_place or display_name) or from a bbox or intersects geometry whose centre is within one degree of a place label already baked into the index. The box must be at most five degrees on a side. The label is reduced to a city and a country; a segment that looks like a street is dropped. When the geocoder returns address components, the published name uses the city, town, village, or county, then the state or region and the country. A point of interest is not published under the venue's name: a result whose class is not a settlement or an admin area keeps the state and country, or just the country. A free-text place= argument is not stored. When a request also has a bbox, geocoding is skipped, so that text never becomes a published place. A task name that was not geocoded is not a place.

The counters are kept in usage-stats.json beside catalog.db on the /data volume (XDG_CACHE_HOME, or UMBRA_INDEX_DB when that is set). The request path only updates memory. A background thread writes the file, and shutdown writes whatever is left, so one search does not wait on a write. Names that never reach three clients are dropped when the UTC day changes, and the file keeps at most 2,000 names. A file that cannot be read, or is over a megabyte, is renamed aside instead of being overwritten with a zero. If the volume cannot be written, /stats still answers from memory and the next restart starts from zero.

This document does not include an uptime percentage or a count of 5xx responses over 30 days. The process does not record either. Uptime is the external probe history on the monitoring branch, described above. 5xx responses are only in the log stream.

Baked thumbnails

GET /artifacts/thumbnail/{item_id}.png returns a PNG already stored in the local thumbnail sidecar. It does not read Umbra's bucket, render a quicklook, or fall back to another picture. A missing bake, including an unknown or odd id, is HTTP 404 (No baked thumbnail). The response sends Cache-Control: public, max-age=86400. HEAD on the same path returns that status and those headers with an empty body (Content-Length is the PNG size on 200) and counts toward the same limit. The URL is the item id, not a content hash, so the PNG is not marked immutable: a later sidecar can replace the bytes for that id. The same CORS headers as the rest of this API apply. Each GET counts toward the 120/min limit: a grid of N thumbnails costs N requests, so page modestly and rely on the one-day cache. It does not take one of the eight concurrent catalog-read slots (a browser fetches several images at once).

/search, /collections/umbra-open-data/items, and /collections/umbra-open-data/items/{item_id} add assets.thumbnail (href on this host, type: image/png, roles: ["thumbnail"]) only when that item has a bake. An item without one has no thumbnail asset; show a placeholder. On-demand /artifacts/quicklook and the other /artifacts/* routes stay off. A browser example that renders assets.thumbnail.href is in From a browser.

Bulk use and outages

Do not page /search for a full catalog. Take the weekly snapshot instead, including when this API is down. Download it with umbra index fetch (flags --db, --url, --insecure-url, --if-changed, and --force; --force only with --if-changed) from catalog.db, then search it with umbra search --local. The local index page says what each flag does. catalog.sha256 is the GNU sha256sum manifest beside that file. umbra index fetch checks catalog.db against it when the manifest is present, and warns and continues when the manifest is missing. umbra serve --public writes catalog.rtree.db next to catalog.db at startup. A tight bbox search reads it, and so does a deep page of a smaller box; a wide first page keeps the ordered index scan. The file is local: fetch does not download it, and catalog.sha256 does not list it. It is rebuilt when the snapshot id in /healthz (or, with no recorded snapshot, the catalog file's size and mtime) or the item count changes. If the build fails, search uses the same results without it.

GitHub redirects /releases/download/catalog-index/<file> at the current asset:

File Use
catalog.db The snapshot umbra index fetch downloads. umbra search --local reads it.
catalog.sha256 GNU sha256sum manifest listing catalog.db. umbra index fetch checks catalog.db against it when the manifest is present, and warns and continues when the manifest is missing.
umbra-open-data.parquet DuckDB, geopandas, pyarrow, or rustac. File metadata carries umbra-py:built_at and umbra-py:snapshot. Those are not columns.
coverage.md / coverage.json Indexed vs bucket acquisitions by prefix and product, the 99% publication bar, quarantined rows with reasons, the duplicate-id count, and republished-capture groups (linked, not dropped). See Local index.
index-validation.md / index-validation.json The same quarantine, duplicate-id, and republished-capture rows from the build

Data on that release is Umbra open data, CC BY 4.0. This host is not an Umbra product.

If an application probes /mcp as a canary, the core tool names stay stable through every 0.x minor. See Stable tools.

MCP tool logs

umbra serve writes one JSON object per MCP tool call to stdout. The msg field is mcp_tool. Railway's log explorer rewrites msg to message, so filters use @message. The same logger writes mcp_request (each POST /mcp) and stac_search (each /search). Those lines record client_ip. On this host that is X-Real-IP, or the trusted X-Forwarded-For hop (UMBRA_TRUSTED_PROXY_HOPS, default 1) when X-Real-IP is absent. client_net is only on mcp_tool, and it is the hash of that same address.

A tool line has:

Field Meaning
tool Tool name
duration_ms Milliseconds, including argument validation
outcome ok, or the exception class (ValueError, ToolError, …)
result_count The result's count, or the length of items / sites / matches / passes / results / features when that is how the reply is shaped. Otherwise null
client_name, client_version initialize clientInfo when that handshake shares the connection. Otherwise the User-Agent product token (name/version). Comments in the User-Agent are not logged
session_id mcp-session-id when the client sent a token of letters, digits, _, and -. This host is stateless, so the field is usually null
argument_keys Argument names. Not the values
limit Present when limit is an integer from 0 to 10000000
collection Present when collection or collections is a short token such as umbra-open-data
bbox, place True when that argument was set. The coordinates and the place name are not logged
client_net First 16 hex characters of SHA-256 over 24:<IPv4 /24> or 64:<IPv6 /64> of the same address client_ip records. An IPv4-mapped IPv6 address uses the IPv4 /24. The public host stores an IPv6 client as its /64, and that network hashes the same as any address inside it. The address is not logged. The same prefix hashes the same on every replica

level is error when outcome is not ok, and info otherwise. @level:error AND @message:mcp_tool is the failed tool calls.

Recompute a prefix hash:

import hashlib
import ipaddress

ip = ipaddress.ip_address("203.0.113.7")
net = ipaddress.ip_network(f"{ip}/24", strict=False)
print(hashlib.sha256(f"24:{net.network_address}".encode()).hexdigest()[:16])

In the Railway log explorer (Observability) or railway logs:

@message:mcp_tool
@message:mcp_tool AND @tool:search_catalog
@message:mcp_tool AND @outcome:ValueError
@message:mcp_tool -@outcome:ok
@message:mcp_tool AND @duration_ms:>=1000
@message:mcp_tool AND @bbox:true
@message:mcp_tool AND @client_net:<hash>

Railway's HTTP log stream (@srcIp, @path) is the edge's own record and is separate from these lines. The process access log is also separate.