DEV Community

Discussion on: Not just another Coronavirus (covid-19) dashboard with live statistics

Collapse
 
otomer profile image
Tomer Ovadia

Hi @chan_austria777 , sure! I am basing my decision of what country to auto-select according to the client's public IP address. Note that it's not 100% correct since you might be using a VPN or something that alters your IP address but for my needs it was enough. To detect the IP address I am using the following ipapi.co API, specifically the following /GET ipapi.co/json/ endpoint which results with a simple JSON that you can retrieve the user's country code from.