Command line
@coworkingview/cli: search and read the catalogue from a terminal or a script. Commands, flags, exit codes and JSON output.
@coworkingview/cli is the official command-line client for the public API. It is MIT-licensed, needs Node.js 20 or newer and, like the API, no API key. It only reads.
npx @coworkingview/cli search --city berlinTo keep it installed:
npm install -g @coworkingview/cli
coworkingview citiesCommands
| Command | What it does |
|---|---|
search --city <slug> | Lists spaces in a city, one line each with the slug. |
get <slug> | The full record of one space, as JSON. |
cities | Every city slug you can search. |
health | API status and deployed version, as JSON. |
help | Usage. |
coworkingview --version prints the installed version.
Flags
| Flag | Default | Notes |
|---|---|---|
--city <slug> | none | Required for search. |
--type <t> | none | Filter search by workspace type: private_office, exclusive_bereich, fix_desk, flex_desk, day_pass, meeting_room, virtual_office, event_space or membership. |
--limit <n> | 10 | Results per page. See the note below. |
--page <n> | 1 | Page number, from 1. |
--locale <l> | en | en, de or es. |
--json | off | JSON output for search and cities. get and health always print JSON. |
--version | Print the version. |
--limit above 50
The CLI accepts --limit from 1 to 100, but the API serves at most 50 per page (pageSize, see Pagination). Use 50 or less; a larger value is sent to the API and comes back as a validation error with exit code 1.
A wrong --type or --locale, or a flag written without a value, is rejected locally with the list of valid values, before any request is made. A typo never looks like "no results".
Examples
npx @coworkingview/cli search --city berlin --type private_office --limit 20 --jsonnpx @coworkingview/cli get <slug> --locale denpx @coworkingview/cli search --city berlin --limit 50 --json \
| jq -r '.[] | "\(.title)\t\(.fromPrice.amount // "n/a")"'page=1
while :; do
batch=$(npx @coworkingview/cli search --city london --page "$page" --limit 50 --json)
[ "$(echo "$batch" | jq 'length')" -eq 0 ] && break
echo "$batch" | jq -c '.[]'
page=$((page + 1))
doneWith --json, search and cities print the API's own records unchanged (the contents of data, without the envelope).
Exit codes and errors
| Code | Meaning |
|---|---|
0 | Success. |
1 | API or network error, including no answer within 15 seconds. |
2 | Usage error: a missing or malformed flag or command. Nothing was sent. |
Output goes to stdout; diagnostics go to stderr, so | jq never receives an error where records were expected. With --json, errors are JSON as well:
{ "error": { "code": "USAGE", "message": "search requires --city <slug> (e.g. --city berlin)" } }code is USAGE (exit 2) or API (exit 1). The CLI never prompts and never uses colours or spinners, so it behaves the same in a terminal, a pipe or CI.
When to use something else
The CLI covers search and detail. For filters, market rates, profiles or the map, call the API directly. For an AI assistant, use the MCP server.
Attribution and licences
What you may do with CoworkingView API data: the catalogue notice, the citation to copy, and the CC BY 4.0 market rates.
MCP server
The public, read-only MCP server at mcp.coworkingview.com. Lets AI assistants search CoworkingView's catalogue of coworking spaces and offices for their users. Free, no sign-up.