diff --git a/lib/geocoder/cli.rb b/lib/geocoder/cli.rb
index 74e5bb1ffe00fa771353b7efb946f92bfd4e7b59..536aec09a0bcf2829f1a5143fbb12e20d1d16d5c 100644
--- a/lib/geocoder/cli.rb
+++ b/lib/geocoder/cli.rb
@@ -79,7 +79,7 @@ module Geocoder
 
       if show_url
         q = Geocoder::Query.new(query)
-        out << q.lookup.query_url(q) + "\n"
+        out << q.url + "\n"
         exit 0
       end
 
diff --git a/lib/geocoder/query.rb b/lib/geocoder/query.rb
index d0f4469e6c4c719b0c5fd3dd7da8c71cd75904d2..c17ba159f05a96aeae0675bf9329b034acddb955 100644
--- a/lib/geocoder/query.rb
+++ b/lib/geocoder/query.rb
@@ -36,6 +36,10 @@ module Geocoder
       Lookup.get(name)
     end
 
+    def url
+      lookup.query_url(self)
+    end
+
     ##
     # Is the Query blank? (ie, should we not bother searching?)
     # A query is considered blank if its text is nil or empty string AND