Search from the terminal
Three calls with curl. You need a token with search and read.
export INSEAM_TOKEN="ias_…"export INSEAM="https://app.inseam.io"Search
Section titled “Search”curl -s "$INSEAM/v1/search" \ -H "Authorization: Bearer $INSEAM_TOKEN" \ -H "Content-Type: application/json" \ -d '{"q": "quarterly report", "topK": 5}' | jq '.hits[] | {address, title, score}'{ "address": "inseam://n7q2…/h1a2b3c4d5e6/Reports/Q3.md", "title": "Q3 report", "score": 0.0312 }{ "address": "inseam://n7q2…/pad/notes/board-prep.md", "title": "Board prep", "score": 0.0188 }See which hosts were searched, and which were not and why:
curl -s "$INSEAM/v1/search" -H "Authorization: Bearer $INSEAM_TOKEN" -H "Content-Type: application/json" \ -d '{"q": "quarterly report"}' | jq '.hosts[] | {id, name, searched, reason}'The record behind a hit
Section titled “The record behind a hit”curl -s "$INSEAM/v1/get?address=h1a2b3c4d5e6/Reports/Q3.md" -H "Authorization: Bearer $INSEAM_TOKEN" | jq .recordThe short form {host}/{path} saves URL-encoding the full address. Add &text=1 to include the indexed text.
The file itself
Section titled “The file itself”curl -s "$INSEAM/v1/o/h1a2b3c4d5e6/Reports/Q3.md" -H "Authorization: Bearer $INSEAM_TOKEN" -o Q3.mdIf the Mac that holds the file is asleep, the answer is 503 with {"error": {"code": "steward-offline"}}. The
record is still there; the bytes come back when the Mac wakes. A Range header fetches part of a large file:
curl -s "$INSEAM/v1/o/h1a2b3c4d5e6/Reports/Q3.md" -H "Authorization: Bearer $INSEAM_TOKEN" -H "Range: bytes=0-1023"Everything in a folder
Section titled “Everything in a folder”curl -s "$INSEAM/v1/list?prefix=h1a2b3c4d5e6/Reports/&limit=50" -H "Authorization: Bearer $INSEAM_TOKEN" \ | jq -r '.entries[].address'What is going on
Section titled “What is going on”curl -s "$INSEAM/v1/status" -H "Authorization: Bearer $INSEAM_TOKEN" | jq '{state, items, hosts: [.hosts[] | {id, state, queued}]}'