All Projects → shivammathur → Countrycity

shivammathur / Countrycity

Licence: mit
🌎 Geodata API - Get countries, and cities to plug in a select drop-down.

Projects that are alternatives of or similar to Countrycity

Countries
🌎 Public GraphQL API for information about countries
Stars: ✭ 156 (+151.61%)
Mutual labels:  api, countries
Laravel cities
Find any country/city in the world. Get Long/Lat etc. Deploy geonames.org database localy. Optimized DB tree
Stars: ✭ 133 (+114.52%)
Mutual labels:  api, countries
Countries States Cities Database
🌍 World countries, states, regions, provinces, cities, towns in JSON, SQL, XML, PLIST, YAML, and CSV. All Countries, States, Cities with ISO2, ISO3, Country Code, Phone Code, Capital, Native Language, Timezones, Latitude, Longitude, Region, Subregion, Flag Emoji, and Currency. #countries #states #cities
Stars: ✭ 1,130 (+1722.58%)
Mutual labels:  api, countries
Yasumi
The easy PHP Library for calculating holidays
Stars: ✭ 788 (+1170.97%)
Mutual labels:  api, countries
Ins sandstorm
[INS] Config setting for our sandstorm server
Stars: ✭ 61 (-1.61%)
Mutual labels:  api
Data Science Best Resources
Carefully curated resource links for data science in one place
Stars: ✭ 1,104 (+1680.65%)
Mutual labels:  api
Nicknamer
Spigot Name & Skin changer plugin
Stars: ✭ 59 (-4.84%)
Mutual labels:  api
Laravel admin api
基于laravel5.5开发的基础后台管理脚手架, RBAC权限控制; 接口基于dingo/api和tymon/jwt, 可在此基础上完成你的laravel项目
Stars: ✭ 59 (-4.84%)
Mutual labels:  api
Djaoapp
User login, billing, access control as part of a session proxy
Stars: ✭ 61 (-1.61%)
Mutual labels:  api
Carmen
A repository of geographic regions for Ruby
Stars: ✭ 1,116 (+1700%)
Mutual labels:  countries
Zile
Extract API keys from file or url using by magic of python and regex.
Stars: ✭ 61 (-1.61%)
Mutual labels:  api
Mail4delphi
Mail4Delphi uses the Indy component to send the email.
Stars: ✭ 60 (-3.23%)
Mutual labels:  api
Gophergameserver
🏆 Feature packed, easy-to-use game server API for Go back-ends and Javascript clients. Tutorials and examples included!
Stars: ✭ 61 (-1.61%)
Mutual labels:  api
Directions Api
Issues for the GraphHopper Directions API
Stars: ✭ 59 (-4.84%)
Mutual labels:  api
Cloudflare Cli
CLI utility managing CloudFlare services using CloudFlare API
Stars: ✭ 61 (-1.61%)
Mutual labels:  api
Sirvy
🔗 Kirby Services API
Stars: ✭ 59 (-4.84%)
Mutual labels:  api
Cookiecutter Django Rest
Build best practiced apis fast with Python3
Stars: ✭ 1,108 (+1687.1%)
Mutual labels:  api
Ionic Example App
A Ionic Example App (previously known as ionic 2 examples). Contains different examples on how to use the Ionic Framework
Stars: ✭ 61 (-1.61%)
Mutual labels:  api
Gulp Apidoc
📄 RESTful web API Documentation Generator
Stars: ✭ 60 (-3.23%)
Mutual labels:  api
Ember Select Box
🔠 A faux select box for Ember apps
Stars: ✭ 60 (-3.23%)
Mutual labels:  dropdown

Country City API

Build Status Code Climate codecov License

Geodata API to get the list of countries and cities in the world. This can be plugged in country and city picker drop-downs in forms. You can find a select2 implementation here. Code for this implementation is in example directory.

⚡️ Installing the CountryCity API

  • Make sure you have PHP 7.4 or newer.
$ php -v
  • Download this API using composer using the command below.
$ composer global require shivammathur/countrycity "master-dev"
  • Then install the API using by executing the command below.
$ composer create-project shivammathur/countrycity countrycity "master-dev" --prefer-dist
  • You are all set, you can use this API.

#️⃣ API Endpoints

All API responses are in json format.

  • Get all countries
/countries

# Without URL Rewriting
/index.php/countries
  • Get all countries containing a search keyword
/countries/{search_keyword}

# Without URL Rewriting
/index.php/countries/{search_keyword}
  • Get all cities in a country
/cities/{country}

# Without URL Rewriting
/index.php/cities/{country}
  • Get all cities in a country containing a search keyword
/cities/{country}/{search_keyword}

# Without URL Rewriting
/index.php/cities/{country}/{search_keyword}

✨ Rest API Features

  • Built using Slim micro framework.
  • Caching enabled with following headers
    • ETag
    • Expires
    • Last-Modified
  • Fast and lightweight API
  • PSR 7 Complaint
  • CORS Middleware

☁️ Hosting configuration

Here are the Configuration Instructions if you want to host this on your server.

🔧 Error Format

If there is an error in the API, you will get an error in json format as response

{"error":"true", "message": "error message here"}

🚨 Testing

$ vendor/bin/phpunit --configuration phpunit.xml.dist

📜 License

The scripts and documentation in this project are released under the MIT License. This project has multiple dependencies and their licenses can be found in their respective repositories.

👍 Contributions

Contributions are welcome! See Contributor's Guide.

💖 Support this project

  • Please star the project and share it with the community.
  • Support the project by sponsoring my work on Support me on Patreon or sponsor using Support me on Paypal.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].