The file is a little cryptic, but it's the most complete dataset that's openly available.
The best source of international human given (first) names comes from a German computer magazine. The text file has nearly 50k names that are classified by likely gender, and how popular in each country. It's carefully curated and has a friendly license (GNU Free Documentation License).
The file can be downloaded here : ftp://ftp.heise.de/pub/ct/listings/0717-182.zip (name_dict.txt contains the data).
Depending on which programming language you are using, there are libraries either built on this dataset or on others.
>>> import gender_guesser.detector as gender >>> d = gender.Detector() >>> print(d.get_gender(u"Bob")) male >>> print(d.get_gender(u"Sally")) female >>> print(d.get_gender(u"Pauley")) # should be androgynous andy
You can also specify country:
>>> print(d.get_gender(u"Jamie")) mostly_female >>> print(d.get_gender(u"Jamie", u'great_britain')) mostly_male
That codes doesn't give JSON/XML, but it parses the raw
.txt file from above into a python object. Probably you can hack
detector.py to give you all names as JSON.
This is just one port of the raw data. I'm sure there are others.