View Source QRZ
QRZ.com elixir client for amateur radio callsign and DXCC lookups through their XML Data Service.
Installation
The package can be installed by adding qrz to your list of dependencies in mix.exs (coming soon):
def deps do
[
{:qrz, "~> 0.1.0"}
]
end
Usage
Queries require a valid QRZ account with an active XML Logbook Data Subscription. See QRZ module documentation for additional details.
Login
Login to get session key to use for lookups
{:ok, session} = QRZ.login("username", "password")
#=>
# {:ok,
# %QRZ.Schema.Session{
# key: "d0cf9d7b3b937ed5f5de28ddf5a0122d",
# count: "6124",
# sub_exp: "Sat Mar 8 00:00:00 2025",
# gmt_time: "Wed Oct 18 17:09:55 2023",
# message: "",
# error: ""
# }}
session.key
#=> "d0cf9d7b3b937ed5f5de28ddf5a0122d"
Callsign Lookup
Lookup callsign information. See docs for full list of callsign struct fields
{:ok, callsign} = QRZ.callsign(session.key, "aa7bq")
#=>
# {:ok,
# %QRZ.Schema.Callsign{
# call: "AA7BQ",
# xref: "",
# aliases: "N6UFT,AA7BQ/DL1,KJ6RK,AA7BQ/HR6",
# dxcc: "291",
# first_name: "FRED L",
# last_name: "LLOYD",
# ...
# }}
callsign.call
#=> "AA7BQ"
callsign.email
#=> "aa7bq@example.com"
DXCC Lookup
Lookup DXCC entity information by entity code or callsign
{:ok, dxcc} = QRZ.dxcc(session.key, "291")
#=>
# {:ok,
# %QRZ.Schema.DXCC{
# dxcc: "291",
# cc: "US",
# ccc: "USA",
# name: "United States",
# continent: "NA",
# itu_zone: "0",
# cq_zone: "0",
# timezone: "-5",
# lat: "37.701207",
# lon: "-97.316895",
# notes: ""
# }}
dxcc.lat
#=> "37.701207"
dxcc.timezone
#=> "-5"