Fearon and Alesina et al. analysed these concepts and constructed some indices on these subjects. However, none of the values of the indices are not up to date now. I need more recent data. Thanks for your responses...
The first one (and the most interesting, in my humble opinion) is the Human Relations Area Files (http://hraf.yale.edu/). It is based on an "anthropological" approach (very useful if you look at what you call "cultural or ethnic diversity"). But it is not free...
The second one is Ethnologue (https://www.ethnologue.com/). It is based on a linguistic approach (so, it take into account only "linguistic diversity"). But it is free.
Obviously, none of them is a "perfect" tool, but a crossed research will help you to identify the data you need about cultural and ethnic diversity for country/region/continent.
Could you fine tune your definition of "CULTURAL or ETHNIC DIVERSITY by countries"? Do you mean how much diverse countries are, or do you seek the actual composition of this diversity? Some countries (like France) forbid any collection of such data so I don't know what international data are worth.
Please follow the Hofstede centre, it is operated by itim International, a network based consultancy with the endorsement of Prof Geert Hofstede on the field of the Cultural dimension theory, Hofstede conducted one of the most comprehensive studies of how values in the workplace are influenced by culture.
For more detailed, see the following link and maybe they could be of your interest: