Skip to content

CLI

Building Activity from the command line

One command for every route in the API, made for coding agents and scheduled scripts. Results come back as JSON, errors come back as JSON, and the exit code says what happened.

Prefer to ask in plain language? The MCP server gives an AI assistant the same searches, with nothing to install. Both use the same key.

$ pipx install buildingactivity
$ buildingactivity projects get prj_fnxdqhhlmai2gdw6nfpa
{
  "id": "prj_fnxdqhhlmai2gdw6nfpa",
  "name": "Worth Heights Elementary School",
  "state": "TX",
  "city": "Fort Worth",
  "value_usd": 52000000.0,
  "earliest_signal_date": "2026-01-23",
  "earliest_permit_date": "2026-06-08",
  "lead_days": 136,
  "permit_count": 1,
  "signal_count": 2
}

Why this tool

Built for agents and scripts

A person can read the output. A program can read it too, without guessing.

A command for every route

Every route in the API is a command and every filter is a flag, so the tool and the API always match. A command names its route in its name, and path parameters are positional.

JSON out, exit codes back

Results go to standard output as JSON and errors go to standard error as JSON. The exit code says what happened, so a script decides what to do next without reading a sentence.

The key never touches the command line

The key comes from an environment variable or a settings file that only you can read. There is no flag for it, so it never lands in your shell history or a process list.

In a script

Three calls, and the answers they return

Search a county for one kind of work

Every filter in the API is a flag on the command. This one asks for solar permits in Tarrant County, Texas, and takes the largest declared value first.

Add --dry-run to see the request without making it. A dry run needs no key and uses none of your plan.

$ buildingactivity permits search \
    --geo-id cty_48439 \
    --tags solar --limit 1
{
  "items": [
    {
      "permit_number": "PB23-14567",
      "address": "5200 GOLD SPIKE DR",
      "date_issued": "2023-10-04",
      "value_usd": 4046105.0,
      "status": "Finaled"
    }
  ],
  "sort": "value_desc"
}

Watch the whole feed

The change feed carries every permit added or changed across the country, oldest first. changes tail prints one JSON line per change and keeps its place with a cursor.

A scheduled job runs it with --once to catch up and stop, or without it to poll every thirty seconds and stay current.

$ buildingactivity changes tail \
    --once --max-records 1 \
    --since 2026-11-20
{
  "seq": 56532572983057,
  "type": "permit.changed",
  "permit_id": "pmt_mhssakyn7kglqwrkyjra",
  "observed_at": "2026-11-20T00:00:03Z",
  "field": "status",
  "old": "Issued",
  "new": "Complete"
}

Measure a market by month

The metrics route returns monthly permit counts and declared values for one place, so a report or a chart is one call away.

--group-by adds a breakdown by month, tag, class, status or jurisdiction.

$ buildingactivity metrics \
    --geo-id cty_48439 --group-by month \
    --from 2026-08 --to 2026-11
{
  "data": [
    {"month":"2026-08","permits":11605,"value_sum":1541848779.62},
    {"month":"2026-09","permits":11224,"value_sum":2220973703.92},
    {"month":"2026-10","permits":11019,"value_sum":1900736336.59},
    {"month":"2026-11","permits":5573,"value_sum":791737957.44}
  ]
}

No request, no charge

See the request before you send it

Add --dry-run to any command and it prints the URL it would call, then stops. It needs no key and uses none of your plan, so it is a safe way to check a filter before a script runs it for real.

$ buildingactivity permits search \
    --geo-id cty_48439 --tags solar \
    --limit 20 --dry-run
https://api.buildingactivity.com/v1/permits/search?geo_id=cty_48439&tags=solar&limit=20

Exit codes

A script can tell what happened

Errors go to standard error as JSON, with the error type, the HTTP status and the request ID. The exit code tells a script whether to try again, wait or stop.

A rate limited call is retried three times by default, waiting the seconds the API asks for. Add --no-retry to fail at once with exit code 3.

Run buildingactivity schema to list every command, and add --help to any command to see its flags. Both work offline, without a key.

Exit codeMeaning
0The command succeeded.
1The request was wrong: a bad flag, a failed validation or a record that does not exist.
2The API key is missing or invalid.
3The request was rate limited, after the retries.
4The records on your plan are used up for the month.
5The server or the network failed.

The other half of the pair

Prefer to ask in plain language?

The MCP server gives an AI assistant the same searches in a conversation, with nothing to install. You ask a question and the assistant runs the calls, one after another.

Read about the MCP server.

The MCP server

It is hosted, so nothing is installed on your machine.

It works in the assistants and coding tools that accept a remote MCP server, including Claude Code, Cursor and VS Code.

It uses the same key and the same plan, and it only reads.

Open source

The tool is open source

The package is on PyPI and the code is on GitHub, so you can read what it does before you run it and pin the version your scripts depend on.

The data you get through it is covered by our terms.

Frequently asked questions

What do I need to run it?

The tool is a Python package and needs Python 3.11 or newer. Install it with pipx, which keeps it in its own environment and puts one command on your path.

Does it cost anything extra?

No. It uses the same API key and the same plan as the API, so each row you read counts against your monthly allowance the same way an API request does. It is free for 100 permits a month.

Where does it keep my key?

It reads BUILDINGACTIVITY_API_KEY from the environment, or a settings file that only your user can read. There is no flag for the key, so a shared script or a log never carries it.

Can a script tell what went wrong?

Yes. Errors go to standard error as JSON with the error type, the HTTP status and the request ID, and the exit code says which kind of failure it was.

Does it cover the whole API?

It has a command for every route in the API, including permits, properties, addresses, contractors, places, projects, signals, decisions, metrics and your own usage.

Can it page through a large result?

Yes. A command prints one page by default, --limit follows the cursor until the count you ask for, --limit all follows it to the end, and --max-records caps the total.

Run your first command today

The first 100 permits each month are free.