Title: | QRZ XML Logbook Data Specification |
Version: | 1.11 |
Date: | September 13, 2009 |
Author: | Fred Lloyd, AA7BQ |
Email: | flloyd@qrz.com |
The QRZ XML interface provides program level access to the QRZ callsign database.
Access to the QRZ XML port requires a valid subscriber login consisting of a username and password, and a current, active subscription with QRZ. For subscription information see: Our subscription info page
The QRZ XML server maintains login/logout state information on for each user through the use of a session key. Upon successful login, an encrypted session key is returned to the client application which must be cached so that it can be used with subsequent data requests to the server.
Session keys are unique and are generated each time a user logs in. A session key is valid for one user, operating from a single IP address.
Session keys may be valid for up to 24 hours. A session key may be invalidated at any time by the server, so client applications should be prepared to re-login at any time.
The QRZ XML service can be accessed from these equivalent locations:
To establish a session, the calling appliation sends the username and password through either an HTTP GET or POST operation. A typical login exchange goes like this:
http://www.qrz.com/xml?username=xx1xxx;password=abcdef;agent=q5.0
The URI may use either the ampersand (&) or the semicolon (;) as the parameter separator.
Session Input Fields:
If the username and password are accepted, the system will respond with:
<?xml version="1.0" ?> <QRZDatabase version="1.1" xmlns="http://xml.qrz.com"> <Session> <Key>2331uf894c4bd29f3923f3bacf02c532d7bd9</Key> <Count>123</Count> <SubExp>Wed Jan 1 12:34:03 2010</SubExp> <GMTime>Sun Aug 16 03:51:47 2009</GMTime> </Session> </QRZDatabase>
The QRZDatabase Tag
The QRZDatabase tag starts and ends the return response. The
QRZDatabase tag contains two attributes, version
and xmlns
.
The version
attribute represents the QRZ release version for this version
of its XML data. The xmlns
attribute identifies the XML namespace of
this product.
All return data is bracketed by opening and closing tags, except for the <?xml version"1.0" ?> which is a header element. The elements in the session response are:
http://xml.qrz.com/xml?s=2331uf894c4bd29f3923f3bacf02c532d7bd9;callsign=aa7bqThis request returns the following data:
<?xml version="1.0" ?> <QRZDatabase version="1.1" xmlns="http://xml.qrz.com"> <Callsign> <call>AA7BQ</call> <fname>FRED L</fname> <name>LLOYD</name> <addr1>8711 E PINNACLE PEAK RD 159</addr1> <addr2>SCOTTSDALE</addr2> <state>AZ</state> <zip>85014</zip> <country>USA</country> <lat>34.23456</lat> <lon>-112.34356</lon> <grid>DM32af</lat> <county>Maricopa</county> <fips>04013</fips> <land>USA</land> <efdate>2000-01-20</efdate> <expdate>2010-01-20</expdate> <p_call>KJ6RK</p_call> <class>E</class> <codes>HAI</codes> <qslmgr>NONE</qslmgr> <email>flloyd@qrz.com</email> <url>http://www.qrz.com/callsign/aa7bq</url> <u_views>115336</views> <bio>3937/2003-11-04</bio> <image>http://www.qrz.com/hampix/q/b/aa7bq.1012971412.jpg</image> <serial>3626</serial> <moddate>2003-11-04 19:37:02</moddate> <MSA>6200</MSA> <AreaCode>602</AreaCode> <TimeZone>Mountain</TimeZone> <GMTOffset>-7</GMTOffset> <DST>N</DST> <eqsl>Y</eqsl> <mqsl>Y</mqsl> <cqzone>3</cqzone> <ituzone>2</ituzone> <locref>1</locref> <born>1953</born> </Callsign> <Session> <Key>2331uf894c4bd29f3923f3bacf02c532d7bd9</Key> <Count>123</Count> <SubExp>Wed Jan 1 12:34:03 2010</SubExp> <GMTime>Sun Nov 16 04:13:46 2009</GMTime> </Session> </QRZDatabase>Callsign data fields
Field | Description |
---|---|
call | callsign |
fname | first name |
name | last name |
addr1 | address line 1 (i.e. house # and street) |
addr2 | address line 2 (i.e, city name) |
state | state (USA Only) |
zip | Zip/postal code |
country | mailing address country |
lat | lattitude of address (signed decimal) S < 0 > N |
lon | longitude of address (signed decimal) W < 0 > E |
grid | grid locator |
county | county name (USA) |
fips | FIPS county identifier (USA) |
land | country of callsign issue |
efdate | license effective date (USA) |
expdate | license expiration date (USA) |
p_call | previous callsign |
class | license class |
codes | license type codes (USA) |
qslmgr | QSL manager info |
email address | |
url | web page address |
u_views | QRZ web page views |
bio | biography tag info (length/date) |
image | primary image url |
serial | QRZ db serial number |
moddate | QRZ db last modified date |
MSA | Metro Service Area (USPS) |
AreaCode | Telephone Area Code (USA) |
TimeZone | Time Zone (USA) |
GMTOffset | GMT Time Offset |
DST | Daylight Saving Time Observed |
eqsl | Will accept e-qsl |
mqsl | Will return paper QSL |
cqzone | CQ Zone identifier |
ituzone | ITU Zone identifier |
locref | location reference code (lat/long source) |
born | operator's year of birth |
user | User who manages this callsign on QRZ |
lotw | Will accept LOTW |
iota | IOTA Designator |
Field | Description |
---|---|
Key | unique user session key |
Count | Number of lookups performed in current 24 hour period |
SubExp | time and date that the users subscription will expire |
GMTime | Time stamp for this message |
Error | XML system error message |
Field | Description |
---|---|
call | callsign for this bio |
size | length in bytes of the bio text |
bio | fully qualified URL to the HTML biography file |
modified | date of last bio text modification |
Here is a typical biography fetch operation:
http://xml.qrz.com/xml?s=2331uf894c4bd29f3923f3bacf02c532d7bd9;bio=g1srdAnd this is the result:
<?xml version="1.0" ?> <QRZDatabase version="1.1" xmlns="http://xml.qrz.com"> <Bio> <call>g1srd</call> <size>258</size> <bio>http://xml.qrz.com/hampages/d/r/g1srd/bio.html</bio> <modified>2008-10-10</modified> </Bio> <Session> <Key>3431u4eaf13b8336d61982c1fd1099c9a38ac</Key> <GMTime>Sun Nov 16 04:43:21 2003</GMTime> </Session> </QRZDatabase>
Note that the bio URL returned by this call is not guaranteed to be always the same. Always use the value that is returned from this call and then fetch the bio data in a separate request. Also, embedded <img> tags in the bio.html file may contain relative path references that might need fixup before displaying in a browser.
Image files may be in any of several formats, including JPG, PNG and GIF.
Here's an example of a typical "not found" error:
<?xml version="1.0" ?> <QRZDatabase version="1.1" xmlns="http://xml.qrz.com"> <Session> <Error>Not found: g1srdd</Error> <Key>1232u4eaf13b8336d61982c1fd1099c9a38ac</Key> <GMTime>Sun Nov 16 05:07:14 2003</GMTime> </Session> </QRZDatabase>Should a session expire or become invalidated, the <Key> field will not be sent.
Here's an example of a "Session" error:
<?xml version="1.0" ?> <QRZDatabase version="1.1" xmlns="http://xml.qrz.com"> <Session> <Error>Session Timeout</Error> <GMTime>Sun Nov 16 05:11:58 2003</GMTime> </Session> </QRZDatabase>Whenever a response is received that does not contain a Session Key, the username= and password= parameters must be again sent to establish a new session.
Copyright © 2009 by QRZ.COM