Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.
Get an API 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.
openapi: 3.2.0
info:
title: Starwell Answer API
version: 1.0.0
description: 'Verified official statistics for AI agents and applications: harmonized series with provenance on every observation, a verification status on every series, computed answers cited to the official source table, and webhooks on series movement. Series whose license does not permit redistribution are excluded from every surface; direct requests for them return 451.'
termsOfService: https://starwell.dev/terms
servers:
- url: https://starwell.dev/api/starwell
security:
- apiKey: []
- {}
tags:
- name: Answer
paths:
/v1/answer:
post:
summary: 'The flagship: a computed, cited answer from verified data.'
security:
- apiKey: []
description: Real Python runs in a sandbox over the verified store — nothing is model-estimated. Returns the answer, the chart, the code, and per-series verification + citations. Refuses honestly (422) when no served series can answer. 10-40s on a cache miss; cached answers serve instantly and invalidate when the official data moves. mode:'deep' plans 3-4 orthogonal analyses (trend, statistics, outliers, cross-series relationships), runs each in the sandbox, and synthesizes one decision-ready report with per-section stdout, code, and charts (60-180s; cached separately from default answers). Requires an API key — free at /account; keyless calls return 401 code key_required. A keyless sample lives at GET /v1/answer/demo.
requestBody:
required: true
content:
application/json:
schema:
type: object
required:
- question
properties:
question:
type: string
minLength: 3
maxLength: 500
series:
type: array
maxItems: 6
items:
type: object
properties:
source:
type: string
seriesId:
type: string
description: 'Optional: pin exact series and skip AI resolution.'
start:
type: string
format: date
end:
type: string
format: date
source:
type: string
description: 'Optional: restrict resolution to one source.'
mode:
type: string
enum:
- default
- deep
default: default
description: '''deep'': planned multi-section report — every section is real sandbox-computed Python, synthesized into one cited answer.'
responses:
'200':
description: 'Computed answer with python, chart, citations, verification badges, and honest coverage meta. meta also carries the scope-honesty fields, each present only when it applies: truncatedSeries (daily series capped at the latest 6,000 points), uncoveredSubjects (subjects the question asked about that no served series answers), emptySeries (resolved series with no observations in the window), failingSeriesUsed (series failing verification at compute time), and degraded (true when the sandbox run reported an internal issue and its fallback was served — never dressed as full confidence). In mode:''deep'', data.sections[] carries each analysis (title, stdout, python, charts, ok, degraded).'
'400':
$ref: '#/components/responses/BadRequest'
'401':
description: Missing or invalid API key (code key_required). Keys are free at /account.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'422':
description: No served series answers this question (never an invented number).
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'429':
$ref: '#/components/responses/RateLimited'
tags:
- Answer
operationId: postV1Answer
x-operation-id-source: derived
components:
responses:
BadRequest:
description: Invalid parameters.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
RateLimited:
description: Per-IP preview limit or key quota exceeded.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
schemas:
Error:
type: object
required:
- success
- error
properties:
success:
type: boolean
const: false
code:
type: string
description: Machine-readable error code, when applicable.
error:
type: string
securitySchemes:
apiKey:
type: http
scheme: bearer
description: 'Optional: anonymous callers get per-IP preview limits; keys (dlk_live_...) get daily tier quotas with usage metering. Also accepted as X-API-Key. Free keys come with an account at /account.'