amadeus api where if the list of all cityCodes - api

In Amadeus API the is often a reference to "cityCode"
The documentation give this example
https://test.api.amadeus.com/v2/shopping/hotel-offers?cityCode=PAR&adults=1&radius=5&radiusUnit=KM&paymentPolicy=NONE&includeClosed=false&bestRateOnly=true&view=FULL&sort=PRICE
Where is the list of ALL cityCode ???
for this example it seems PAR refers to PARIS
is this https://service.unece.org/trade/locode/fr.htm
is there a cvs format of all city codes ?
Thanks

You can use the Airport & City Search API to find an IATA code based on a city name
Otherwise, this website provides a list of IATA city codes.

Related

Public and up-to-date API for getting country, state, city

I need an API for getting country, state, city.
I need to get by following endpoints
/somepath - for countries
/:countryName - for states
/:stateName - for cities.
If you know any up to date API for this task, please write a comment about it.
Thanks

Wikipedia API: How to get the City of a Place / Page / Article

I want to get the city of Eiffel Tower Page by using Wikipedia API.
I used below code to get the Abstract Intro, WikiPageID, WikiURL, Thumbnail/Image, WikiDataID & Coordinates of wiki title Eiffel_Tower.
https://en.wikipedia.org/w/api.php?action=query&titles=Eiffel_Tower&prop=extracts|info|pageimages|coordinates|pageprops&exintro&explaintext&redirects&inprop=url
How could I get the Parent of Places?
Suppose I want City / District / State / Country of Wikipedia Places Page.
For Eiffel Tower page Wikipedia show Location detail as in Paris [City] and France [Country].
First find the Wikidata ID of the article (manually by following the "Wikidata item" link in the sidebar, programmatically e.g. by using the action=query&prop=pageprops API module), then use the Wikidata Query Service , e.g.
SELECT ?item ?itemLabel WHERE { wd:Q243 wdt:P17|wdt:P131 ?item }

Get CityCode By IP from GeoIP2 City Database

Is there any way of utilizing maxmind in order to get city codes via the IP of the user ?
In the following example, I am able to get the name of the City but not cityCodes. As far as I know maxmind does not have a support for city codes ;
Ref for maxmind support : https://www.maxmind.com/en/geoip2-city
E.g;
private static DatabaseReader reader = null;
InetAddress inetAddress = InetAddress.getByName(ipAddress);
CityResponse response = reader.city(inetAddress);
String cityName = response.getCity().getName(); //Istanbul
String cityCode = response.getCity().???code???; // The desired output : IST
As far as I am aware, the UN/LOCODE is the closest match to what you are asking for. MaxMind itself does not provide these codes in its data set, but it does provide a geoname_id for the city that can be used to look up the city in the GeoNames data set. GeoNames provides UN/LOCODE in their premium data set.

ESPN API - How can I retrieve college basketball conferences using the Teams API?

The support forums on ESPN.com recommend using Stack Overflow with the ESPN tag. That's why I'm here.
I'm trying to obtain a list of all NCAA college basketball teams using ESPN's Teams API. I started with this GET request:
http://api.espn.com/v1/sports/basketball/mens-college-basketball/teams?apikey=MY_API_KEY
That gave me a list of teams, but many of them are missing. For example, there is no Nebraska. So then I thought that maybe I need to get a list of teams by conference. So I read this in the documentation:
GROUPS: Allows for filtering by "group" or division, e.g. AL East, NFC South, etc. For group IDs and their corresponding values, make a request to http://developer.espn.com/v1/{resource}/leagues. Not applicable to golf and tennis.
So then I try to make a request to `http://developer.espn.com/v1/sports/basketball/mens-college-basketball/leagues?apikey=MY_API_KEY' and it says the page does not exist.
Is this a bug or user error?
First, I think you forgot sports in the resource. Try this:
http://api.espn.com/v1/sports/basketball/mens-college-basketball?apikey=MY_API_KEY&leagues
That will return a mapping of integers to conferences it seems according to the documentation.
That fetched me:
{"name" :"Atlantic Coast Conference","abbreviation" :"acc","groupId" :2,"shortName" :"ACC"}
...and much more.
Then once you have that, let's say 2 = ACC. You should be able to do this:
http://api.espn.com/v1/sports/basketball/mens-college-basketball?groups=2&apikey=MY_API_KEY'
to get everything on ACC mens' basketball teams.
Bear in mind the API is in beta though.
I could not figure out how to get a list of conferences, but I found out how to get the missing teams. When I was making the first get request, it was limiting me to 50 results by default:
http://api.espn.com/v1/sports/basketball/mens-college-basketball/teams?apikey=MY_API_KEY
They have a sandbox where you can play with your parameters, and I saw a limit and offset option:
http://developer.espn.com/io-docs
To get more than 50 results, you have to make multiple requests using the limit and offset parameters.
First Call:
http://api.espn.com/v1/sports/basketball/mens-college-basketball/teams/?limit=50&offset=0&_accept=text%2Fxml&apikey=MY_API_KEY
Next Call:
http://api.espn.com/v1/sports/basketball/mens-college-basketball/teams/?limit=50&offset=50&_accept=text%2Fxml&apikey=MY_API_KEY
And so on...

Google map geocoding address parser

I want to parse the addresses from Google geocoding API and store it as:
address
city
state
zipcode
country
Some places has full address from Google map and some just half, how can i know which part of the address is city, state or country? or just zipcode?
It would be helpful if some expert pointed out some help here.
In the response the geocoding API breaks up the address into AdministrativeAreaName (usually State) and SubAdministrativeArea. The SubAdministrativeArea area includes LocalityName (City), PostalCodeNumber (Zip Code) and Thoroughfare (Street Name and Number). For an example see: http://maps.google.com/maps/geo?q=1%20Infinite%20Loop,%20Cupterino,%20Ca. This is a geocode requst for Apple's Headquarters which has an address of 1 Infinite Loop, Cupterino, CA 95014.