{"id":13500706,"url":"https://github.com/samayo/country-json","last_synced_at":"2025-05-14T08:07:23.663Z","repository":{"id":33003329,"uuid":"36635066","full_name":"samayo/country-json","owner":"samayo","description":"A simple data of the world by country each in JSON format.","archived":false,"fork":false,"pushed_at":"2024-08-31T11:15:54.000Z","size":12766,"stargazers_count":1111,"open_issues_count":4,"forks_count":802,"subscribers_count":21,"default_branch":"master","last_synced_at":"2025-05-13T07:14:54.565Z","etag":null,"topics":["capital-city","city","countries","country","country-data","country-json","currency","independence","json-format","language","population"],"latest_commit_sha":null,"homepage":"https://data.world/samayo","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/samayo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-06-01T03:15:17.000Z","updated_at":"2025-05-05T10:00:33.000Z","dependencies_parsed_at":"2024-05-05T17:43:15.774Z","dependency_job_id":"b41b3637-e75a-4cb9-939a-e6d263076be5","html_url":"https://github.com/samayo/country-json","commit_stats":{"total_commits":279,"total_committers":59,"mean_commits":4.728813559322034,"dds":0.7956989247311828,"last_synced_commit":"1df3f72872cb1ff2d41d41adbd1a171000fd08cf"},"previous_names":[],"tags_count":22,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samayo%2Fcountry-json","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samayo%2Fcountry-json/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samayo%2Fcountry-json/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samayo%2Fcountry-json/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/samayo","download_url":"https://codeload.github.com/samayo/country-json/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254101556,"owners_count":22014908,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["capital-city","city","countries","country","country-data","country-json","currency","independence","json-format","language","population"],"created_at":"2024-07-31T22:01:10.940Z","updated_at":"2025-05-14T08:07:18.648Z","avatar_url":"https://github.com/samayo.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"## country\u003ejson   [![Build Status](https://github.com/samayo/country-json/actions/workflows/validate.yml/badge.svg)](https://travis-ci.org/samayo/country-json)\n\nA simple data of the world (by country) each in JSON format.\n\n### Download\nUsing npm\n```bash\n$ npm install country-json\n```\nor composer\n```bash\n$ composer require samayo/country-json\n```\nor  git\n```bash\n$ git clone https://github.com/samayo/country-json\n```\n### List of contents provided in JSON formats:\n- [Country by Name](https://github.com/samayo/country-json/blob/master/src/country-by-name.json)\n- [Country by Abbreviation](https://github.com/samayo/country-json/blob/master/src/country-by-abbreviation.json)\n- [Country by Alphabet Letters](https://github.com/samayo/country-json/blob/master/src/country-by-alphabet-letters.json)\n- [Country by Avg Male Height](https://github.com/samayo/country-json/blob/master/src/country-by-avg-male-height.json)\n- [Country by Barcode Prefix](https://github.com/samayo/country-json/blob/master/src/country-by-barcode-prefix.json)\n- [Country by Calling Code](https://github.com/samayo/country-json/blob/master/src/country-by-calling-code.json)\n- [Country by Capital City](https://github.com/samayo/country-json/blob/master/src/country-by-capital-city.json)\n- [Country by Cities](https://github.com/samayo/country-json/blob/master/src/country-by-cities.json)\n- [Country by Continent](https://github.com/samayo/country-json/blob/master/src/country-by-continent.json)\n- [Country by Costline](https://github.com/samayo/country-json/blob/master/src/country-by-costline.json)\n- [Country by Currency Name](https://github.com/samayo/country-json/blob/master/src/country-by-currency-name.json)\n- [Country by Religion](https://github.com/samayo/country-json/blob/master/src/country-by-religion.json)\n- [Country by Currency Code](https://github.com/samayo/country-json/blob/master/src/country-by-currency-code.json)\n- [Country by Domain Tld](https://github.com/samayo/country-json/blob/master/src/country-by-domain-tld.json)\n- [Country by Elevation](https://github.com/samayo/country-json/blob/master/src/country-by-elevation.json)\n- [Country by Flag](https://github.com/samayo/country-json/blob/master/src/country-by-flag.json)\n- [Country by Geo Coordinates](https://github.com/samayo/country-json/blob/master/src/country-by-geo-coordinates.json)                           \n- [Country by Government Type](https://github.com/samayo/country-json/blob/master/src/country-by-government-type.json)\n- [Country by Independence Date](https://github.com/samayo/country-json/blob/master/src/country-by-independence-date.json)\n- [Country by Iso Numeric](https://github.com/samayo/country-json/blob/master/src/country-by-iso-numeric.json)\n- [Country by Landlocked](https://github.com/samayo/country-json/blob/master/src/country-by-landlocked.json)\n- [Country by Languages](https://github.com/samayo/country-json/blob/master/src/country-by-languages.json)\n- [Country by Life Expectancy](https://github.com/samayo/country-json/blob/master/src/country-by-life-expectancy.json)\n- [Country by National Symbol](https://github.com/samayo/country-json/blob/master/src/country-by-national-symbol.json)\n- [Country by National Dish](https://github.com/samayo/country-json/blob/master/src/country-by-national-dish.json)\n- [Country by Population Density](https://github.com/samayo/country-json/blob/master/src/country-by-population-density.json)\n- [Country by Population](https://github.com/samayo/country-json/blob/master/src/country-by-population.json)\n- [Country by Region In World](https://github.com/samayo/country-json/blob/master/src/country-by-region-in-world.json)\n- [Country by Surface Area](https://github.com/samayo/country-json/blob/master/src/country-by-surface-area.json)\n- [Country by Yearly Average Temperature](https://github.com/samayo/country-json/blob/master/src/country-by-yearly-average-temperature.json)\n\n### Usage\nExamples using various languages on how display/integrate the data.\n\n##### PHP\n```php\n$file = file_get_contents(\"./src/country-by-capital-city.json\");\n\nforeach (json_decode($file, true) as $key =\u003e $value) {\n  var_dump($value); // { country: 'Afghanistan', city: 'Kabul' ..}\n}\n```\n\n##### Node.js\n```javascript\nvar cities = require('./src/country-by-capital-city.json')\n\nconsole.log(cities[0]); // { country: 'Afghanistan', city: 'Kabul' }\n```\n\n##### Ruby\n```ruby\nrequire 'json'\n\nfile = File.read('./src/country-by-capital-city.json')\njson = JSON.parse(file)\n\nputs json[0] # {\"country\"=\u003e\"Afghanistan\", \"city\"=\u003e\"Kabul\"}\n```\n\n##### Python\n```python\nimport yaml\n\nwith open('./src/country-by-capital-city.json') as json_file:\n    for line in yaml.safe_load(json_file):\n        print line # {'country': 'Afghanistan', 'city': 'Kabul'}\n```\n\n##### Golang\n\n```go\npackage main\n\nimport (\n  \"encoding/json\"\n  \"fmt\"\n  \"io/ioutil\"\n)\n\nfunc main() {\n  data, err := ioutil.ReadFile(\"path/to/country-by-capital-city.json\")\n  if err != nil {\n    panic(err)\n  }\n\n  var entries []struct{ Country, City string }\n  if err = json.Unmarshal(data, \u0026entries); err != nil {\n    panic(err)\n  }\n\n  for _, entry := range entries {\n    fmt.Println(entry.Country, entry.City)  # {'country': 'Afghanistan', 'city': 'Kabul'}\n  }\n}\n\n```\n\n\n\n\n\n### Contribution\nFeel free to send a PR to fix, update or add new entry anytime.\nFor non-minor changes (ex: country: name, language, city, independence date..), please include a source, if possible.\n\n### Resources\n- [Processing country-json data with ramda-cli](https://github.com/raine/ramda-cli/wiki/Cookbook#playing-around-with-countryjson-data)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamayo%2Fcountry-json","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsamayo%2Fcountry-json","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamayo%2Fcountry-json/lists"}