[GH-ISSUE #322] Add JSON file with included countries #198

Closed
opened 2026-03-03 14:35:23 +03:00 by kerem · 5 comments
Owner

Originally created by @matteocng on GitHub (Oct 28, 2016).
Original GitHub issue: https://github.com/lipis/flag-icons/issues/322

Thanks for this library. I think that a JSON file with the codes included in the stylesheets and continent codes would be a nice addition (can PR). Libraries and apps dependent on flag-icon-css could then load and use such file as a reference.

[
  {
    "code": "de",
    "continent": "EU"
  }
  ...
]

... the 'meta countries' contained in _flag-icon-more may be marked as such:

[
  {
    "code": "un",
    "continent": "WORLD",
    "extra": true
  }
  ...
]

... it may include the English country names too:

[
  {
    "code": "de",
    "continent": "EU",
    "name": "Germany"
  }
  ...
]
Originally created by @matteocng on GitHub (Oct 28, 2016). Original GitHub issue: https://github.com/lipis/flag-icons/issues/322 Thanks for this library. I think that a JSON file with the codes included in the stylesheets and [continent codes](http://php.net/manual/en/function.geoip-continent-code-by-name.php#refsect1-function.geoip-continent-code-by-name-returnvalues) would be a nice addition (can PR). Libraries and apps dependent on flag-icon-css could then load and use such file as a reference. ``` json [ { "code": "de", "continent": "EU" } ... ] ``` ... the 'meta countries' contained in _flag-icon-more may be marked as such: ``` json [ { "code": "un", "continent": "WORLD", "extra": true } ... ] ``` ... it may include the English country names too: ``` json [ { "code": "de", "continent": "EU", "name": "Germany" } ... ] ```
kerem 2026-03-03 14:35:23 +03:00
Author
Owner

@lipis commented on GitHub (Oct 28, 2016):

http://flag-icon-css.lip.is/api/v1/country/

<!-- gh-comment-id:256847510 --> @lipis commented on GitHub (Oct 28, 2016): http://flag-icon-css.lip.is/api/v1/country/
Author
Owner

@matteocng commented on GitHub (Oct 28, 2016):

Great, thanks! Any chance that JSON could be included in this repository, so that one could for instance:

var countries = require('flag-icon-css/countries.json');
...
<!-- gh-comment-id:256852004 --> @matteocng commented on GitHub (Oct 28, 2016): Great, thanks! Any chance that JSON could be included in this repository, so that one could for instance: ``` js var countries = require('flag-icon-css/countries.json'); ... ```
Author
Owner

@lipis commented on GitHub (Oct 29, 2016):

Maybe in the future.. :/

<!-- gh-comment-id:257098475 --> @lipis commented on GitHub (Oct 29, 2016): Maybe in the future.. :/
Author
Owner

@tomlutzenberger commented on GitHub (Oct 30, 2016):

@matteocng You could call the API via AJAX and store the data.

<!-- gh-comment-id:257186355 --> @tomlutzenberger commented on GitHub (Oct 30, 2016): @matteocng You could call the API via AJAX and store the data.
Author
Owner

@lipis commented on GitHub (Oct 31, 2016):

I'll close it for now..

<!-- gh-comment-id:257449005 --> @lipis commented on GitHub (Oct 31, 2016): I'll close it for now..
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/flag-icons#198
No description provided.