Space Context Scans API
The Scans API from Space Context — 5 operation(s) for scans.
The Scans API from Space Context — 5 operation(s) for scans.
Every API here is available over the APIs.io API and to AI agents over MCP.
One button, every client — Claude, Cursor, VS Code and the rest.
https://apis.io/mcp
find_apisBrowse and filter every API in the catalog.get_api_artifactsOne API's artifacts, grouped by type.get_openapiThe primary OpenAPI for this API.find_similar_apisAPIs that look like this one.apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.resolveTurn a domain, URL or GitHub org into the provider it belongs to.find_cohortsEvery scored population of providers in the catalog.curl "https://apis.io/api/v1/apis/spacecontext-app:spacecontext-app-scans-api"
curl "https://apis.io/api/v1/apis?limit=25"
Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.
Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.
A second provider on the same verified email joins the account you already have.
openapi: 3.2.0
info:
title: Space Context Scans API
version: v1
servers:
- url: https://api.spacecontext.app/v1
tags:
- name: Scans
paths:
/scans/{id}:
get:
operationId: getScan
summary: Status of a scan
description: 'Poll until `status` is `complete` or `failed`. A failed scan costs nothing: it is charged at start and refunded on failure, and `charge.refunded` says so. Needs `scans:read`.'
security:
- apiKey: []
parameters:
- name: id
in: path
required: true
schema:
type: string
pattern: ^scn_[0-9a-f]{32}$
responses:
'200':
description: Scan
headers:
Cache-Control:
schema:
type: string
content:
application/json:
schema:
$ref: '#/components/schemas/Scan'
'401':
$ref: '#/components/responses/ErrorResponse'
'403':
$ref: '#/components/responses/ErrorResponse'
'404':
$ref: '#/components/responses/ErrorResponse'
'429':
$ref: '#/components/responses/RateLimited'
tags:
- Scans
delete:
operationId: cancelScan
summary: Cancel a scan that has not started
description: Nothing was charged; its uploads are deleted. Needs `scans:write`.
security:
- apiKey: []
parameters:
- name: id
in: path
required: true
schema:
type: string
pattern: ^scn_[0-9a-f]{32}$
responses:
'204':
description: Cancelled
'401':
$ref: '#/components/responses/ErrorResponse'
'403':
$ref: '#/components/responses/ErrorResponse'
'404':
$ref: '#/components/responses/ErrorResponse'
'409':
$ref: '#/components/responses/ErrorResponse'
'429':
$ref: '#/components/responses/RateLimited'
tags:
- Scans
/scans/{id}/events:
get:
operationId: streamScanEvents
summary: Follow a scan in real time
description: 'A `text/event-stream` (Server-Sent Events) that sends the scan (the same object as `GET /scans/{id}`, without `upload`) as an event named `scan` at once, then every time its status, stage or error changes, and closes after the final one (`complete`, `failed` or `cancelled`). A `ping` event every 15 seconds keeps the connection alive. One stream lasts at most 30 minutes; reconnect to keep following. An account holds at most 10 streams open at once (by default): one more answers 429 with `Retry-After`; close one, or poll `GET /scans/{id}`. Needs `scans:read`.'
security:
- apiKey: []
parameters:
- name: id
in: path
required: true
schema:
type: string
pattern: ^scn_[0-9a-f]{32}$
responses:
'200':
description: 'Event stream: `event: scan` with the scan as JSON data; `event: ping` with no data.'
headers:
Cache-Control:
schema:
type: string
Content-Type:
schema:
type: string
enum:
- text/event-stream
content:
text/event-stream:
schema:
type: string
'401':
$ref: '#/components/responses/ErrorResponse'
'403':
$ref: '#/components/responses/ErrorResponse'
'404':
$ref: '#/components/responses/ErrorResponse'
'429':
$ref: '#/components/responses/RateLimited'
tags:
- Scans
/scans/{id}/frames/{index}:
put:
operationId: uploadScanFrame
summary: Upload one frame of a frames scan
description: 'The raw image as the body: JPEG, PNG or WebP (recognised by its bytes), at most 2 MB. Sending a frame again replaces it. A test scan checks the frame the same way and only records that it arrived: nothing of a test scan is stored (its result is the demo). Needs `scans:write`.'
security:
- apiKey: []
parameters:
- name: id
in: path
required: true
schema:
type: string
pattern: ^scn_[0-9a-f]{32}$
- name: index
in: path
required: true
schema:
type: integer
minimum: 0
maximum: 119
requestBody:
required: true
content:
image/jpeg:
schema:
type: string
format: binary
image/png:
schema:
type: string
format: binary
image/webp:
schema:
type: string
format: binary
responses:
'200':
description: Frame stored
content:
application/json:
schema:
$ref: '#/components/schemas/ScanUpload'
'400':
$ref: '#/components/responses/ErrorResponse'
'401':
$ref: '#/components/responses/ErrorResponse'
'403':
$ref: '#/components/responses/ErrorResponse'
'404':
$ref: '#/components/responses/ErrorResponse'
'409':
$ref: '#/components/responses/ErrorResponse'
'413':
$ref: '#/components/responses/ErrorResponse'
'415':
$ref: '#/components/responses/ErrorResponse'
'429':
$ref: '#/components/responses/RateLimited'
tags:
- Scans
/scans/{id}/video:
put:
operationId: uploadScanVideo
summary: Upload the video of a video scan through the API
description: 'Only when `upload.url` points here (no direct upload link available; always for a test scan, whose video is counted and dropped, never stored). `Content-Length` and `Content-Type` must match what was declared, and the body must be that size. At most 99614720 bytes (95 MiB): a bigger video answers 413 `FILE_TOO_LARGE` and goes to the direct upload link instead. Needs `scans:write`.'
security:
- apiKey: []
parameters:
- name: id
in: path
required: true
schema:
type: string
pattern: ^scn_[0-9a-f]{32}$
requestBody:
required: true
content:
video/mp4:
schema:
type: string
format: binary
video/quicktime:
schema:
type: string
format: binary
video/x-m4v:
schema:
type: string
format: binary
video/3gpp:
schema:
type: string
format: binary
video/webm:
schema:
type: string
format: binary
video/x-matroska:
schema:
type: string
format: binary
video/matroska:
schema:
type: string
format: binary
responses:
'200':
description: Video stored
content:
application/json:
schema:
$ref: '#/components/schemas/ScanUpload'
'400':
$ref: '#/components/responses/ErrorResponse'
'401':
$ref: '#/components/responses/ErrorResponse'
'403':
$ref: '#/components/responses/ErrorResponse'
'404':
$ref: '#/components/responses/ErrorResponse'
'409':
$ref: '#/components/responses/ErrorResponse'
'413':
$ref: '#/components/responses/ErrorResponse'
'415':
$ref: '#/components/responses/ErrorResponse'
'429':
$ref: '#/components/responses/RateLimited'
tags:
- Scans
/scans/{id}/start:
post:
operationId: startScan
summary: Charge the scan and start the analysis
description: 'Checks that every frame (or the video) is uploaded, uses the free scan or charges the wallet, and starts the analysis. Answers 202 when it started the scan and 200 when the scan had already started. A failed analysis is refunded. Errors: 402 `PAYMENT_METHOD_REQUIRED` (a live scan needs a card on file: added in the console, nothing charged), `INSUFFICIENT_FUNDS` or `SPENDING_CAP_REACHED`, 409 `UPLOAD_INCOMPLETE`, 429 `SCANS_IN_PROGRESS`, 429 `RATE_LIMIT_EXCEEDED` with `Retry-After` when 5 live scans of the account failed that day because of their footage (no usable frame, an unreadable or too long video, nothing recognisable: each refunded) until midnight UTC, 503 `PAYMENTS_UNAVAILABLE` (a live scan where payments are not configured). Test keys are never charged and get the demo result. Needs `scans:write`.'
security:
- apiKey: []
parameters:
- name: id
in: path
required: true
schema:
type: string
pattern: ^scn_[0-9a-f]{32}$
responses:
'200':
description: Already started
headers:
Cache-Control:
schema:
type: string
content:
application/json:
schema:
$ref: '#/components/schemas/Scan'
'202':
description: Started
headers:
Cache-Control:
schema:
type: string
content:
application/json:
schema:
$ref: '#/components/schemas/Scan'
'401':
$ref: '#/components/responses/ErrorResponse'
'402':
$ref: '#/components/responses/ErrorResponse'
'403':
$ref: '#/components/responses/ErrorResponse'
'404':
$ref: '#/components/responses/ErrorResponse'
'409':
$ref: '#/components/responses/ErrorResponse'
'429':
$ref: '#/components/responses/RateLimited'
'503':
$ref: '#/components/responses/ErrorResponse'
tags:
- Scans
components:
responses:
RateLimited:
description: Too many requests. Retry after the number of seconds in `Retry-After`.
headers:
Retry-After:
schema:
type: integer
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
ErrorResponse:
description: Error response
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
schemas:
ScanUpload:
type: object
required:
- object
- scan_id
- bytes
properties:
object:
type: string
enum:
- scan_frame
- scan_video
scan_id:
type: string
index:
type: integer
bytes:
type: integer
content_type:
type: string
Error:
type: object
required:
- error
properties:
error:
type: object
required:
- code
- message
- request_id
properties:
code:
type: string
message:
type: string
request_id:
type: string
retry_after:
type: integer
description: 'On a 429: seconds to wait, as in `Retry-After`.'
daily_limit:
type: integer
description: 'On a 429 for a daily allowance: the allowance (it resets at midnight UTC).'
max_streams:
type: integer
description: 'On a 429 from `GET /scans/{id}/events`: the streams an account may hold open at once.'
max_open_scans:
type: integer
description: 'On a 429 from `POST /spaces/{id}/scans`: the scans an account may hold created and not started.'
additionalProperties: true
Scan:
type: object
required:
- object
- id
- space_id
- livemode
- status
- stage
- input
- charge
- error
- upload
- created_at
- started_at
- completed_at
properties:
object:
type: string
const: scan
id:
type: string
pattern: ^scn_[0-9a-f]{32}$
space_id:
type: string
livemode:
type: boolean
status:
type: string
enum:
- awaiting_upload
- queued
- processing
- complete
- failed
- cancelled
stage:
type:
- string
- 'null'
enum:
- ingesting
- screening
- observing
- fusing
- enriching
- saving
- verifying
- null
input:
type: object
required:
- kind
- language
- frame_count
- video
- has_transcript
properties:
kind:
type: string
enum:
- frames
- video
language:
type: string
enum:
- en
- it
- es
- fr
- de
- pt
- nl
description: The language the report is written in.
frame_count:
type:
- integer
- 'null'
video:
type:
- object
- 'null'
properties:
content_type:
type: string
content_length:
type: integer
has_transcript:
type: boolean
charge:
type: object
required:
- kind
- price_cents
- refunded
properties:
kind:
type:
- string
- 'null'
enum:
- free_scan
- scan_charge
- null
price_cents:
type: integer
refunded:
type: boolean
error:
type:
- object
- 'null'
properties:
code:
type: string
message:
type: string
upload:
type:
- object
- 'null'
properties:
kind:
type: string
enum:
- frames
- video
method:
type: string
const: PUT
url:
type: string
url_template:
type: string
headers:
type: object
description: Headers the PUT must carry. Content-Length must equal the declared size (HTTP clients set it from the body).
additionalProperties:
type: string
frame_count:
type: integer
max_bytes:
type: integer
content_types:
type: array
items:
type: string
expires_at:
type: string
format: date-time
description: 'Direct upload links only: the link must be used (the PUT started) within 15 minutes; an upload begun in time completes. Past it, `GET /scans/{id}` (with `scans:write`) gives a fresh link while the scan waits for its upload.'
created_at:
type:
- string
- 'null'
format: date-time
started_at:
type:
- string
- 'null'
format: date-time
completed_at:
type:
- string
- 'null'
format: date-time
securitySchemes:
apiKey:
type: http
scheme: bearer
bearerFormat: sc_live or sc_test