The QRZ XML Interface Specification
Overview This document describes the interface specification for access to QRZ's XML data service. This interface provides network access to raw data from the QRZ.COM servers and databases. Access to this interface requires user authentication through the use of a valid QRZ.COM username and password. Users may be both subscribers and non-subscribers, however, those not having a subscription will have limited capabilities. For subscription rates and information see our subscription info page Transactional access is provided by the XML server. Requests are sent as arguments to a URL and the results are returned as XML formatted data. To begin a transaction or series of transactions, the client program must first authenticate the user and obtain a session key. The session key must be sent as a parameter along with all subsequent communications with the server. A session key remains valid for a period of time which may be varied by the server. Most keys are good for at least a few hours, sometimes more. It is essential that session keys be reused by the client program until they expire. Initial login tends to be slow and should be avoided unless necessary. A typical client program will perform a login transaction to obtain a fresh session key and will save that key for further use. The key may be stored on the local computer, or it may be held in memory. A required capability of any client program is the ability to redo the login sequence when necessary and to otherwise use an existing key. A session key is valid for one user only and may become invalidated should the user's IP address change in midstream. The interface does not use HTTP cookies.
The QRZ XML data structure follows the standard proposed by WWW.W3C.ORG.
QRZ's top-level node is the
Each of these child nodes is described in detail below, however, the following notice regarding our XML structure must be closely observed: The XML data supplied by this interface may be extended at any time in a forward compatible manner. QRZ may add new XML nodes and/or attributes at any time. Therefore, it is critically important that software developers carefully parse the data received in a accordance with the XML 1.0 standard. User programs that use QRZ XML data must be prepared to ignore any unrecognized nodes or attributes, and must not depend on the order in which nodes or sub-nodes appear within the response. The Session node contains information pertaining to the status of the user's session, error codes and informational messages relating to the request. Setting up a Session
The first URL, i.e. To perform a simple login, the client program sends the username and password using either an HTTP GET or POST operation. A typical login exchange looks 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:
The only required parameters are username and password, however the use of the agent parameter is strongly recommend. The agent= parameter permits us to stay abreast of which programs our members are using, and potentially to notify the program suppliers. Developers are urged to register their client program agent names with QRZ by sending an email to flloyd@qrz.com. Note: if the agent parameter is not used, the QRZ will use the HTTP_USER_AGENT string that is passed in the HTTP request. If the username and password are accepted, the system will respond with:
<?xml version="1.0" ?>
<QRZDatabase version="1.18" xmlns="http://www.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>
As with all server responses, the return begins with QRZDatabase. Note that the
QRZDatabase node also contains two attributes, The possible elements in a session node are: Session section fields
Both
A user session is established whenever a session key is returned. Any response from from the
server that does not contain the
The
To make a callsign query, simply pass the current session key in the A typical request might look like this: http://www.qrz.com/xml?s=f894c4bd29f3923f3bacf02c532d7bd9;callsign=aa7bqThis returns the following data:
<?xml version="1.0" ?>
<QRZDatabase version="1.18" xmlns="http://www.qrz.com">
<Callsign>
<call>AA7BQ</call>
<dxcc>291</dxcc>
<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>United States</country>
<ccode>291</ccode>
<lat>34.23456</lat>
<lon>-112.34356</lon>
<grid>DM32af</grid>
<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://files.qrz.com/q/aa7bq/aa7bq.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>
The possible callsign data fields are listed below. Not all fields may be returned with each request. The field ordering is arbitrary and subject to change. Callsign node fields
The <bio> field is present in the callsign record whenever a biography exists
for the indicated callsign on the server. The <bio> field in the callsign
record contains the size of the bio and the date of last update
To fetch a bio URL, issue a separate request using the Here is a typical biography fetch operation: http://www.qrz.com/xml?s=2331uf894c4bd29f3923f3bacf02c532d7bd9;bio=g1srdAnd this is the result:
<?xml version="1.0" ?>
<QRZDatabase version="1.18" xmlns="http://www.qrz.com">
<Bio>
<call>g1srd</call>
<size>258</size>
<bio>http://www.qrz.com/db/g1srd</bio>
<modified>2008-10-10</modified>
</Bio>
<Session>
<Key>3431u4eaf13b8336d61982c1fd1099c9a38ac</Key>
<Count>123</Count>
<GMTime>Sun Nov 16 04:43:21 2003</GMTime>
</Session>
</QRZDatabase>
Bio node fields
Note: in contrast to previous versions of this specification, the DXCC / Prefix Lookups
Support for prefix matching and DXCC entity lookups is also provide by this
interface. Access to this method is via the The dxcc lookup provides three functions:
Functions are accessed using variations of the
In the first form, In the second form, In the third form, A typical dxcc fetch for entity 291 (USA): http://www.qrz.com/xml?s=d0cf9d7b3b937ed5f5de28ddf5a0122d;dxcc=291Resulting in: <?xml version="1.0" ?> <QRZDatabase version="1.18" xmlns="http://www.qrz.com"> <DXCC> <dxcc>291</dxcc> <cc>US</cc> <ccc>USA</ccc> <name>United States</name> <continent>NA</continent> <ituzone>6</ituzone> <cqzone>3</cqzone> <timezone>-5</timezone> <lat>37.788081</lat> <lon>-97.470703</lon> </DXCC> <Session> <Key>d0cf9d7b3b937ed5f5de28ddf5a0122d</Key> <Count>12</Count> <SubExp>Wed Jan 13 13:59:00 2010</SubExp> <GMTime>Mon Oct 12 22:33:56 2009</GMTime> </Session> </QRZDatabase>DXCC node fields
Notes:
There are two general types of errors. Data errors, which are typically of the genere
"item not found", and Session errors which deal with the user's session key.
If the <Session> node contains an <Error> sub-node, then the message
should be examined and/or presented to the user.
Further Information
Here's an example of a typical "callsign not found" error:
<?xml version="1.0" ?>
<QRZDatabase version="1.18" xmlns="http://www.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.18" xmlns="http://www.qrz.com">
<Session>
<Error>Session Timeout</Error>
<GMTime>Sun Nov 16 05:11:58 2003</GMTime>
</Session>
</QRZDatabase>
A special
For questions concerning this document or the XML interface, please
contact the author at flloyd@qrz.com .
Revision History:
Copyright © 2011 by QRZ.COM
|
|