POST

Geo Location

Find geographic coordinates and timezone details for a city, landmark, or address using the Geo Location API. Retrieve latitude, longitude, timezone, country, and administrative region details to simplify location selection and support accurate astrology calculations.

/geo-details
Method
POST
Format
JSON
Auth
API Key
Credits
1

Overview

The Geo Location API identifies locations based on a place name or search phrase provided in English. It returns matching locations with geographic coordinates, timezone information, and administrative details, helping developers convert a user's location input into data required for astrology calculations.

Each result includes the location name, latitude, longitude, timezone identifier, timezone offset, complete location name, country, and available administrative region details. Because a search phrase can match multiple places, the API returns a list of matching locations so users can select the correct city, landmark, or address.

To search for a location, send a POST request to the Geo Location endpoint with a JSON body containing the required location parameter. Provide the place name or phrase in English. The API returns the matching results in JSON format, making it easy to integrate location search into websites, mobile applications, and Vedic or Western astrology software.

Request Parameters

Parameter Type Required Description Example
location
string Yes Location name Vijaya

Request Example

{
    "location":"vija"
}

Response Examples

Example responses returned by this API.

English
[
    {
        "location_name": "Vijāpur",
        "longitude": 72.74848,
        "latitude": 23.5623,
        "timezone_offset": 5.5,
        "timezone": "Asia/Kolkata",
        "complete_name": "Vijapur, Mahesana, Gujarat, India",
        "country": "India",
        "administrative_zone_1": "Gujarat",
        "administrative_zone_2": "Mahesana"
    },
    {
        "location_name": "Vijayapuri",
        "longitude": 77.50066,
        "latitude": 11.2453,
        "timezone_offset": 5.5,
        "timezone": "Asia/Kolkata",
        "complete_name": "Vijayapuri, Erode, Tamil Nadu, India",
        "country": "India",
        "administrative_zone_1": "Tamil Nadu",
        "administrative_zone_2": "Erode"
    },
    {
        "location_name": "Vijayawada",
        "longitude": 80.6466,
        "latitude": 16.50745,
        "timezone_offset": 5.5,
        "timezone": "Asia/Kolkata",
        "complete_name": "Vijayawada, Krishna, Andhra Pradesh, India",
        "country": "India",
        "administrative_zone_1": "Andhra Pradesh",
        "administrative_zone_2": "Krishna"
    }
]

Code Examples

Use the following examples to integrate this API into your application.

PHP Code
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://json.freeastrologyapi.com/geo-details',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS =>'{
    "location":"vijayawa"
}',
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/json',
    'x-api-key: YOUR_API_KEYHERE'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
Python Code
import requests
import json

url = "https://json.freeastrologyapi.com/geo-details"

payload = json.dumps({
  "location": "vijayawa"
})
headers = {
  'Content-Type': 'application/json',
  'x-api-key': 'YOUR_API_KEYHERE'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)
Node JS Code
var request = require('request');
var options = {
  'method': 'POST',
  'url': 'https://json.freeastrologyapi.com/geo-details',
  'headers': {
    'Content-Type': 'application/json',
    'x-api-key': 'YOUR_API_KEYHERE'
  },
  body: JSON.stringify({
    "location": "vijayawa"
  })

};
request(options, function (error, response) {
  if (error) throw new Error(error);
  console.log(response.body);
});