url="http://battuta.medunes.net/api/quota/?key={YOUR_API_KEY}
API Key
{"error":"Missing API key. Please visit battuta.medunes.net to get an API key. Also read the documentation for more information."}
{"message":"Authentication credentials could not be found."}
Requests & parameters
url="http://battuta.medunes.net/api/country/all/?key={API_KEY}&wrongParam=value"
{"error":"Unknown parameters: wrongParam. PLease check the API documentation for more details."}
List all countries
Requesturl="http://battuta.medunes.net/api/country/all/?key={YOUR_API_KEY}"
Response
[{"name":"COUNTRY_NAME_1","code":"COUNTRY_CODE_1"},{"name":"COUNTRY_NAME_2","code":"COUNTRY_CODE_2"},..]
Description
Country by code
Requesturl="http://battuta.medunes.net/api/country/code/kr/?key={YOUR_API_KEY}"
Response
[{"name":"Korea (South)","code":"kr"}]
Description
If the requested country code doesn't exist, an empty array JSONwill be returned. Ex:
Requesturl="http://battuta.medunes.net/api/country/code/pq/?key={YOUR_API_KEY}"
Response
[]
Country by name, region or city
Requesturl="http://battuta.medunes.net/api/country/search/?country={COUNTRY_NAME_HINT}& region={REGION_NAME_HINT}&city={CITY_NAME_HINT}&key={YOUR_API_KEY}"
Response
[{"name":"COUNTRY_NAME_1","code":"COUNTRY_CODE_1"},{"name":"COUNTRY_NAME_2","code":"COUNTRY_CODE_2"},..]
Description
If no requested countries with the given parameters do exist, an empty JSON arraywill be returned. Ex:
Requesturl="http://battuta.medunes.net/api/country/search/?region=zzz&key={YOUR_API_KEY}"
Response
[]
Important:
List all regions
Requesturl="http://battuta.medunes.net/api/region/{COUNTRY_CODE}/all/?key={YOUR_API_KEY}"
Response
[{"region":"REGION_NAME_1","code":"COUNTRY_CODE",{"region":"REGION_NAME_2","code":"COUNTRY_CODE",..]
Description
Region by name or city
Requesturl="http://battuta.medunes.net/api/country/search/?region={REGION_NAME_HINT}&city={CITY_NAME_HINT}&key={YOUR_API_KEY}"
Response
[{"name":"REGION_NAME_1","code":"COUNTRY_CODE"},{"name":"REGION_NAME_2","code":"COUNTRY_CODE"},..]
Description
If no requested regions with the given parameters do exist, an empty JSON arraywill be returned. Ex:
Requesturl="http://battuta.medunes.net/api/dz/region/search/?region=ontario&key={YOUR_API_KEY}"
Response
[]
Important:
url="http://battuta.medunes.net/api/city/fr/search/?region=pa&key={YOUR_API_KEY}"
Response
{"error":"The region parameter must be at least three (3) characters long. Check documentation for more details."}
City by name or region
Requesturl="http://battuta.medunes.net/api/city/search/?region={REGION_NAME_HINT}&city={CITY_NAME_HINT}&key={YOUR_API_KEY}"
Response
[{"city":"CITY_NAME_1","region":"REGION_NAME_1","country":"COUNTRY_CODE","latitude":"CITY_LATITUDE_1","longitude":"CITY_LONGITUDE_1"},{"city":"CITY_NAME_2","region":"REGION_NAME_2","country":"COUNTRY_CODE","latitude":"CITY_LATITUDE_2","longitude":"CITY_LONGITUDE_2"},..]
Description
If no requested cities with the given parameters do exist, an empty JSON arraywill be returned. Ex:
Requesturl="http://battuta.medunes.net/api/city/jp/search/?city=paris&key={YOUR_API_KEY}"
Response
[]
url="http://battuta.medunes.net/api/city/jp/search/?city=paris&callback=?&key={YOUR_API_KEY}