This Python script allows you to retrieve information about ham radio callsigns using the HamDB API. You can obtain details such as callsign class, grid location, latitude, longitude, name, and address.
Before running the script, ensure you have the requests
library installed. You can install it using pip
:
pip install requests
-
Import the necessary library:
import requests
-
Define the base URL for the HamDB API:
urlbase = "http://api.hamdb.org/v1/{}/json/hamdb"
-
Implement functions to retrieve specific information about a callsign:
GetData(callsign)
: Retrieves all available data for the specified callsign.GetClass(callsign)
: Retrieves the class of the callsign.GetGrid(callsign)
: Retrieves the grid location of the callsign.GetLatLong(callsign)
: Retrieves the latitude and longitude of the callsign.GetName(callsign)
: Retrieves the name associated with the callsign.GetFullAddress(callsign)
: Retrieves the full address information of the callsign.
For example, to get the name associated with a callsign:
name = GetName("vk3ye") print(name)
-
Customize the functions or use them as needed to retrieve specific information about ham radio callsigns.
In this example, we retrieve the name associated with the "vk3ye" callsign and print it.
This script is provided under the MIT License.
Feel free to modify the README.md file to include additional information or examples based on your specific project requirements.