Small Basic Forum
LDGeography.GetAllCountries - Printable Version

+- Small Basic Forum (https://litdev.uk/mybb)
+-- Forum: Small Basic (https://litdev.uk/mybb/forumdisplay.php?fid=1)
+--- Forum: Extensions (https://litdev.uk/mybb/forumdisplay.php?fid=3)
+--- Thread: LDGeography.GetAllCountries (/showthread.php?tid=495)



LDGeography.GetAllCountries - martmen - 10-04-2025

Helo evrybody,

When I use  countries = LDGeography.GetAllCountries(), the result is "FAILED". Am I doing something wrong, or is the command not working properly?
Can someone provide a working example?

Best regards
martmen


RE: LDGeography.GetAllCountries - litdev - 10-04-2025

Hi,
This was added to LD extension in 2019 by Abhishek Sathiabalan - he was keen to add stuff at that time.
I have never really used it, but it was tested and did work when it was added.
Unfortunately it looks like it uses restcountries.eu/rest/v2/all that has since disappeared, maybe changed into something else.


RE: LDGeography.GetAllCountries - WhTurner - 10-04-2025

When I search for "restcountries.eu" there is a redirection to "countrylayer.com".
Perhaps you can look there.


RE: LDGeography.GetAllCountries - litdev - 10-04-2025

Yes I saw that, but the API is different with different functions.
It's not a simple change, it's a rewrite with maybe different options as far as I can see.


RE: LDGeography.GetAllCountries - litdev - 10-05-2025

Martin,

If this is something that is of particular interest for a project I will look at getting a free API key for the new website and see what I can do.


RE: LDGeography.GetAllCountries - litdev - 10-05-2025

Hi, it turns out  the API is very similar and I updated to a free version of the new API (100 calls per month so use sparingly!).  Please try updated beta version of LD extension, version 1.2.30.9.

EDIT - I added LDGeography.APIKey to version 1.2.30.10 to allow you to use your own key, see https://countrylayer.com/pricing.