What's South Korea's country name in API? - api

[SOLVED] the official name is Korea, Republic of. You can's miss any white space when you use it.
I am using Last.FM API, when I try geo.getTopArtists(Get the most popular artists on Last.fm by country), I need to input a parameter :
country (Required) : A country name, as defined by the ISO 3166-1 country names standard.
Then I checked ISO 3116-1, and found South Korea's name is Korea, Republic of
but it doesn't work. Then I tried korea, southkorea,koreaofrepublic ,all failed.
What should I input?
http://ws.audioscrobbler.com/2.0/?method=geo.gettopartists&country=korea&api_key=aa652ac51995d952d83d12093d25d9d9&format=json

It should be ISO 3166-1 country name standard .
https://en.wikipedia.org/wiki/ISO_3166-1

if you copy/paste this link in your browser, you will get the complete list of countries
that are supported by Rest Countries Api.
https://restcountries.com/v2/all
My suggestion is to do it in Firefox, because, list will be formatted in a readable way.
From there, you can search for the any data you might need.
For example, in the case of South Korea, you would go to the link, type 'korea' in the search bar, and you would get two results ( for North and South Korea), and when you expand the JSON object, you could read the exact name of the country as they listed it in their API. "Korea (Republic of)" in this case.

Related

Enforce MapBox Geocoding API to return only results with a zipcode

I'm working with MapBox Geocoding API to have suggestions of addresses in the location search feature of my website.
The following is a sample call:
https://api.mapbox.com/geocoding/v5/mapbox.places/Zur.json?country=ch&limit=5&proximity=8.765.432&language=en-GB&access_token=***
My goal is to enforce the api to return only results that include a zipcode.
For example if I input "Zur" (limiting the search to Swiss) I get the following:
- Zürich, Zürich, Switzerland
- Zürich, Switzerland
- Zürich Airport, Flughafenstrasse, Kloten, Zürich 8302, Switzerland
- Zurich, Buchs, Zürich 8107, Switzerland
The expected results should be without the first two lines, as they don't have a zipcode.
I tried implementing myself the removal of results without the zipcode on client side (just after I got an answer from the api), but it is a suboptimal solution (for example it doesn't ensure to have enough results).
I was not able to find such feature in MapBox. Is there a better solution out of there?
Just add ?types=address
See all list of types:
https://docs.mapbox.com/api/search/geocoding/#data-types

How can I query Wikidata API to get details of all the Korean films?

If possible, i want to return the results in Json or XML format. Is there any ways to do so? Earlier I did it using freebase.com but it is now deprecated. Please help.
This query would look a lot like the one to get the list of all films on Wikidata but adding another filter:
instead of http://wdq.wmflabs.org/api?q=claim[31:11424] (return all the entities marked as instances of film), you would do
http://wdq.wmflabs.org/api?q=claimCLAIM[31:11424] AND CLAIM[495:884] (return all the entities marked as instances of film and South Korea (Q884) as country of origin (P495))
http://wdq.wmflabs.org/api?q=claimCLAIM[31:11424] AND CLAIM[495:423] (the same for North Korea (Q423))
Then to parse the results and get the entities data, it would be the same as for the list of all the films
Remarques:
you will probably need to encode those URLs to get something that looks like: http://wdq.wmflabs.org/api?q=CLAIM%5B31%3A11424%5D%20AND%20CLAIM%5B495%3A884%5D
here is the full API documentation. Notice that this is an experimental API, which might be replaced in the coming year
The overview on Wikipedia may be more complete than Wikidata, as you've noticed yourself also. However, I could only find overviews per year, such as on https://en.wikipedia.org/wiki/List_of_South_Korean_films_of_2015.
To get a list of titles from that page, you would first retreive the raw wikicode of the page: https://en.wikipedia.org/w/index.php?action=raw&title=List_of_South_Korean_films_of_2015, and then run a regular expression such as /\{lang\|[^\|]+\|([^\}]+)/g on the code.
This returns a list of 149 titles.

Google Maps API Geocode Postal Code and set Country code?

I'm using this API call to Google Maps to get the latitude and longitude of a postal code
http://maps.googleapis.com/maps/api/geocode/json?address=2340&sensor=false
The postal code is in Australia. This API call returns locations all around the world with partial matching postal codes in the address.
Is there a parameter I can use to set the country to Australia?
Thanks
The correct way to do this is not via region biasing but rather using component filtering:
https://maps.google.com/maps/api/geocode/json
?components=country:AU|postal_code:2340
&sensor=false
Some demonstrations:
2340
93274
Please note that if you use the components parameter, you don't need to specify the address parameter.
The documentation says that Region Biasing is based on CcTLDs, which would make Australia au (haven't tried it myself).
Although it also states this:
Note that biasing only prefers results for a specific domain; if more relevant results exist outside of this domain, they may be included.

What kind of international code is used for identifying countries like

I need the name of the code in with:
ROM: Roma, Italy
BCN: Barcelona, Spain
MAD: Madrid, Spain
BUE: Buenos Aires, Argentina
PCM: Playa del Carmen, Mexico
PAR: Paris, France
LON: London, UK
etc...
I am developing an app that searches flights between countries and I need a full list of this kind of codes to interatct with another third party API.
I tried to google it but the only things that apears are flight sites instead of a wikipedia page or something.
Can you give me any pointer?
These are IATA (3 letter) Airport Codes.
This list may help you:
http://www.photius.com/wfb2001/airport_codes_alpha.html.
You could also use the official IATA search engine (Location code category).
If you want an officially sanctionned list, you apparently need to pay a hefty price.
It seems you are looking for IATA airport codes:
The assignment of these codes is governed by IATA Resolution 763, and
it is administered by IATA headquarters in Montreal. The codes are
published biannually in the IATA Airline Coding Directory.
Unfortunately, that authoritative list is quite expensive. But I am certain you can find many unofficial lists by searching the web.
Use 'World Airport Codes' search query and Google's your uncle. Below are some links from my search:
World Airport Codes
Airport Codes
Localized World Airport Codes
Openflights

Facebook Country list for user locations

Is there a list of "facebook country names"?
in my iphone app , after retrieving the location information, I want to select the country back, and the user will be able to change it, so I have to find the list of countries and, if possible cities, used by facebook
I believe Facebook uses the ISO 3166-1 alpha-2 codes (2 digit country codes, ie United Kingdom is 'GB').
http://www.iso.org/iso/country_codes/iso_3166_code_lists/country_names_and_code_elements.htm