Skip to content

ameerzain/countries

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation

🌍 Countries JSON Dataset

JSON Countries Open Source License Repo Size

A clean, lightweight, and developer-friendly JSON dataset containing a comprehensive list of countries and territories with their standardized country codes.

This repository is designed to be simple, reusable, and framework-agnostic, making it ideal for applications that need country selection, geolocation, internationalization, or global configuration support.


📦 Contents

  • countries.json – A JSON array of country objects with:
    • name – Official or commonly used country/territory name
    • code – ISO 3166-1 alpha-2 country code

Example

{
  "name": "India",
  "code": "IN"
}

✨ Features

  • ✅ 240+ countries & territories
  • ✅ ISO 3166-1 alpha-2 country codes
  • ✅ Clean and consistent JSON structure
  • ✅ Ready for frontend & backend usage
  • ✅ Perfect for dropdowns, filters, and forms
  • ✅ Easy to extend and maintain

🚀 Use Cases

  • 🌍 Country selector dropdowns
  • 📦 Address & shipping forms
  • 🌐 Internationalization (i18n)
  • 📊 Analytics & reporting
  • 📱 Mobile and web applications
  • 🔌 API integrations
  • 🧩 Configuration files

🌐 Public API / Raw JSON Access

🔗 Raw JSON URL

https://raw.githubusercontent.com/ameerzain/countries/main/countries.json

📌 Usage Examples

JavaScript (Fetch API)

fetch('https://raw.githubusercontent.com/ameerzain/countries/main/countries.json')
  .then(response => response.json())
  .then(data => console.log(data));

Python

import requests

url = "https://raw.githubusercontent.com/ameerzain/countries/main/countries.json"
countries = requests.get(url).json()

print(countries)

HTML (Dropdown Example)

<select>
  <option value="IN">India</option>
  <option value="US">United States</option>
  <option value="GB">United Kingdom</option>
</select>

ℹ️ Note:
This dataset is served via GitHub Raw and is suitable for light to medium usage.
For high-traffic production environments, consider caching or self-hosting the file.


📊 Data Format

[
  {
    "name": "India",
    "code": "IN"
  },
  {
    "name": "United States",
    "code": "US"
  }
]

🤝 Contributing

Contributions are welcome!

  • Add missing countries or territories
  • Improve naming consistency
  • Update deprecated country codes
  • Add additional metadata (flags, calling codes, regions)

📄 License

This project is open-source and available under the MIT License.


👤 Author

Ameer Zain
GitHub: https://github.com/ameerzain

If you find this repository useful, consider giving it a ⭐ to support the project.


Happy coding! 🚀

About

A clean, developer-friendly JSON dataset containing countries and territories with standardized ISO country codes for forms, APIs, and internationalized apps.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors