The upnatus command line.
Every REST operation is one command. Use it in a terminal, in scripts, or from an agent that runs shell commands.
Signing in needs an account with access. A person requests access at upnatus.com/access; an agent cannot request it. Once access is granted, the person signs in at upnatus.com/app, and from there connects agents and creates API keys.
Install
One file with no dependencies, MIT licensed. It needs Node.js 22.12 or newer.
npm install -g upnatus upnatus --help
npx upnatus --help
curl -fsSL https://upnatus.com/cli/upnatus.mjs -o upnatus.mjs node upnatus.mjs --help
Sign in
upnatus login
The command prints an address and a code. Open the address, sign in, type the code your terminal shows and approve. Never type a code someone sent you. The approval page ticks read and ask; to let the CLI change things, run upnatus login --scope "read ask propose" and tick propose there. The token is kept in ~/.config/upnatus/rest-token.json, readable by you only, and renews itself. upnatus logout ends the sign-in.
export UPNATUS_API_KEY=upn_live_...
Create the key in the panel under Settings → Agents (the panel calls it a token; read and ask are on by default, propose is optional). A key wins over a saved sign-in.
Settings
| Variable | What it does |
|---|---|
UPNATUS_API_KEY | An API key, sent as a Bearer token. |
UPNATUS_API_URL | The server, https://api.upnatus.com by default. Change it only for a test server. The CLI sends a key or token only to an https:// address, or to http://localhost. |
UPNATUS_CONFIG_DIR | Where the sign-in token is kept. Default: $XDG_CONFIG_HOME/upnatus when XDG_CONFIG_HOME is set, else ~/.config/upnatus. |
Each request waits at most 130 seconds, longer than the slowest paid read the server runs; a timeout or a network error exits with 5. A saved sign-in is kept when the server cannot be reached for a moment: only a refusal of the refresh token ends it.
Commands
A command is the operation’s name in kebab case: get_rank_history becomes get-rank-history. Path ids come first, then options.
upnatus list-clients # your businesses and their ids upnatus get-setup-status --client-id <client-id> # what is missing upnatus get-today <client-id> # what needs you now upnatus get-rank-history <client-id> --weeks 8 upnatus get-ai-visibility <client-id> upnatus estimate-spend <client-id> --tool seed_keyword_ideas upnatus seed-keyword-ideas <client-id> --seeds "emergency plumber" --max-credits 1 upnatus get-keyword-research <client-id> --seeds "emergency plumber" # step 2: the ideas upnatus get-credits --json # raw JSON instead of a table upnatus get-rank-history --help # the options of one command
--jsonprints the answer as JSON; a table is the default. An error prints its JSON body too.- A list of words or numbers is one repeated option or a comma list, as in
--seeds "a" --seeds "b"or--seeds "a,b"; a JSON array works too, and keeps a comma inside a word:--seeds '["a, b"]'. An option that takes a list of objects, or an object, takes JSON. A value the API accepts asnulltakesnone, as in--city none. A yes/no option takestrueorfalse, as in--ask-again true.--data '{…}'sends a whole body; options override its fields. - Every option has a line of help in
upnatus <command> --help. - A command that writes takes
--idempotency-key. One is made for you when it is missing, but a new one each run: to repeat a run safely, pass the same--idempotency-keyagain. A command that spends credits (it takes--max-credits) makes its key from the request: the same command run again within ten minutes returns the stored answer and does not charge twice. - Two-step commands (
seed-keyword-ideas,ask-keyword-top10,recheck-keywords) answer at once; read the result with the command listed in Two-step tools. upnatus --helplists every command.
Exit codes
The code follows the HTTP status and the body. On an error the CLI prints the status and code (or the guard) on stderr: read it before you act on the exit code.
| Code | When | What to do |
|---|---|---|
| 0 | A 2xx answer. | Done. |
| 1 | A wrong command or option; 400, 404, 410, 413, 421, 422; a 409 with no guard (monthly_limit, key_limit …). | Read the printed code and message. A 422 invalid_input names the field, and lists the valid arguments when you sent one the command does not have. |
| 2 | A 402, 403 or 409 with a guard. The next step is printed, or is in the JSON. No paid plan is always this: 402 G-ENTITLEMENT with a payment next_action. | Follow next: (the next_action), or fix what missing names. G-ENTITLEMENT: a person starts a plan. |
| 3 | 401, or a 403 with no guard (person_only, org_required …). | For 401, run upnatus login or set UPNATUS_API_KEY. For a 403, read the printed code: signing in again does not help. |
| 4 | Any 429. | Only rate_limited is a rate limit: try again after the seconds printed. budget_cap, quota and trial_ask_quota are monthly limits: do not loop. |
| 5 | A 5xx answer, a network error or the 130-second timeout. | Try again later, with the same --idempotency-key for a write. A command that spends credits can be run again as it was: the stored answer comes back. |