can i use Google Analytics API in my php or javascript code to find the location of visitor of my website ? this link talks about API, but nothing about location of visitor. https://developers.google.com/analytics/devguides/platform/features/experiments-overview
Here is a complete list which dimension and metrics are supported by the GA API: https://developers.google.com/analytics/devguides/reporting/core/dimsmets#cats=visitor,geo/network. You want to look at Geo/Network (and just in case you are asking if you can have geo inforation in realtime on your website from the API, no, GA does not support that). Note that not all combinations of dimensions and metrics are allowed.