GeoNames Home | Postal Codes | Download / Webservice | About 

GeoNames Forum
  [Search] Search   [Recent Topics] Recent Topics   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
How to run multiple API requests at once on Geonames.org?  XML
Forum Index -> General
Author Message
rezaamya



Joined: 20/10/2020 09:02:59
Messages: 1
Offline

I have 10 line of records include Country code, Province code and City code. I want to translate all of those records to several languages. Currently assume I need English version, Then the following API request will convert the codes to human readable English version:

http://api.geonames.org/searchJSON?country=IR&adminCode1=44&adminCode2=449510&featureClass=A&featureCode=ADM2&username=MYUSERNAME&lang=en
I want to know, is it any way to send multiple requests at once instead of 10 separated request?
to make it more clear, currently I am using like this:

for (i = 0; i < 10; i++) {
result[i] = API_request(i); //it mean I am doing API request, 10 times!
}

but I need to use it like this:

all_results = API_request(1 + 2 + ... + 10); //I need one API request not 10

Please note, I know that it is possible to use curl_multi_init on PHP side, but I am trying to find a way in Geoname's API to get better speed and performance maybe.

Thanks in advance.
 
Forum Index -> General
Go to:   
Powered by JForum 2.1.5 © JForum Team