The ngrok API
Overview
The ngrok API provides programmatic access to all of ngrok's resources.
The API is REST-ish. It follows most of the conventions of a REST API but diverges slightly when the REST model does not fit well.
The API is available at https://api.ngrok.com
. The API listens only on
port 443 to help avoid any accidental unencrypted requests.
The API is designed to be simple enough to be called with curl
and HTTP
libraries in your programming language of choice. We also publish other ways to
interact with the API like native API client libraries, a native CLI and a
Terraform Provider.
API Reference Docs
- API Reference: Documentation of all API resources and endpoints. We know it's important, that's why it's first :)
Other ways to interact with the API
- Agent API CLI: Explore and script the API via the
ngrok api
commands included in the ngrok agent. - API Client Libraries: We publish idiomatic API client libraries for all major programming languages
- Terraform Provider: Use ngrok's Terraform provider to manage ngrok resources
You may be looking for other programmatic ways to work with ngrok
- Agent API: The ngrok agent has its own API if you're trying to dynamically start and stop endpoints and tunnels
- Agent SDKs: If you're looking to embed ngrok agent functionality as a library in your own software
Quickstart
Start by generating a new API key in the ngrok Dashboard.
Access the API with curl
curl https://api.ngrok.com -H "authorization: Bearer {API Key}" -H "ngrok-version: 2"