Getting Started
The Hamlib API provides a RESTful interface for controlling amateur radio equipment and antenna rotators. This documentation covers all available endpoints, authentication methods, and includes an interactive playground for testing.
Install Hamlib
Install the Hamlib library and ensure rigctld or rotctld is running on your system.
Get API Key
Generate an API key from your Hamlib dashboard to authenticate your requests.
Make Requests
Start making API calls to control your radio or rotator using the endpoints below.
Base URL
1http://localhost:4532/apiQuick Example
1curl -X GET "http://localhost:4532/api/radio/frequency" \2 -H "X-API-Key: your-api-key" \3 -H "Content-Type: application/json"Authentication
Secure your API requests
The Hamlib API supports two authentication methods. All authenticated requests must include the appropriate credentials in the request headers.
API Key Authentication
Include your API key in the X-API-Key header. This is the recommended method for server-to-server communication.
1curl -H "X-API-Key: ham_k1abc2def3" \2 http://localhost:4532/api/radio/frequencyBearer Token
Use a Bearer token in the Authorization header. Ideal for applications using OAuth2 or JWT-based authentication flows.
1curl -H "Authorization: Bearer eyJhbGc..." \2 http://localhost:4532/api/radio/frequencyRate Limiting
API requests are rate-limited to 100 requests per minute per API key. Rate limit headers are included in every response:X-RateLimit-RemainingandX-RateLimit-Reset.
API Reference
Complete reference for all available Hamlib API endpoints.
/api/radio/frequencyRetrieve the current operating frequency of the radio. Returns the frequency in Hz along with the active VFO and a human-readable formatted string.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
vfo | string | Optional | Target VFO (e.g., VFOA, VFOB, currVFO). Defaults to currVFO. |
1curl -X GET "http://localhost:4532/api/radio/frequency?vfo=currVFO" \2 -H "X-API-Key: your-api-key" \3 -H "Content-Type: application/json"/api/radio/frequencySet the operating frequency of the radio. Accepts frequency in Hz and optionally specifies which VFO to tune.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
frequency | integer | Required | Target frequency in Hz (e.g., 14250000 for 14.250 MHz). |
vfo | string | Optional | Target VFO (e.g., VFOA, VFOB). Defaults to currVFO. |
1curl -X POST "http://localhost:4532/api/radio/frequency" \2 -H "X-API-Key: your-api-key" \3 -H "Content-Type: application/json" \4 -d '{5 "frequency": 14250000,6 "vfo": "VFOA"7 }'/api/radio/modeGet the current operating mode and passband width of the radio. Returns mode identifier (e.g., USB, LSB, CW, FM) and the passband width in Hz.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
vfo | string | Optional | Target VFO. Defaults to currVFO. |
1curl -X GET "http://localhost:4532/api/radio/mode?vfo=currVFO" \2 -H "X-API-Key: your-api-key" \3 -H "Content-Type: application/json"/api/radio/vfoGet the currently active VFO (Variable Frequency Oscillator). Returns which VFO is currently selected for receive and transmit operations.
1curl -X GET "http://localhost:4532/api/radio/vfo" \2 -H "X-API-Key: your-api-key" \3 -H "Content-Type: application/json"/api/radio/vfoSet the active VFO. Switch between VFOs for receive and transmit operations. Supports standard VFO identifiers.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
vfo | string | Required | VFO to select (VFOA, VFOB, VFOC, currVFO, VFO, MEM, Main, Sub). |
1curl -X POST "http://localhost:4532/api/radio/vfo" \2 -H "X-API-Key: your-api-key" \3 -H "Content-Type: application/json" \4 -d '{5 "vfo": "VFOA"6 }'/api/rotator/positionGet the current antenna rotator position. Returns azimuth (0-360 degrees) and elevation (0-90 degrees) of the antenna.
1curl -X GET "http://localhost:4532/api/rotator/position" \2 -H "X-API-Key: your-api-key" \3 -H "Content-Type: application/json"/api/rotator/positionSet the antenna rotator position. Specify target azimuth and elevation for the antenna to move to. The rotator will begin moving immediately.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
azimuth | number | Required | Target azimuth in degrees (0.0 - 360.0). |
elevation | number | Optional | Target elevation in degrees (0.0 - 90.0). Defaults to 0. |
1curl -X POST "http://localhost:4532/api/rotator/position" \2 -H "X-API-Key: your-api-key" \3 -H "Content-Type: application/json" \4 -d '{5 "azimuth": 180.5,6 "elevation": 45.07 }'API Playground
Test API endpoints interactively. Select an endpoint, configure parameters, and try it out.
1curl -X GET "http://localhost:4532/api/radio/frequency?vfo=currVFO" \2 -H "X-API-Key: your-api-key" \3 -H "Content-Type: application/json"