API: Scripted search
Research driven by a generated script: start a job, follow the live script and progress stream, and read the cited report.
Every HTML route returns JSON with Accept: application/json. Authentication: session cookie, X-API-KEY, Authorization: Bearer or Basic.
/scriptedsearchguestQuestion form, live script view, progress, report and recent runs.
curl -X GET -H 'Accept: application/json' 'https://molodetz.nl/scriptedsearch'
const response = await fetch("/scriptedsearch", { method: "GET", headers: { "Accept": "application/json" } });
console.log(await response.json());
import httpx
print(httpx.request("GET", BASE + "/scriptedsearch", headers={"Accept": "application/json", "X-API-KEY": API_KEY}).json())
{
"jobs": [],
"mode": "scriptedsearch"
}
Not sent yet.
/scriptedsearch/jobsMemberThe signed-in member's jobs, newest first.
curl -X GET -H 'Accept: application/json' -H 'X-API-KEY: YOUR_API_KEY' 'https://molodetz.nl/scriptedsearch/jobs'
const response = await fetch("/scriptedsearch/jobs", { method: "GET", headers: { "Accept": "application/json" } });
console.log(await response.json());
import httpx
print(httpx.request("GET", BASE + "/scriptedsearch/jobs", headers={"Accept": "application/json", "X-API-KEY": API_KEY}).json())
{
"jobs": []
}
Not sent yet.
/scriptedsearch/jobsMemberStarts a background job for the question. One running job per member.
| Field | Type | Location | Required |
|---|---|---|---|
query | string | body | yes |
curl -X POST -H 'Accept: application/json' -H 'X-API-KEY: YOUR_API_KEY' -H 'Content-Type: application/json' -d '{"query": ""}' 'https://molodetz.nl/scriptedsearch/jobs'
const response = await fetch("/scriptedsearch/jobs", { method: "POST", headers: { "Accept": "application/json" } });
console.log(await response.json());
import httpx
print(httpx.request("POST", BASE + "/scriptedsearch/jobs", headers={"Accept": "application/json", "X-API-KEY": API_KEY}).json())
{
"status": "running",
"uid": ""
}
Not sent yet.
/scriptedsearch/jobs/{uid}MemberStatus and, when finished, the parsed report, sources and script.
curl -X GET -H 'Accept: application/json' -H 'X-API-KEY: YOUR_API_KEY' 'https://molodetz.nl/scriptedsearch/jobs/{uid}'
const response = await fetch("/scriptedsearch/jobs/{uid}", { method: "GET", headers: { "Accept": "application/json" } });
console.log(await response.json());
import httpx
print(httpx.request("GET", BASE + "/scriptedsearch/jobs/{uid}", headers={"Accept": "application/json", "X-API-KEY": API_KEY}).json())
{
"result": {},
"status": "done"
}
Not sent yet.
/scriptedsearch/jobs/{uid}/cancelMemberStops a running job; its events stay readable.
curl -X POST -H 'Accept: application/json' -H 'X-API-KEY: YOUR_API_KEY' -H 'Content-Type: application/json' -d '{}' 'https://molodetz.nl/scriptedsearch/jobs/{uid}/cancel'
const response = await fetch("/scriptedsearch/jobs/{uid}/cancel", { method: "POST", headers: { "Accept": "application/json" } });
console.log(await response.json());
import httpx
print(httpx.request("POST", BASE + "/scriptedsearch/jobs/{uid}/cancel", headers={"Accept": "application/json", "X-API-KEY": API_KEY}).json())
{
"status": "cancelled"
}
Not sent yet.
/scriptedsearch/jobs/{uid}MemberDeletes a finished job with its events.
curl -X DELETE -H 'Accept: application/json' -H 'X-API-KEY: YOUR_API_KEY' 'https://molodetz.nl/scriptedsearch/jobs/{uid}'
const response = await fetch("/scriptedsearch/jobs/{uid}", { method: "DELETE", headers: { "Accept": "application/json" } });
console.log(await response.json());
import httpx
print(httpx.request("DELETE", BASE + "/scriptedsearch/jobs/{uid}", headers={"Accept": "application/json", "X-API-KEY": API_KEY}).json())
{
"ok": true
}
Not sent yet.
/scriptedsearch/jobs/{uid}/streamMemberServer-sent events with ids for resume: budget, stage, requirements, script, exec, cost, site, results, step, warning, round, telemetry, result, error, done.
curl -X GET -H 'Accept: application/json' -H 'X-API-KEY: YOUR_API_KEY' 'https://molodetz.nl/scriptedsearch/jobs/{uid}/stream'
const response = await fetch("/scriptedsearch/jobs/{uid}/stream", { method: "GET", headers: { "Accept": "application/json" } });
console.log(await response.json());
import httpx
print(httpx.request("GET", BASE + "/scriptedsearch/jobs/{uid}/stream", headers={"Accept": "application/json", "X-API-KEY": API_KEY}).json())
{
"event": "script"
}
/scriptedsearch/jobs/{uid}/report.mdMemberMarkdown report of a finished job.
curl -X GET -H 'Accept: application/json' -H 'X-API-KEY: YOUR_API_KEY' 'https://molodetz.nl/scriptedsearch/jobs/{uid}/report.md'
const response = await fetch("/scriptedsearch/jobs/{uid}/report.md", { method: "GET", headers: { "Accept": "application/json" } });
console.log(await response.json());
import httpx
print(httpx.request("GET", BASE + "/scriptedsearch/jobs/{uid}/report.md", headers={"Accept": "application/json", "X-API-KEY": API_KEY}).json())
{}
/scriptedsearch/jobs/{uid}/script.rrsMemberResearch script of a finished job.
curl -X GET -H 'Accept: application/json' -H 'X-API-KEY: YOUR_API_KEY' 'https://molodetz.nl/scriptedsearch/jobs/{uid}/script.rrs'
const response = await fetch("/scriptedsearch/jobs/{uid}/script.rrs", { method: "GET", headers: { "Accept": "application/json" } });
console.log(await response.json());
import httpx
print(httpx.request("GET", BASE + "/scriptedsearch/jobs/{uid}/script.rrs", headers={"Accept": "application/json", "X-API-KEY": API_KEY}).json())
{}