The API Key is having the distance matrix API linked to it. If you use your own key, you will see the request in the browser working properly. However, the moment you make an HTTP::get(<>) in the code it returns you 404. Currently, I'm using PHP Laravel and follow the documentation.
Here is the request code:
$response = Http::get('https://maps.googleapis.com/maps/api/distancematrix/json
?units=metric
&origins=Neuh%C3%B6fer+Damm+110,Germany
&destinations=Vogelweide+8,Hamburg
&key=MyKey`enter code here`'
);
and here is the given response:
Illuminate\Http\Client\Response {#576 ▼
#response: GuzzleHttp\Psr7\Response {#618 ▼
-reasonPhrase: "Not Found"
-statusCode: 404
-headers: array:8 [▼
"Date" => array:1 [▶]
"Content-Type" => array:1 [▶]
"Server" => array:1 [▶]
"Content-Length" => array:1 [▶]
"X-XSS-Protection" => array:1 [▶]
"X-Frame-Options" => array:1 [▶]
"Server-Timing" => array:1 [▶]
"Alt-Svc" => array:1 [▶]
]
-headerNames: array:8 [▶]
-protocol: "1.1"
-stream: GuzzleHttp\Psr7\Stream {#617 ▶}
Are you experiencing the same issue? The main question then is: What do we miss so we get NotFound when we use the same valid link? Maybe headers? Maybe something else? I'll keep searching for an more proper answer, but meanwhile, I hope that helps