Skip to content
API / Search spaces and ask questions
  1. Docs
  2. API
  3. Search spaces and ask questions

Search spaces and ask questions

Semantic search across all your spaces in any language, and questions to one space answered only from its records, with citations and evidence photos.

Open .md

Search across spaces

Terminal
curl "https://api.spacecontext.app/v1/search?q=where+did+I+see+a+ladder&limit=5" \
  -H "Authorization: Bearer $SPACECONTEXT_API_KEY"
JSON
{
  "object": "search_results",
  "query": "where did I see a ladder",
  "data": [
    {
      "space_id": "spc_3f…", "space_name": "Seaside flat", "scan_id": "scn_8a…",
      "record_type": "item", "record_id": "itm_12",
      "title": "Aluminium step ladder", "area": "Storage room",
      "text": "Aluminium step ladder, folded against the wall behind the door…",
      "score": 0.87
    }
  ]
}
Parameter
qThe question, 1–300 characters, in any language.
space_idOptional. Only this space.
limit1–25, default 10.

Records are items, areas, issues, key locations, instructions, facts and Q&A. Search is semantic (multilingual embeddings) with a reranker: “rubinetto dell’acqua” finds “water shut-off valve”. Each result points to a record you can open with GET /spaces/{space_id}.

  • A space appears once its current scan has been indexed: right after a scan completes, or, for spaces scanned with the app, after their deep pass.
  • The index holds only redacted content: results never contain a sensitive value, whatever the key’s scopes.
  • Test keys search the demo space, without a model.

Ask one space

Terminal
curl -X POST https://api.spacecontext.app/v1/spaces/spc_3f…/ask \
  -H "Authorization: Bearer $SPACECONTEXT_API_KEY" -H "Content-Type: application/json" \
  -d '{"question": "Where is the water shut-off?"}'
JSON
{
  "object": "answer",
  "space_id": "spc_3f…", "scan_id": "scn_8a…",
  "question": "Where is the water shut-off?",
  "answer": "Under the bathroom sink, behind the cupboard door.",
  "documented": true,
  "citations": [
    {
      "record_type": "key_location", "record_id": "loc_1",
      "title": "Main water valve", "area": "Bathroom",
      "evidence": [{ "frame_id": "frame-14", "timestamp_ms": 41200, "url": "https://api.spacecontext.app/v1/media/…" }]
    }
  ]
}
  • The answer uses only the space’s records. When they do not contain it, documented is false and the answer says so.
  • Every citation is a record of the document; evidence URLs are signed and expire.
  • A key without spaces:sensitive never gets a sensitive value in an answer, and the model never sees one.
  • Spaces scanned with the app answer 409 ENRICHMENT_PENDING to such a key until they are screened (usually a minute or two after the first read).
  • Up to 500 characters per question. A question counts against the daily limit only once it is going to be answered: one refused for its length, or because the space is still being screened, does not. Test keys never count.

Space Context docs · llms.txt · download Edit on GitHub

esc

↑↓ navigate↵ openesc close