Python bindings for ngrok local and Link APIs
Switch branches/tags
Nothing to show
Clone or download
Latest commit 93f2d88 Mar 1, 2018
Type Name Latest commit message Commit time
Failed to load latest commit information.
ngrok Convert to Python 3 Feb 28, 2018
LICENSE minor changes, add README May 30, 2015


Python bindings for ngrok local and Link APIs

Use with local ngrok setups

If your ngrok server is not running at http://localhost:4040 you need to set your base url like so:

>>> import ngrok
>>> ngrok.client.BASE_URL = "http://localhost:8765"


  • Get all tunnels: ngrok.client.get_tunnels()
  • Get tunnel by ID: ngrok.client.get_tunnel(id)


Only available on introspected tunnels.

  • Get all requests: ngrok.client.get_requests()
  • Get all requests for a specific tunnel: ngrok.client.get_tunnel(id).get_requests()
  • Get request by ID: ngrok.client.get_request(id)
  • Replay request: ngrok.client.get_request(id).replay()

Use with ngrok link

First set your public ID and secret tokens like so:

>>> import ngrok
>>> = "my_public_id"
>>> = "my_secret_token"


  • Get all tunnels:
  • Get tunnel by ID:


  • Get all reserved domains:
  • Get reserved domain by ID:
  • Reserve new domain:"").reserve()
  • Release existing reservation:

TCP Addresses

  • Get all reserved TCP addresses:
  • Get reserved TCP address by ID:
  • Reserve new TCP address:
  • Release existing TCP address reservation:


  • Get all client credentials:
  • Get client credential by ID:
  • Create a new client credential:, acl).create()
  • Revoke an existing client credential: