This chapter covers the core features and capabilities of API Poller.
Follow this guide to get API Poller up and running in your environment.
# Poll an endpoint every 60 seconds
python src/api_poller.py --url https://api.example.com/v1/status --interval 60
# Poll once and print results
python src/api_poller.py --url https://api.example.com/v1/health --once
# Poll with change alerts
python src/api_poller.py --url https://api.example.com/v1/data \
--alert-webhook https://hooks.example.com/alert --interval 300
# Full config for multiple endpoints
python src/api_poller.py --config examples/poller_config.json
# View poll history
python src/api_poller.py --history
# View recent alerts
python src/api_poller.py --alerts{
"endpoints": [
{
"name": "status-page",
"url": "https://api.example.com/v1/status",
"interval_seconds": 60,
"alert_webhook": "https://hooks.example.com/alert",
"headers": {"Authorization": "Bearer YOUR_API_TOKEN_HERE"},
"expected_status": 200
},
{
"name": "pricing-api",
"url": "https://api.example.com/v1/pricing",
"interval_seconds": 3600,
"alert_webhook": "https://hooks.example.com/alert",
"detect_changes": true
}
],
"database": "api_polls.db"
}| Flag | Default | Description |
|---|---|---|
--config, -c | — | Poller config file (JSON) |
--url, -u | — | Single URL to poll |
--interval, -i | 60 | Poll interval in seconds |
--alert-webhook | — | Webhook URL for alerts |
--once | false | Poll once and exit |
--history | — | Show poll history (optionally for a specific endpoint) |
--alerts | false | Show recent alerts |
--database | api_polls.db | SQLite database path |
--log-level | INFO | Logging level |
| Field | Type | Description |
|---|---|---|
name | string | Endpoint identifier |
url | string | URL to poll |
interval_seconds | int | Seconds between polls |
alert_webhook | string | URL to send alerts to |
headers | dict | Custom HTTP headers |
expected_status | int | Expected HTTP status code (alert on mismatch) |
detect_changes | bool | Alert when response body changes |
Get the full API Poller and unlock everything.
Get the complete guide with every chapter unlocked, including code samples, diagrams, and best practices.
Access all interactive tools with complete data, all workload profiles, and the full scenario library.
Downloadable source code, configuration files, and working examples from every chapter.
Free updates for life. Every new chapter, tool, and improvement included.