The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.


Ham::Resources::HamQTH - A simple and easy object oriented front end for HAMQTH.COM Amateur Radio callsign free database service.


Version 0.06


        use Ham::Resources::HamQTH;

        my $qth = Ham::Resources::HamQTH->new(
                callsign => 'callsign to find',
                username => 'your HamQTH username',
                password => 'your HamQTH password'

        # get information from one callsign found
        my $bio = $qth->get_bio;
        foreach (sort keys %{$bio}){
                print $_.": ".$bio->{$_}."\n";
        # get DXCC information from one callsign found
        my $dxcc = $qth->get_dxcc;
        foreach (sort keys %{$dxcc}){
                print $_.": ".$dxcc->{$_}."\n";
        # print a specific info
        my $bio = $qth->get_bio;
        print "grid: ".$bio->{grid};
        # get a list of available elements
        my $bio = $qth->get_list;


The Ham::Resources::HamQTH module provides an easy way to access Amateur Radio callsign data from the HamQTH.COM online free database.

This module uses the HamQTH XML database service, which requires a valid user account. Create an account is free.

The number of response elements by the XML database can be different between each callsign, depending if it has any information of a callsign or not.

The duration of the SESSION is 1 hour, so the module save it a SESSION_ID and a timestamp into a file to check when is neccesary turn on login or use the saved SESSION_ID.



 Usage  : my $qth = Ham::Resources::HamQTH->new(
                callsign => 'callsign  or DXCC code to search',
                username => 'your HamQTH username',
                password => 'your HamQTH password'
 Funtion : creates a new Ham::Resources::HamQTH object
 Returns : an object
 Args    : a hash:
 key            required?       value
 -------        ---------       -----
 callsign       yes             a text with the callsign or DXCC code to find
 username       yes             a text with a valid username  account
 password       yes             a text with a valid password  account
 timeout        no              an integer of seconds to wait for the timeout of the XML service. By default = 10
 strip_html_bio no              binary for strip HTML code from the bio. By default = 0 (HTML code) 



 Usage    : my $bio = $qth->get_list;
 Function : gets a list of elements (tags) availables of a callsign found 
 Returns  : an array
 Args     : n/a


 Usage    : my $bio = $qth->get_bio;
 Function : retrieves data of a XML query, that is, all the data found a callsign or error occurred
 Returns  : a hash
 Args     : n/a


 Usage: my $dxcc = $qth->get_dxcc;
 Function: provides detail info of a DXCC
 Returns: a hash
 Args: n/a 


 Usage    : my $error = $bio->{error}
 Function : retrieves an error message if not callsign found, lost internet connection, don't access to session file, fail on server response or run it without a callsign to find
 Returns  : a string, the error message. Only after call get_bio() method
 Args     : n/a


None by default.


  • LWP::UserAgent

  • XML::LibXML::Reader;

  • Internet connection


This module accesses the data provided free by Petr (OK2CQR). See DXCC tables provided by Martin (OK1RR).


You can view a complete example of use at

You can also find a test script in test folder, you just need to edit and add your user account to work. The callsign is passed as an argument to the script from the command line.

You can create an account for use this module at


Carlos Juan, <> | <>


This module is free software; you can redistribute it and/or modify it under the terms of the Artistic License 2.0. For details, see the full text of the license in the file LICENSE.

This program is distributed in the hope that it will be useful, but it is provided "as is" and without any express or implied warranties. For details, see the full text of the license in the file LICENSE.

Copyright (C) 2012-2014 by Carlos Juan Diaz (CJUAN) - EA3HMB < | <>