How to drive API Spector from the keyboard

Roy de Kleijn Roy de Kleijn · · 2 min read
How to drive API Spector from the keyboard

Many API tasks are quicker without the mouse: send a request, jump to another open request, move between the request and the response, and step through the tabs within each. API Spector has a small set of keyboard shortcuts for exactly that. On macOS use Cmd, and on Windows and Linux use Ctrl. Where a shortcut uses Alt, that is the Option key on a Mac.

Send, search, and save

  • Send the current request: Cmd/Ctrl + Enter. This runs the same pipeline as the Send button, including pre and post scripts.
  • Open the command palette: Cmd/Ctrl + K. Search your requests by name and open one.
  • Save to disk: Cmd/Ctrl + S.

Switch between open requests

Every request you open gets a tab across the top. To move between them:

  • Next tab: Ctrl + Tab
  • Previous tab: Ctrl + Shift + Tab
  • Jump to a tab by position: Cmd/Ctrl + 1 through Cmd/Ctrl + 9, where 9 jumps to the last tab.

Move between the request and the response

The request builder is on the left and the response is on the right. To move keyboard focus between the two panes:

  • Focus the request pane: Cmd/Ctrl + Alt + Left
  • Focus the response pane: Cmd/Ctrl + Alt + Right

The pane that has focus shows a thin highlight, so you can always see where you are. If the response pane is collapsed, focusing it opens it.

Step through the sub-tabs

Each pane has its own row of sub-tabs. The request pane holds Params, Headers, Body, Auth, Variables, and more. The response pane holds Request, Body, Headers, Tests, Console, History, and HTTP. To move through the sub-tabs of whichever pane has focus:

  • Previous sub-tab: Cmd/Ctrl + Alt + Up
  • Next sub-tab: Cmd/Ctrl + Alt + Down

The list adapts to the request. A SOAP request folds Params and Body into a single SOAP tab, and a WebSocket request shows a different set, so the shortcut always walks the tabs that are actually there.

Put it together

A full pass without the mouse looks like this: press Cmd/Ctrl + 1 to pick a request, Cmd/Ctrl + Alt + Up or Down to land on the Body tab, Cmd/Ctrl + Enter to send, Cmd/Ctrl + Alt + Right to move into the response, then Cmd/Ctrl + Alt + Down to step from Body to Tests. Your hands stay on the keyboard, and nothing leaves your machine.

Try it in API Spector

Free and open source. No account needed to use the app.

Keep reading