Overview
The No Longer Evil API is a modern REST API that lets you programmatically control your thermostats, monitor temperature, and integrate with home automation systems.Secure Authentication
API key authentication with Bearer tokens and granular permission scopes
Comprehensive Control
Temperature, mode, fan, away mode, schedules, and more
Rate Limited
Built-in rate limiting to protect the service (20 req/min for API keys)
RESTful Design
Clean, predictable endpoints with JSON requests and responses
Base URL
All API requests should be made to:Getting Started
1. Get an API Key
Navigate to https://nolongerevil.com/settings and click on the API Keys tab to generate your first API key. When creating an API key, you’ll configure:- Name: A descriptive name for the key
- Scopes:
read(view status) and/orwrite(control devices) - Device restrictions: Optional limits to specific devices
2. Make Your First Request
Use your API key to list your devices:3. Control Your Thermostat
Set the temperature:Authentication
All API requests require authentication using an API key in theAuthorization header:
read: View device status and settingswrite: Control devices (temperature, mode, fan, etc.)
Request Format
All requests use JSON for request bodies with clear, RESTful endpoints.Example: Set Temperature
Example: List Devices
Response Format
All responses are JSON with consistent structure:Success Response
Error Response
Rate Limits
Rate limits are actively enforced to protect the service:| Authentication Type | Limit | Window |
|---|---|---|
| User accounts (Clerk) | 100 requests | Per minute |
| API keys | 20 requests | Per minute |
429 Too Many Requests response:
Error Handling
HTTP Status Codes
| Code | Meaning | Common Causes |
|---|---|---|
200 | Success | Request processed successfully |
400 | Bad Request | Invalid parameters or malformed JSON |
401 | Unauthorized | Invalid authentication or entry key |
404 | Not Found | Device or endpoint doesn’t exist |
500 | Server Error | Internal server error, check logs |
Error Response Format
All errors return a JSON object with anerror field:
Validation Error (400):
Available Endpoints
The API provides comprehensive control over your thermostats:Device Management
- GET /devices - List all accessible devices
- GET /thermostat//status - Get device status and settings
- DELETE /thermostat/ - Remove device from account
Temperature Control
- POST /thermostat//temperature - Set target temperature
- POST /thermostat//temperature/range - Set temperature range (heat-cool mode)
HVAC Control
- POST /thermostat//mode - Set HVAC mode (heat/cool/auto/off)
- POST /thermostat//away - Toggle away mode
- POST /thermostat//fan - Control fan mode or timer
Advanced Features
- GET/PUT /thermostat//schedule - Manage heating/cooling schedule
- POST /thermostat//lock - Enable temperature lock with PIN