The QRZ XML Interface Specification
This document describes the interface specification for access to QRZ's XML subscription data service. This service provides real-time access to information from the QRZ.COM servers and databases. Access to this service requires user authentication through the use of a valid QRZ.COM username and password. While any QRZ user may login to the service, an active QRZ Logbook Data subscription is required to access most of its features. Non-subscriber access limits the data fields that are returned and is primarily intended for testing and troubleshooting purposes only. A description of subscription plans and rates is available on the QRZ website. QRZ's XML service is implemented using standard HTTP protocols. Requests are made as query string arguments to a standard HTTP URL. Results are returned over HTTP as XML formatted data. All post-login interactions with the server require that a dynamic session key be included with each request. The session key is sent by specifying the s= parameter. Note that requests to the XML service port may utilize either HTTP GET or HTTP POST methods. Session keys are dynamically managed by the server and have no guaranteed lifetime. When a session key expires or becomes invalidated, a new key may be issued upon request. Client programs should cache all session keys provided by the server and reuse them until they expire. This practice maximizes client performance and serves to minimize the load on QRZ's servers. As a general programming pattern, clients should expect to perform only one login operation per session. The session key returned from a successful login should then be locally cached and reused as many times as possible. All clients should monitor the status response returned in each transaction and be prepared to login again whenever indicated. A session key is valid only for a single user and may become immediately invalidated if it is detected that the user's IP address or other identifying information changes after login has been completed. The interface does not use HTTP cookies, Javascript, or HTML. The QRZ XML service is located at Beginning with version 1.25, access to QRZ's XML service is versioned. Versioning provides the ability for QRZ to periodically extend or make significant changes to this specification without sacrificing client compatibility with earlier releases. This version introduces an extension to the service URL that indicates which version of the interface should be used to service the request. The general format of the service URL is: https://xmldata.qrz.com/xml/version_identifier/?<query parameters> The version_identifier indicates which version of the interface will be used. Valid examples are:
Version Identifier Values
Note: Examples:
In the first example, no version identifier was specified and so the lowest version (1.24) will be used. In the second example, the version 1.31 interface will be used. In the third example, the most current version avaialable will be used. Note that the trailing slash (/) character following either the 'xml' or the 'version' identifier is highly recommended. Also, the dot (.) in the version identifier may be omitted, e.g. either '1.31' or '131' may be used. If a version identifier is used, it must be either 'current' or a supported release number. The use of any other value will result in an error.
The QRZ XML data structure follows the standard proposed by WWW.W3C.ORG.
QRZ's top-level node is the
Each of these nodes is described below. An important design pattern must be observed in order for your client program to maintain its highest level of reliability: 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 client programs carefully parse the data received in an "object=attribute" manner while ignoring any unknown nodes or attributes, and do so without raising an error condition. Your decoding strategy must make no assumptions regarding the number of nodes returned, the order in which nodes are returned, or the presence of nodes or attributes not previously defined. 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 https://xmldata.qrz.com/xml/current/?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 required parameters are username and password. The use of the agent parameter is strongly recommended as it assists in troubleshooting and end user support. You may use any agent identifier you wish, however, it will be most useful if you maintain a unique prefix for your product (for example, Ham Radio Deluxe uses 'HRDv.x'). Please keep it short and simple. Note: if the agent parameter is not used, the XML server will attempt to use the HTTP_USER_AGENT string obtained from the HTTP protocol. If the username and password are accepted, the system will respond with: <?xml version="1.0" ?> <QRZDatabase version="1.34"> <Session> <Key>2331uf894c4bd29f3923f3bacf02c532d7bd9</Key> <Count>123</Count> <SubExp>Wed Jan 1 12:34:03 2013</SubExp> <GMTime>Sun Aug 16 03:51:47 2012</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 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: https://xmldata.qrz.com/xml/current/?s=f894c4bd29f3923f3bacf02c532d7bd9;callsign=aa7bqThis returns the following data: <?xml version="1.0" ?> <QRZDatabase version="1.34"> <Callsign> <call>AA7BQ</call> <aliases>N6UFT,KJ6RK,DL/AA7BQ</aliases> <dxcc>291</dxcc> <fname>FRED L</fname> <name>LLOYD</name> <addr1>8711 E PINNACLE PEAK RD 193</addr1> <addr2>SCOTTSDALE</addr2> <state>AZ</state> <zip>85255</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>https://www.qrz.com/db/aa7bq</url> <u_views>115336</u_views> <bio>3937/2003-11-04</bio> <image>https://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> <geoloc>user</geoloc> <attn>c/o QRZ LLC</attn> <nickname>The Boss</nickname> <name_fmt>FRED "The Boss" LLOYD</name_fmt> <born>1953</born> </Callsign> <Session> <Key>2331uf894c4bd29f3923f3bacf02c532d7bd9</Key> <Count>123</Count> <SubExp>Wed Jan 1 12:34:03 2013</SubExp> <GMTime>Sun Nov 16 04:13:46 2012</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 lat/long and grid data returned varies by the method by which it was obtained by QRZ. Whenever a lat/long coordinate pair exists for the queried callsign, its value is used to calculate the appropriate Maidenhead locator (grid) value. In some rare cases, a given QRZ record may be missing its lat/long value but has a user supplied grid locator. When this is the case, the station's lat/long values are stated as the center the given grid locator. In most cases, when neither a lat/long pair or grid is known for a USA record, it will be derived from its postal address. For USA callsigns, the lat/long pair is determined using a geocoding procedure derived from the US Census Tiger/Line dataset. Not all addresses can be successfully geocoded and subsequently a Zip Code database is used to return an approximate location that roughly centers on the zip code. Failing all of the above, for USA callsigns, the geographic coordinates of the state's approximate center are used. For non-USA callsigns, no geocoding is available so unless the user has specifically input lat/long or grid coordinates, the approximate center of the DXCC entity (country) is used. The net result is that nearly every callsign returned by QRZ will include geographic coordinates. While in some cases they may not be exact, they are generally close enough for DX antenna positioning operations.
The
The
To fetch the bio HTML, issue a separate request using the Bio Fetch Example: https://xmldata.qrz.com/xml/current/?s=d0cf9d7b3b937ed5f5de28ddf5a0122d;html=xx1xxx
The DXCC / Prefix Lookups
Support for prefix matching and DXCC entity lookups is also provided 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): https://xmldata.qrz.com/xml/current/?s=d0cf9d7b3b937ed5f5de28ddf5a0122d;dxcc=291Resulting in: <?xml version="1.0" ?> <QRZDatabase version="1.34"> <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 2013</SubExp> <GMTime>Mon Oct 12 22:33:56 2012</GMTime> </Session> </QRZDatabase>DXCC node fields
Notes:
There are two general types of errors. Data errors, which are typically of the form
"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.34"> <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.34"> <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 © 2003-2020 by QRZ.COM
|
|