API quickstart: build a personal automation
A 50-line script that searches your bookmarks and prints the top three matches. Adapt to taste.
steps
create an API key
Go to /settings/api in the app. Create a key with scope `read`. Copy it. Keys start with `xm_live_*`. Treat them like passwords — they grant the same read access you have.
set the env var
Export the key to your shell: `export XMARK_API_KEY=xm_live_xxxxx`. Anything calling the xmark API will pick it up automatically.
search via curl
`curl -X POST https://api.xmark.chat/bookmarks/search -H "Authorization: Bearer $XMARK_API_KEY" -H "Content-Type: application/json" -d '{"query":"agents","limit":5}'`. The response is `{ success: true, data: [{ bookmark, score }, …] }`.
or use the MCP / CLI
`npx -y -p @jclvsh/xmark xmark search "agents"` from any shell. Same auth via XMARK_API_KEY. For Claude Code / Cursor integration, point your MCP client at `xmark-mcp`.
The MCP server exposes the same surface as the CLI but lets Claude call it as a tool. See packages/mcp/README.md.
build the loop
Most automations want one of three shapes: (a) a daily digest — search a few queries, post results to Slack/email; (b) a question-answer endpoint — wrap /chat in your own UI; (c) an export job — paginate /bookmarks and dump to Markdown. See /docs for the full endpoint list.
ready to get started?
sign up in seconds. free to start, no credit card required.