Google maps distance matrix

Thank you for your help. In the end, I opted for a script run directly from Google Sheets, also adding a cache that refreshes every 6 hours, to help me with code calls to Google Maps. In conclusion, one way or the other, the solution is always found!
Here I have found all the solutions that may also be of use to others within this community.

1 Like

You could also try the data → fetch json in which you use this url
in JQuery

You could write

I think you were missing the 0 element number

1 Like

It doesn’t work that way either :frowning:
I thank you anyway. :upside_down_face:

You have to create all the functionality either in Replt or Github and add your API key there. Then use an Experimental column to do it.

The way you’re doing it will not work because of CORS issues.



Here the confirmation…


Thank you very much, I appreciate the help!

Great catch. Many API links are not usable in the fetch column because of the same issue.

1 Like

I found the solution guys! @profxeni @gvalero @Robert_Petitto

Just append to your URL.

For example:



Just to make sure this is not a mistake, you’re showing your Google Maps API key @profxeni . Do you want us to remove it?

1 Like

Great find @ThinhDinh

Does this work with Payhere then?

Thanks for the tip.

I tested like 10 Cors proxies and none worked for me :face_with_symbols_over_mouth: but happy to see it works and can be used.

Saludos Thinh![your_token]

Working for me.

Pass your token in access_token, I was fetching all subscriptions in an account.



1 Like

Don’t worry @ThinhDinh I just need to change the API.
Great solution that will benefit many users.
Thanks for the tenacity, what in Naples (IT) is called “cazzimma” :slight_smile:

1 Like

Hehe, thanks for the kind words, it will benefit me a lot too!

1 Like

Hey guys!
Here is another crazy method to bypass cors!

Google scripts!

Steps are simple:

  1. Create a new script file by going over to Apps Script – Google Apps Script
  2. Copy the code from below
function doGet(e) {
  var link =;
  return ContentService.createTextOutput(JSON.stringify(UrlFetchApp.fetch(link).getContentText()));
  1. Deploy the code so anyone can use it and use the url from the deployed web app in your glide app!

  2. You would need three columns:

    • Construct URL
    • Fetch JSON
    • Transform JSON


Google will bypass all cors issues and you can always keeps logs if you have your own script sending results back!


Hola amigo, espero pueda ayudarme con este tema. actualmente me encuentro desarrollando una app de entregas de comida a domicilio, he adquirido conocimientos básicos mediante videos en YouTube. he conocido la herramienta de cálculo de distancia de glide, pero esta calcula una distancia recta entre dos puntos, pero en mi caso no me es de utilidad ya que necesito calcular distancias recorrida de un punto a otro para poder valorar el servicio de la entrega a domicilio, me gustaría que me pudiera orientar, pero de una forma básica ya que no conozco de términos de programación. ¿Me pudieras ayudar a construir una columna en glide que me calcule la distancia recorrida de un punto a otro partiendo de una dirección de recogida y dirección de entrega que ingresa el usuario?

does this use google map api key?

This is a method to bypass cors. The original link way to implement is


That’s pretty neat. Thanks for sharing.