Installation
pip install coldmail-api
Or download directly:
curl -O https://www.coldmailcalculator.com/api/sdk/python/coldmail.py
Quick Start
from coldmail import ColdMail
client = ColdMail()
forecast = client.forecast(
emails_sent=5000,
reply_rate=5,
positive_reply_rate=30,
meeting_booking_rate=20,
close_rate=25,
average_deal_value=2500,
campaign_cost=600
)
print(f"Revenue: ${forecast['estimated_revenue']}")
print(f"ROI: {forecast['roi_multiple']}x")
print(f"Meetings: {forecast['estimated_meetings']}")
Configuration
The ColdMail client accepts configuration parameters:
| Parameter | Type | Default | Description |
|---|---|---|---|
api_key | str | os.getenv("COLDMAIL_API_KEY") | API key for authentication |
base_url | str | https://coldmailcalculator.com | API base URL |
timeout | int | 10 | Request timeout in seconds |
Environment Variable
Set your API key as an environment variable to avoid hardcoding credentials:
export COLDMAIL_API_KEY="your-api-key-here"
The client will automatically read it from the environment:
import os
from coldmail import ColdMail
client = ColdMail(
api_key=os.environ.get("COLDMAIL_API_KEY")
)
Error Handling
from coldmail import ColdMail, ColdMailError
client = ColdMail()
try:
forecast = client.forecast(emails_sent=5000)
except ColdMailError as e:
print(f"API error {e.status_code}: {e.message}")
except Exception as e:
print(f"Network error: {e}")
Response Format
{
"estimated_replies": 250,
"estimated_positive_replies": 75,
"estimated_meetings": 15,
"estimated_clients": 3.75,
"estimated_revenue": 9375,
"roi_multiple": 15.6,
"cost_per_reply": 2.4,
"cost_per_meeting": 40,
"cost_per_client": 160,
"performance_grade": "strong",
"risk_flags": [],
"recommendations": [
"Track actual close rate to refine revenue forecasts."
]
}
Add forecasting to your Python workflows
Perfect for data pipelines, AI agents, CRM integrations, and automation scripts.