diff --git a/Library/Homebrew/utils/repology.rb b/Library/Homebrew/utils/repology.rb
index 0d367be39657c91ca02140c384fddb71c74b6813..8718b04bd125cafe8599a5c38bbec0649c77f3bb 100644
--- a/Library/Homebrew/utils/repology.rb
+++ b/Library/Homebrew/utils/repology.rb
@@ -38,7 +38,7 @@ module Repology
     while page_no <= MAX_PAGINATION
       odebug "Paginating Repology API page: #{page_no}"
 
-      response = query_api(last_package_index)
+      response = query_api(last_package_index.to_s)
       response_size = response.size
       outdated_packages.merge!(response)
       last_package_index = outdated_packages.size - 1