Endpoints
List oracles
Every oracle this key may call. Free.
What this caller can ask, in the vocabulary they ask it in.
curl https://api.formalogic.io/v1/oracles \
-H "Authorization: Bearer $FORMA_API_KEY"import os
import httpx
response = httpx.get(
"https://api.formalogic.io/v1/oracles",
headers={"Authorization": f"Bearer {os.environ['FORMA_API_KEY']}"},
)
print(response.json())const response = await fetch('https://api.formalogic.io/v1/oracles', {
headers: {
Authorization: `Bearer ${process.env.FORMA_API_KEY}`,
},
})
console.log(await response.json())Response 200
Every oracle this key may call.
| oracles | Every oracle this key may call |
|---|---|
| oracles[].name | What you put in the ask URL |
| oracles[].description | One line, safe to show a user |
| oracles[].formats | Every value format accepts, sorted |
| oracles[].default_format | Used when you send no format |
| oracles[].drawable_formats | The formats POST /v1/figures/render can draw. An answer in any other format is source only |
| oracles[].views | Format to the views you can ask for beside its answer, such as {"lookup": ["summary"]}. Empty for an oracle with none |
Errors
| 401KEY_MISSINGKEY_UNKNOWNKEY_REVOKEDKEY_EXPIRED | The key is missing, unknown, revoked or expired — see Authentication |
|---|---|
| 403ORG_DISABLED | The key is fine and its organisation is not active — see Authentication |
Every code, and what to do about it, is on Errors.
The request is generated from the API's OpenAPI document; the response and errors are held to real responses and to the Errors page.
Response
{
"oracles": [
{
"name": "chart",
"description": "Describe a chart in plain language and get back a chart specification that has been checked against versioned rules before you see it.",
"formats": ["chartjs", "echarts", "gnuplot", "plotly", "vega-lite"],
"default_format": "vega-lite",
"drawable_formats": ["gnuplot", "vega-lite"],
"views": {}
},
{
"name": "vector-graphics",
"description": "Describe a drawing in plain language and get back vector source that has been checked against versioned rules before you see it.",
"formats": ["metapost", "pictex", "tikz"],
"default_format": "tikz",
"drawable_formats": ["metapost", "pictex", "tikz"],
"views": {}
},
{
"name": "coverage-policy",
"description": "Ask a question about the Medicare knee replacement policy (LCD L36575) and get back the rules, conditions and statements that answer it as JSON, each with the policy passage it comes from, checked against versioned rules before you see it.",
"formats": ["lookup"],
"default_format": "lookup",
"drawable_formats": [],
"views": { "lookup": ["summary"] }
}
]
}Notes
Listing costs no credits.
drawable_formats are the formats Draw a figure can draw. An answer
in any other format comes back as source only, so pick one of these when the
result has to be looked at. It is empty for coverage-policy, whose answers are JSON documents.
views names, per format, what you can ask for beside an answer by sending
views with the ask: today a summary of a coverage-policy lookup. It is
empty for an oracle with none.
The response describes what you can ask for and what it costs — nothing about how an answer is produced. That part is ours, and it changes.
The catalogue is the contract. An oracle absent from this list is not available
to your key and asking it answers 404; a format absent from formats is
refused with 422 and the response names the ones that would work.
Read this at start-up rather than hardcoding names, and a new oracle becomes available to your integration without a deploy.
What you actually have
The console shows the same list for your organisation, with a playground for each oracle.