Skip to main content

Python client for the pfSense-FauxAPI on a pfSense host

Project description

PfsenseFauxapi - Python Interface

PyPi Build Status

Python client for pfSense-FauxAPI -


via PyPi

pip3 install pfsense-fauxapi

Install via Source

# obtain the source material
git clone
cd pfsense_fauxapi_client_python
python3 -m venv venv
source venv/bin/activate
pip3 install -r requirements.txt
python3 clean
python3 test
python3 install

Code Examples

Three Python code samples are provided that demonstrate interface usage

  • - iterates (almost) all the FauxAPI functions to confirm operation.
  • - downloads the latest AWS ip-ranges.json and populates the pfsense alias table(s).
  • - demonstrates the ability to manage users and groups programmatically.

Command Line

Additionally this pip-package provides a command-line interface to work with FauxAPI

usage: fauxapi [-h] [--host [host]] [--apikey [key]] [--apisecret [secret]]
               [--verified-ssl] [--debug]
               [function] [[function] ...] [[function-args]]


optional arguments:
  -h, --help            show this help message and exit

  --host [host]         Host address of the target pfSense host with the
                        PfsenseFauxapi package installed.
  --apikey [key]        FauxAPI apikey value - alternatively via the
                        FAUXAPI_APIKEY environment variable.
  --apisecret [secret]  FauxAPI apisecret value - alternatively via the
                        FAUXAPI_APIKEY environment variable.
  --verified-ssl        Enable SSL certificate checks - default does NOT check
                        SSL certificates.
  --debug               Enable debug response from the remote FauxAPI -
                        helpful in tracking down issues.
  [function]            The FauxAPI function being called
  [function-args]       Arguments to the function, space separated

Command line example, using environment variables to pass the FAUXAPI_APIKEY and FAUXAPI_APIKEY credentials.

$ fauxapi --host gateway_status | jq .
  "callid": "5c8d0f7361cba",
  "action": "gateway_status",
  "message": "ok",
  "data": {
    "gateway_status": {
      "": {
        "monitorip": "",
        "srcip": "",
        "name": "WAN_DHCP",
        "delay": "0.422ms",
        "stddev": "0.073ms",
        "loss": "0.0%",
        "status": "none"

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pfsense-fauxapi-20200718.2.tar.gz (7.6 kB view hashes)

Uploaded Source

Built Distribution

pfsense_fauxapi-20200718.2-py3-none-any.whl (12.5 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page