Throttled XML API for not-for-profits. (Cost: free)
We throttle {rate limit} requests to our free XML port up to a maximum number of lookups per request source per day.
If you are a non for profit entity and this limit if too low for your needs, send us a note at geodata { at } geocoder [dot] ca, and we will determine wether to raise your limits on a case by case basis. (you will also need a static ip address)
Otherwise you may want to look at our unthrottled XML port. where lookups are limited to the number of lookup credits obtained.
Also note that the limits on the free XML port are dynamically assigned. If our server load goes up, the limit becomes more restrictive and vice versa. Normally it will be in the range of 500-2000 lookups per day.
(entities using this port must be not-for-profit and provide an acknowledgement. See our Terms of Service for more details.)
Geocoder.ca provides real-time geocoding for your application via a simple XML interface.
This is a simple interface to the geocoder.ca API written in perl.
#!/usr/bin/perl -w
#------------------------------------------------------------------#
#simple perl implementation api to the geocoder.ca xml server. #
#written by ervin ruci. #
#Requirements: #
# Perl Module : LWP. (from www.cpan.org) #
#also perl version 5.6.1 or greater is recomended but not required.#
#------------------------------------------------------------------#
use strict;
#these are the data that will be passed in as input
my $street_number = '101';
my $street_name = 'Wellington';
my $city = 'Ottawa';
my $province = 'ON';
my $postal = '';
my $id = 'req10001';
my %data; #this hash will hold the parsed output
my $url = "https://geocoder.ca" . "/?" . "stno=" . $street_number . "&addresst=" . $street_name . "&city="
. $city . "&prov=" . $province . "&postal=" . $postal . "&id=" . $id . "&geoit=XML";
use LWP::UserAgent;
my $ua = new LWP::UserAgent;
$ua->agent("ruci/0.1 " . $ua->agent);
my $req = new HTTP::Request('GET', $url);
$req->header(Subject => 'XML Get',
From => '[email protected]',
timeout => '3*10');
my $res = $ua->request($req);
if ($res->is_success) {
my $result = $res->content;
if ($result =~ /<latt>(.*)<\/latt>/) {
$data{latt} = $1;
}
if ($result =~ /<longt>(.*)<\/longt>/) {
$data{longt} = $1;
}
if ($result =~ /<id>(.*)<\/id>/) {
$data{id} = $1;
}
} else {
print "Error... The server said: " . $res->code . $res->message . "\n\n";
}
print "Got Latitude " . $data{latt} . "\n";
print "Got Longitude " . $data{longt} . "\n";
print "Additional Information " . $data{id} . "\n";
###################################################
######### That's It! ##############################
###################################################
Here is the output from this code:
Got Latitude 45.423361
Got Longitude -75.698537
Additional Information req10001