How can i send my phone coordinates to esp32

I want to create a mini project for my college and in that I ahve to send my phone's location to esp32 and do something.

I am not able to figure out a method which will have good accuracy. I used IPAPI but it gives location 30km away.