Free REST API for countries, states and cities
Follow the below steps from which you can access the free APIs for the country, state, and city information
Country State City Dropdown Demo
Steps to access the APIs
Before consuming any of the APIs, Generate the Authorization token using the above mentioned URL along with your email and api_token, In the response you will be seeing the auth_token which needs to passed in any API using the Bearer Authentication as shown below
Request 1 : GET https://www.universal-tutorial.com/api/getaccesstoken
var req = unirest("GET", "https://www.universal-tutorial.com/api/getaccesstoken");
req.headers({
"Accept": "application/json",
"api-token": "AuXnFjES43NqbdODZoc1anLtpO9op_9HsA7hqU56HJoxlbbNrMsUAzmsp6cqoZ0HhWQ",
"user-email": "[email protected]"
});
Response
{
"auth_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyIjp7InVzZXJfZW1haWwiOiJtdmdhZGFnaUBnbWFpbC5jb20ifSwiZXhwIjoxNTY2MjM0ODU0fQ.nMWPN38zptwwDKAo11bFyjhCRuzNhZc6NqqCaYJVxP0"
}
Request : GET https://www.universal-tutorial.com/api/countries
Using the api_token and the token you have got in the above response you can make any of the REST APIs
var req = unirest("GET", "https://www.universal-tutorial.com/api/countries/");
req.headers({
"Authorization": "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyIjp7InVzZXJfZW1haWwiOiJtdmdhZGFnaUBnbWFpbC5jb20ifSwiZXhwIjoxNTY2MjM0ODU0fQ.nMWPN38zptwwDKAo11bFyjhCRuzNhZc6NqqCaYJVxP0",
"Accept": "application/json"
});
Response
[
{
"country_name": "Afghanistan",
"country_short_name": "AF",
"country_phone_code": 93
},
{
"country_name": "Albania",
"country_short_name": "AL",
"country_phone_code": 355
},
{
"country_name": "Zimbabwe",
"country_short_name": "ZW",
"country_phone_code": 263
}
]
Request : GET https://www.universal-tutorial.com/api/states/United States
By using the country name as shown the URL will give you all the states belonging to the countries
Response
[
{
"state_name": "Alabama"
},
{
"state_name": "Alaska"
},
{
"state_name": "Arizona"
},
{
"state_name": "Arkansas"
},
{
"state_name": "Byram"
},
{
"state_name": "Wyoming"
}
]
Request : GET https://www.universal-tutorial.com/api/cities/Alaska
By using the state name will give you all the cities belonging to the states
Response
[
{
"city_name": "Anchorage"
},
{
"city_name": "Barrow"
},
{
"city_name": "Bethel"
},
{
"city_name": "Wasilla"
}
]
Some updates have been done to increase the API performance today !!
Hi. First of all, thank you soo much for this API resource. it has been really helpful to some of us. But I would like to make a request. As I am from Ghana, I tried to select Ghana which works fine. But when I select or hit the cities endpoint with the Greater Accra Region as the parameter, I get an empty array, can this be fixed, please?
@Delprane Dela, It's our pleasure to help you, we have done the update based on your request, kindly revert us back with your comments here or you can reach us at [email protected] for any further modifications or new requests !!
It stops responding after 24 hour of auth token generation. May I need to create new auth token every day?
@Hammad, Due to security reason we expiry auth_token every 24 hrs hence users are requested to do https://www.universal-tutorial.com/api/getaccesstoken to get the new token and also we are improving the errors returned during any action in upcoming weeks.
We have updated our APIs to show very useful message during the auth_token expiration, so API response status would be 500 and the api response would be as below during such condition { "error": { "name": "TokenExpiredError", "message": "jwt expired", "expiredAt": "2020-02-18T17:55:22.000Z" } } This helps every one to read the error message easily and if it's expired token ,you can generate the new one
i am getting 504 GateWay Timeout when a sent a request . Why is it So ?
@Shubham, Can you please share us the API endpoint which you are trying along with the headers in an email to [email protected], So that we can help quickly.
I am sending 'get' request using Postman . Request url is : https://www.universal-tutorial.com/api/countries/ and the body in json is : { "Authorization": "nLsYM6PoE9D9ReXB_IvI-i2X-70ZauAITWgW4yiRAsEdcVsORc2awdoA5hPLroae94c eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyIjp7InVzZXJfZW1haWwiOiJtdmdhZGFnaUBnbWFpbC5jb20ifSwiZXhwIjoxNTY2MjM0ODU0fQ.nMWPN38zptwwDKAo11bFyjhCRuzNhZc6NqqCaYJVxP0", "Accept": "application/json" }
Everything is fine with the API, but it's strange that the retrieved states are not actually in real for those countries. One example is for Australia. How many states in Australia in google gives 6 in number. But here in API response gives more than that. I assume rest of the other than 6 are suburbs name. Which is not meaningful. Thank you.
HI
@Sangam, Thanks for your valuable feedback and we will analyse and update the information accordingly.
After some days it not working... returning token expired...
@Sangam Basnet, We have updated the States and Cities for Australia based on study with various resources
@Sachin Kohare, It's expected that the auth_token will be expired every 24 hours and you need to generate the new token, please drop us an email to [email protected] for any further assistance
Can we get the states using country code...???
Hello sir, Thank you so much for this api resource.
It's good but giving some extra responses, like USA state response. It will be good if the response gets using country code. Thanks...
Hi, I want to use this free api in culr call in php. can i?
Hi, I want to use this free api in culr call in php. can i?
@Dharti Mirani, Yes, of course, you can use in PHP with cURL as below <?php $curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_URL => "https://www.universal-tutorial.com/api/getaccesstoken", CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 0, CURLOPT_FOLLOWLOCATION => true, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "GET", CURLOPT_HTTPHEADER => array( "api-token: your-api-token" ), )); $response = curl_exec($curl); curl_close($curl); echo $response;
Good day, there is no cities for Abuja Federal capital territory for country Nigeria
The API has suddenly stopped responding with an error of 503 (Internal Server Error) - www.universal-tutorial.com/api/cities/Jharkhand:1 Failed to load resource: the server responded with a status of 500 (Internal Server Error).
it will be the best if we have zip-code base on too but thank you so much
@Emma Pre, The below list of cities have been added to the State Abuja Federal Capital Territory Abaji, Abuja, Bwari, Gwagwalada, Kuje, Kwali
@Prateek Kapoor, It may be a temporary issue, it's always up and running
Hi, I am now getting this issue whenever i try to hit the api to get the access token - has been blocked by CORS policy: Request header field api-token is not allowed by Access-Control-Allow-Headers in preflight response.
Hi I'am facing a CORS issue when i am hitting the API from local host to get the authentication token - Access to XMLHttpRequest at 'https://www.universal-tutorial.com/api/getaccesstoken' from origin 'http://localhost' has been blocked by CORS policy: Request header field api-token is not allowed by Access-Control-Allow-Headers in preflight response.
@Prateek, Sorry for the inconvenience and this was caused due to our server up-gradation, you can directly reach out to us in Slack for any immediate response as well https://join.slack.com/t/universaltutor5/shared_invite/zt-cxftypib-joKiDxX3q8hGvP5idp5hDQ
Hi, I'm testing this using postman at the moment, I get an access token using my email address and key, but when I call the countries endpoint using the generated token, I receive an error stating that I must "Please generate the valid Bearer authorization using valid email and api_token". Any help would be greatly appreciated.
How about towns? I wanna get a towns list in a city. Could you support API?
@Hai Nguyen Long , We are planning the towns in later future as we need to align towns for each districts ,once we have all the data we will provide that options
@Paul Melia , Hope your issue is resolved, if not you can send us information to [email protected]
thank you so much for this wonderful api, i want to suggest that you include support for country and state codes most payment gateways requires billing address for state and countries to come in codes for example NG for nigeria
i also wish to ask whether the api token also expires like the access token after 24 hours?
i am trying to get all countrie .but it show some error . {"error":{"code":"PROTOCOL_ENQUEUE_AFTER_FATAL_ERROR","fatal":false}} how to reslove this?
i am trying to get all countries .but it shows this error . {"error":{"code":"PROTOCOL_ENQUEUE_AFTER_FATAL_ERROR","fatal":false}} how to reslove this?
Hello all, there might be some comments which are not addressed here but are addressed through email or slack communications.
is there anyway to get multiple countries states ??
please answer me as soon as possible, I need to know that now )) thanks
@Gor Muradyan , Currently it's possible to fetch the details of one country at time only and also in any case if you want quicker response we suggest you in contact directly in slack , Thanks !!
Hey, can I consume this API using java through retrofit?
@Mutebi Raymond, Yes of course it's works with retrofit as its also one of http client
Hello,@universal Tutorial -> i faced strange issue today, this all 3 apis working great for me till today noon, but now when i want to generate Token its give me error..why not working with same Code? I used in React native. - get response like - response.json() -> its working till today noon, but now its give error like JSON parse error:Unexpected 'object' , means i cant get token when i use response.json() , anything change in API? please update as soon as possible.
@Milan Patel ,Due to lot of user traffic one of our service crashed and hence APIs were failing and now we have resolved issue
@Universal tutorial, Thanks for fast response, but don't know its not working for me today also, can you please update after problem is resolved?
@Milan Patel infact we designed this webpage in such way that the drop downs in top of page uses same API and if API are working well and drop-down works. Can you mail us the API endpoint and request headers etc so we can look into the details
Hey, Thanks for this amazingly useful API. I tried to use it for India country recently but some of the city names are being returned in states API. Example of such values are "Paschim Medinipur", "Natwar" & "Vaishali". Can you please check this?
Surely you need to pass the country as well as the state name in order to get the city names? Is there really no instance on the planet where two countries share the same state or province name?
@Hriday Modi Thanks for your feedback and we have reviewed your request and it's valid , so we have removed these information from Indian states
[email protected] , Currently we are not aware of that situation yet, kindly let us know in case you come across ?
https://www.universal-tutorial.com/api/states/United States Calling it in url, but getting response failure. I think the url contains space " " in United States. Same issue in United Kingdom. How do we call the api with these countries name? Other countries like Austrialia works. But not work on above countries.
Needed to pass the url using addingPercentEncoding for a solution. Thanks!
I signed up fo an access token a day or so ago, It worked fine; however. now its saying my token is expired.Why am i getting a token expired error?
Hello Author, Thans for making this useful api. But in this api a lot of data of bangladesh is missing. I request you to update the data of banglades. I upload two josn file one of my server in this link http://team-executive-bd.com/bd_json_data/states.json and http://team-executive-bd.com/bd_json_data/cities.json . please as early as possible update acccording to data
Hello peqaxagar, can you please share us an email about missing details , as we have verified details in accordance with wikipedia , we wanted to be sure before adding or modifying any existing details
Hello! Most of the cities in Spain are not showing up, we need to populate those lists for each state of Spain. Apart from that, in Spain "Pais Vasco" is not a state, it includes 3 states that are already on the list. When can we implement those changes? This is urgent please.
How can i pass parameter to the States API as country name? What should be endpoint URL to get the states with given country name
In the "States" API for the United States there are a few options being returned which I don't think belong. : "Byram", "Cokato", "Lowa", "Medfield", "New Jersy" (duplicate entry and misspelled), "Ontario", "Sublimity", and "Trimble". I'm also trying to understand how to pass the authorization token from the first API call to the second API call, so I don't have to manually update it every 24 hours. Any help would be greatly appreciated.
@Yaiza Muñoz , We have updated the states for Spain country and still if you have any queries , please reach out to us through email [email protected]
@Chase Catalano , Thanks for you feedback, we have updated the states of USA and also regarding the token we are expiring the token due to security concern, Please reach out to us, in case in you need any further help on handling the token
https://www.universal-tutorial.com/api/countries/ Action: GET headers: Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyIjp7InVzZXJfZW1haWwiOiJzYW5kZWVwZ3VwdGEwMjE5OTJAZ21haWwuY29tIiwiYXBpX3Rva2VuIjoiVDZWUE5SZlduTEVuZ2wwd3Z2Ny1nV3ZjT0pEcU9KSm1zdmg2Q050ajlrenVnVFJiSG91dURPU1d5N3NiYnN0bm1oMCJ9LCJleHAiOjE1OTkzMzc1NjF9.J_lvqfmX5dMW7vELnJXjaPDBzf9XgQi0tcd1lKDKXpM Accept: application/json
{ "error": "Please generate the valid Bearer authorization using valid email and api_token" }
Hello Sir. Thank you so much for this API. I have been searching for such API from last year and this API really helps me. I would like to make a request that this API has not all the cities of Pakistan. Can you please add more cities of Pakistan? Especially for North-West Frontier province of Pakistan. Thanks again.
This is a great and simple to use API. But I think it should include a shortcode for states e.g GA for Georgia
I'm getting an error 504 gateway timeout. What should I do to overcome it?
Great stuff, for the US there are some states that don't belong: Ontario, Ramey, Trimble.
@Claudio Rodriguez Thanks for your feedbacks, we are looking into this and update the details accordingly !!
Hello, We are using ur API for the country code and facing issues in some cases. You have missed some country codes like Congo has two country codes that is +242 and +243 for Democratic Congo and Republic Congo respectively. And API giving only one code, so plz add both codes for the Congo country. Thank you!
Shoould be Albatera instead ALbatera in Spain/Alacant/. Thanks for your work guys,
@Sachin Kohar, We have verified the data against various sources and found that country code of Democratic Republic Of The Congo is 243 and we have updated the details accordingly.
@randy varela, We have updated the record to Albatera
I'm still having the Please generate the valid Bearer authorization using valid email and api_token, everytime I try to fetch countries
Hi I am writing your library package for Laravel so everyone can use the api easy way. Can you please tell me is there any api with whom i can Generate Token "api-token" which we are using in "https://www.universal-tutorial.com/api/getaccesstoken" so i can complete it. Thanks.
@Manpreet Singh , You can design the library in a such a way that, allow users to pass the api-token and email address and then you can pass these information and make a call to API to fetch the token if the token is expired and you can pass these information to next subsequent APIs
I'm still having the Please generate the valid Bearer authorization using valid email and api_token, everytime I try to fetch countries
unbale to create api token.. seems like it is not working
Hey, I have been using your API and it is working quite well. But, there is one issue: When I call the state api with India as the country, response contains "Kenmore" as a state which is not correct. Can you please check and fix it?
It's sowing me 'Make sure to use real email address while registering.'
Waste of time. Not recommended at all. And even saying this comment too short
@Wasama Jabeen, kernandez buhub , Issue is resolved now, Please try to generate the token now.
@Aakash Nihalani, We have updated the states list for India, kindly check now.
{"error":"Please generate the valid Bearer authorization using valid email and api_token"} when calling this API: https://www.universal-tutorial.com/api/countries/
Hi, could you update provinces in Vietnam, so it will show the cities too. BTW, could you update all the provinces/states so it will show all cities in the world. Thanks. This is GREAT help!
@Andy Dao, We will take look on the cities of Vietnam, Thanks !!
Error 504 Gateway time out www.universal-tutorial.com Host Error
I'm still having the Please generate the valid Bearer authorization using valid email and api_token, everytime I try to fetch countries
Hello and thanks for this amazing API. My only suggestion is as regards the city in lagos state, Nigeria, which i can personally verify do not cover all cities. An update with all the available cities would be nice. Thank you
The getaccesstoken endpoint keeps returning the same token which is expired
Hello, thank you for the API. Unfortunately, many cities are missing for Romania's states (for example state api/cities/Cluj returns far fewer cities than in reality and api/cities/Satu Mare returns empty)
@Marian Mates, We will be verifying the details and updated the details accordingly, Thanks !!
Useful API and sure has potential but I think we might have a future issue. I do not have any examples to share but wonder why we do not include Country name/code while searching for Cities in a state? I am throwing out an example, but assuming state Bedfordshire (United Kingdom) how can we assume that Bedfordshire exists only in United Kingdom. Potentially we can have a Bedfordshire in Canada, United States, Australia, South Africa, or any other country where British ruled!
I am getting this error when i access cities and countries api, Please generate the valid Bearer authorization using valid email and api_token
Hi, thanks for the API, it was very useful, but i have a problem, when i search the cities through a state that has 1 or more spaces it does not work, for example: https://www.universal-tutorial.com/api/cities/Baja California (Baja Californa is a state of Mexico)
@taikus jango,You need to encode the space with %20 while making the request.
hello, when i am trying to get access token, it is showing error of "Email is not registered", but I already registered with the same email id from which I am commenting here
Hi, i am trying to get access token, it is showing error of "Email is not registered", but I already registered!
Hi, this is a cool resource, let me point a few things though. You should implement a filter when you call for states and cities, so the states and cities are returned for a given country. Here is a flaw you can replicate in the demo on this landing page. Select Angola, from the states list choose Huila, this is returning a list of cities for Colombia and I guess that Angola too, which is misleading. Thank you guys for your efforts.
"error": "Email is not registered"
Will you consider to fix the cities endpoint? it should filter cities by country as a filter parameter, not only the state name, take the example of Angola here in you demo, select Huila as state and look at the cities result
@Augusto Martinez, Thanks for pointing this out, we will update the API, but we will not hurry as many people are using these API, We will analyse thoroughly and update.
its not give me country data ..why?? could you please help me forr this??
I am continuously getting "error": "Email is not registered" issue, even though I have verified my email. What seems to be the issue?
Please can you tell me ,How To Implement This API in Python-Django>
aaaaaaaaaaaaaaaaaaaaaaaaaaaa
Hi Everyone, whoever is looking for Country State City Data api. Please have a look at api that I created. http://countrystatecity.org It has swagger api documentation and you can get countries, thier States cities you can get all these by ID or iso2 code of country state or city
Hi, thanks for the great API. I noticed that under South Africa -> Gauteng, there is not city for Randburg, can you add it please? Not sure what the process is for requesting additions. Thanks
Hi there, thank you for the great API. However, I am getting an error, and have used postman to test. When I go through the questions here in the forum I see you have blatantly ignored the people asking about the same error. Please may you please advise how to resolve: "Please generate the valid Bearer authorization using valid email and api_token". I have done everything correctly and received a valid token which I also checked on JWT.IO
Hi. First of all, thank you soo much for this API resource. it has been really helpful to some of us. But I would like to make a request. If I select the State New Brunswick under the Country Canada.
Hi. First of all, thank you soo much for this API resource. it has been really helpful to some of us. But I would like to make a request. There are no cities available inside State New Brunswick under the Country Canada.
Hi. First of all, thank you soo much for this API resource. it has been really helpful to some of us. But I would like to make a request. There are no cities available inside State New Brunswick under the Country Canada.
Hi. First of all, thank you soo much for this API resource. it has been really helpful to some of us. But I would like to make a request. There are no cities available inside State New Brunswick under the Country Canada. Can you please add the cities of New Brunswick
well as mentioned below in comments the auth_token get expired in 24 hours, my question is can I get a new one with my api_token and user_email or they will expire too
Hi, Just to start, thank you so much for this API, the API is so helpful to get the Location Data on our companies account page. I am a software engineer myself with knowledge of React, REST APIs, etc and I would live to contribute to this great open source API. I would also like to make a request for Database Change. I am from Toronto, Canada and one of my client is in a province called "British Columbia" and then there are no cities in that province. Here is the list you can refer for cities in British Columbia (https://en.wikipedia.org/wiki/List_of_cities_in_British_Columbia). Also as we are a growing startup, we will be getting clients all around the globe and we can help make this service more accurate by adding more and more locations as it comes through. Thank you again for this API.
Hello Team, I have started using this api and it works well. Only one thing i found is that,
Hello Team, I have started using this api and it works well. Only one thing i found is that,in response it says '14'more rows for states. how to get those data ? Any help would be great.
Hello Team, I have started using this api and it works well. Only one thing i found is that, after getting list of state it says 18 more rows so how would i get those. ANy help would be great.
Hello all, if you have lost token, please login with email id you used and use Lost your API token ?
Error when calling with postman get the error Please generate the valid Bearer authorization using valid email and api_token . I copy and paste the email and api token so there are no typos
please update for provincial and city data in Indonesia, because there are still many that are not appropriate and there are still many cities that are not yet available
Great service. Thank you! Please remove "Ontario" as a state within the "United States".
When making the request I am presented with Please generate the valid Bearer authorization using valid email and api_token from postman and from the browser
event after registration getting error tin accesstoken api for "Email is not registered"
[Violation] 'readystatechange' handler took 1870ms ,,getting this when im calling countries
error: "Email is not registered" ...?
After I requesting access token successfully with no error;
After I requesting access token successfully with no error;
After I requesting access token successfully with no error;
Sorry for the three mistakes earlier, i tried pressing enter to go to the next line...... I successfully got my auth_token but when I wanted to make request to fetch state, I keep getting an error meanwhile it worked well with postman....... This is the error I keep gettiing ---- {"error":{"name":"JsonWebTokenError","message":"invalid signature"}}
i just want country as India and states and cituies according to it, but im getting this error in console: GEThttps://www.universal-tutorial.com/api/states/India
there is a punjab state in india and a punjab state in pakistan. This api mixes both the cities when search for punjab state. Can we find based on both country and state combination?
Hi! Thank you for this API, it's very useful. But I have a request. I'm from Peru and when I try to get "city_name" from Lima y Callao it brings me a empty array, this happen also with others states. Can this be fixed?
hello, i have problem with the states that have space " " , im trying to request "cities/Nueva%20Esparta" but i'm not sure if the right way (that is a state of venezuela) im try too "cities/Nueva%20esparta" please can someone helpme T-T
hello, i have problem with the states that have space " " , im trying to request "cities/Nueva%20Esparta" but i'm not sure if the right way (that is a state of venezuela) im try too "cities/Nueva%20esparta" please can someone helpme T-T
Good day thanks for this great api but i requested to generate token and it gives me this error "The api_token has been already generated with your Email, Please reach out to [email protected] to get the token"
Hello, thanks for the API, it's awesome, but i have only one bug. When I searching cities using States API, don't work when the name have spaces " ", I'm sending with %20 but its only works with countries, but with states don't work. I hope you can repair it as soom as posible. Thanks for all
sorry, I wanted to say "When i searching using Cities API" its don´t work if the name of the state have spaces
Esta API es genial muchas gracias. Pueden por favor implementar en esta API las banderas de cada país ? es decir la imagen de las banderas ? Por favor
Hello, first of all, thanks to all the team behind this. But there is a problem, in cities that have blanks, you get an empty array. Could you solve this please?
How to get the countries in Spanish?
I use that api but it throw me that error jwt malformed that my code await axios.get("https://www.universal-tutorial.com/api/countries/",{ headers:{ Authorization:"Bearer ZyJpT8nhPcY2yeMRXPOv0QSN25aj2Dfh-sGB3Gi5OOe4aXs355CMyT82jd8NBedmfF8", Accept:"application/json" } })
Please add a logout feature to the website
Hello. I have a problem with states because when I request some state that cotains a space, like Rio de Janeiro, the response is null. It happens with all states which contains spaces into the name, but, It doesn't happen with countries. Thanks for your help.
Hello. First of all, thank you very much for this API resource. It has been really helpful for some of us. But I would like to make a request. Since I'm from Mexico, I tried to select Mexico, which works fine. But when I select 'Estado de Mexico' as a parameter to get the list of cities in that state, I get an empty array, this happens with countries and states with a name made up of two or more words, can you fix this please?
Hi, I was wondering if you can add multilingual features to this list, it would be awesome to have!
There are 4 objects that return from "https://www.universal-tutorial.com/api/states/United States" that are not US States. "47. Trimble, 44. Sublimity, 40. Ramey, 37. Ontario". Can these please be removed? It makes the query for US States nearly useless for form validation.
hi, I am chintam Anand
hi, I am chintam Anand
i trying to use your API to get list of cities and states. but I keepOn receiving the forbidden message. I am passing all the required information in headers like bearerToken, payload Type, but still i am receiving an error message. Can you help me here.
Hi. First of all, thank you soo much for this API resource
Excelente API pero noté que al intentar filtrar las ciudades de x estado, no cargan, según veo es por los espacios, por ejemplo si intento buscar las ciudades de "La Guajira" no me sale ninguna
the access token only lasts about 3 days, how do I make it last for months, do you have to pay for some kind of plan?
I can't get the authorization token,
I can't get the authorization token, I'm getting Error: connect ETIMEDOUT 52.86.6.113:443 when using Postman. user-email: [email protected] Accept: application/json api-token: "the token provided in the request acces for API" Connection: keep-alive
I can't get the authorization token, I'm getting Error: connect ETIMEDOUT 52.86.6.113:443 when using Postman. user-email: [email protected] Accept: application/json api-token: "the token provided in the request acces for API" Connection: keep-alive
I can't get the authorization token, I'm getting Error: connect ETIMEDOUT 52.86.6.113:443 when using Postman. user-email: [email protected] Accept: application/json api-token: "the token provided in the request acces for API" Connection: keep-alive
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>Error</title> </head> <body> <pre>Cannot GET /api/getaccesstoken%0A</pre> <script defer src="https://static.cloudflareinsights.com/beacon.min.js/v652eace1692a40cfa3763df669d7439c1639079717194" integrity="sha512-Gi7xpJR8tSkrpF7aordPZQlW2DLtzUlZcumS8dMQjwDHEnw9I7ZLyiOj/6tZStRBGtGgN6ceN6cMH8z7etPGlw==" data-cf-beacon='{"rayId":"752cc4cbf96cb998","version":"2022.8.1","r":1,"token":"354e309f1a274add8be94b72e468f0b7","si":100}' crossorigin="anonymous"></script> </body> </html>
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>Error</title> </head> <body> <pre>Cannot GET /api/getaccesstoken%0A</pre> <script defer src="https://static.cloudflareinsights.com/beacon.min.js/v652eace1692a40cfa3763df669d7439c1639079717194" integrity="sha512-Gi7xpJR8tSkrpF7aordPZQlW2DLtzUlZcumS8dMQjwDHEnw9I7ZLyiOj/6tZStRBGtGgN6ceN6cMH8z7etPGlw==" data-cf-beacon='{"rayId":"752cc4cbf96cb998","version":"2022.8.1","r":1,"token":"354e309f1a274add8be94b72e468f0b7","si":100}' crossorigin="anonymous"></script> </body> </html>
BELLINGHAM city is missing when we select Massachusetts, United States. Can you please add it for us.
BELLINGHAM city is missing when we select Massachusetts, United States. Can you please add it for us?
No funciona! aún presenta problemas cuando consulto los paises... Alguna ayuda?
por que me manda este mensaje : {error: 'Email is not registered'}
Please generate the valid Bearer authorization using valid email and api_token
The token we generate through name and email will be stay permanent or it will changed ?
The token we generate through name and email will be stay permanent or it will changed ?
The token we generate through name and email will be stay permanent or it will changed ?
The token we generate through name and email will be stay permanent or it will changed ?
The token we generate through name and email will be stay permanent or it will changed ?
"Your message wasn't delivered to [email protected] because the address couldn't be found, or is unable to receive mail." I got this mail return.
Hi! I keep getting an error: Email is not registered
Hi, thanks for the API, it was very useful, but i have a problem, Cannot GET /api/cities/Sector%20claimed%20by%20Argentina/UK
I want to use it without expiring in every 24 hours and generate new token, what is the procedure to get it for permenent usage, if need to purchase the plan or any thing, please share it.
http://www.universal-tutorial.com/api/countries this is supported in Java , when i'm calling api through java it is redirecting. Is I'm doing wrong any thing ?
How many calls a day, any limitations?
wdsadasdasdadasdasdasdsad
Is it possible to show the names (countries, cities...) in another language?
how to use this api
how to use this api
Thanks very much for this great api which touch data all over the world. I encountered forbidden error with get cities. GET http://localhost/scourpro/GET%20https://www.universal-tutorial.com/api/cities/Adamaoua 403 (Forbidden). This is same for all states in all countries that i choose.
I'm sorry, I withdraw my previous comment, it's my error and I have fixed it. Everything is just working fine. Thanks
its not working api
how to use this in deluge script
was getting this error Access to XMLHttpRequest at 'https://www.universal-tutorial.com/api/states/United%20States' from origin 'http://localhost:4200' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
is it possible to have the country is iso3 and the state is iso2? gracias
Giving me 500 error code. Seems server is busy or not working.
If you have "Please generate the valid Bearer authorization using valid email and api_token" error when fetching API you would try encoding access_auth. For example if you are using javascript:
If you have "Please generate the valid Bearer authorization using valid email and api_token" error when fetching API you would try encoding access_auth. For example if you are using javascript:
Hi, Please share my token , this error " The api_token has been already generated with your Email, Please reach out to [email protected] to get the token".
where can I get my api [email protected]
{ "error": { "name": "JsonWebTokenError", "message": "jwt malformed" } }
Hi, i get this error, when i try to use https://www.universal-tutorial.com/api/countries/. -- { "error": { "name": "JsonWebTokenError", "message": "jwt malformed" } }
iam unable generate access token it showing un register email address
"error": "Email is not registered" face this problem how to resolve it.
"error": "Email is not registered" face this problem how to resolve it.
I face the error "Email is not registered". when I use token and Request.
Hi i have an issue using the api i'm using for my Shopify store. i got the error that unirest is not defined
Good evening, I think there is a problem with requests that have spaces, that is, with countries or states whose names are more than one word.
For those who report the error "email not registered", what they can do is register, at the top right there is an option where it says login, there it gives you the option to register, I registered and I no longer get the error they mention
Error message shown as : email id is not registered
After registering via email the error is still showing
cities are not available for all the states of canada for example calling the cities api with New Brunswick state the available cities are 0
Hello Sir, i am getting the Authorization token but when i am putting it for get countries. it is saying {"error":{"name":"JsonWebTokenError","message":"invalid token"}}. please help
{ "error": "Please generate the valid Bearer authorization using valid email and api_token" }
Cual es el tiempo de duracion del token?
I recently integrated the API into my project and found it incredibly useful. However, I encountered a problem wherein the API token expired after 24 hours of use. This token expiration posed a challenge for the continuous functionality of my application. Hence, I am reaching out to inquire about a potential solution to this issue. Is there a way to extend the token's validity period or obtain a more permanent access solution to ensure uninterrupted usage of the API?
I recently integrated the API into my project and found it incredibly useful. However, I encountered a problem wherein the API token expired after 24 hours of use. This token expiration posed a challenge for the continuous functionality of my application. Hence, I am reaching out to inquire about a potential solution to this issue. Is there a way to extend the token's validity period or obtain a more permanent access solution to ensure uninterrupted usage of the API?
I recently integrated the API into my project and found it incredibly useful. However, I encountered a problem wherein the API token expired after 24 hours of use. This token expiration posed a challenge for the continuous functionality of my application. Hence, I am reaching out to inquire about a potential solution to this issue. Is there a way to extend the token's validity period or obtain a more permanent access solution to ensure uninterrupted usage of the API?
I registered my email and verified it. After running this API, I received an error stating, 'Your email is not registered.so give me the proper solution?
seria bueno tambien poder obtener el codigo postal
why i aM not getting token
Siguen actualizando la api?
Is it possible for one state name to belong to multiple cities. I was thinking if you narrow down the city api to https://www.universal-tutorial.com/api/cities/United State/Alaska, i.e, including the country name and state name to city api, for specificity
for people getting auth token issue save the authtoken in a variable
for people getting auth token issue save the authtoken in a variable
use try { const response = await fetch('https://www.universal-tutorial.com/api/getaccesstoken', { headers: { 'Accept': 'application/json', "api-token": "", "user-email": "" } }); if (!response.ok) { throw new Error(`Failed to fetch access token. Status: ${response.status}`); } const data = await response.json(); authToken = data.auth_token;
How can we contribute?
No funciona con el Token que Genera
No funciona con el Token que Genera
Hi Guys, There are no towns/cities for the UK search for states North Yorkshire, South Yorkshire, West Yorkshire or East (Riding of) Yorkshire. All 4 are empty. There is a State Yorkshire but that has only 3 items in the city options. Can these please be addes/updated. Many thanks
how to use this in android studio
Cities Data not working for India
Cities Data not working for India
first of all thank you so much for this api.
why is my api not working even after using the right fetch request syntax and generating my api correctly. I need your assistance to get it done thanks
why is my api not working even after using the right fetch request syntax and generating my api correctly. I need your assistance to get it done thanks
Need to update some states in the UAE as it shows two similar states: Sharjah and Sharjha. This situation is confusing.
KLw5zapr-0wfvbU6m2nP8GE4kpVUzZ1KXCB6TJldMTE6fmNpvlcFFdw2C5sOyt51cO8
KLw5zapr-0wfvbU6m2nP8GE4kpVUzZ1KXCB6TJldMTE6fmNpvlcFFdw2C5sOyt51cO8
KLw5zapr-0wfvbU6m2nP8GE4kpVUzZ1KXCB6TJldMTE6fmNpvlcFFdw2C5sOyt51cO8
how can i get api ? can anyone help me please
is this api for javascript
Is i can get all the states along with country name
Hello, Universal Tutorial I was following the same exact steps u declared int he tutorial. But after getting the auth token when i call the county endpoint it is showing internal server error.. please look itnto it. Error is like this :- GET https://www.universal-tutorial.com/api/countries/ 500 (Internal Server Error)
API is working fine but sometimes it gives me network error
Mill Creek is a city in Snohomish County, Washington but it does not appear in the database, is it located differently ? or can it be updated ?
It says email is not registered. But I have signed up
i can not access my profile
not res[psive please
i get the error email not registered
GET https://www.universal-tutorial.com/api/states/India 500 (Internal Server Error)
{ "error": { "name": "JsonWebTokenError", "message": "jwt must be provided" } }
after call the request the error is show {"error":"Email is not registered"}
Is necessary to get a new token each 24 hours yet?