in reply to Net::Google::WebmasterTools: GWMT error: 404 Not Found

Point 2 of this bug report seems to indicate that the queried site should be passed in URL-encoded. So maybe try with (roughly, untested) the following transformation:

use URL::Encode; $site_url = url_encode($site_url); my $req = $wmt->new_request( ... )

Replies are listed 'Best First'.
Re^2: Net::Google::WebmasterTools: GWMT error: 404 Not Found
by Anonymous Monk on Jul 22, 2016 at 13:24 UTC

    Thanks Corion, for your effort.

    With URL::Encode I am getting this error now:

    Undefined subroutine &main::url_encode called at ./Google_Search_Conso +le_API.pl line 12, <DATA> line 2231.

      Sorry - it seems you need to explicitly import url_encode:

      use URL::Encode 'url_encode';
        With use URL::Encode 'url_encode'; i am getting:
        https://www.googleapis.com/webmasters/v3/sites/https%3A%2F%2Fwww.seafl +ow.de%2Findex.html/searchAnalytics/query Use of uninitialized value in print at ./Google_Search_Console_API.pl +line 49, <DATA> line 2231. Use of uninitialized value in print at ./Google_Search_Console_API.pl +line 49, <DATA> line 2231. Results: 1 - of Can't locate object method "get_source" via package "Net::Google::Webm +asterTools::Row_0" at ./Google_Search_Console_API.pl line 54, <DATA> +line 2231.