Squizee Tech Solutions

Squizee Tech Solutions || Geolocation API Documentation

Overview

Squizee Tech Solutions provides two key location-based APIs:

These APIs allow developers to easily integrate location-based functionality into their applications.

Live Test the Geolocation and Reverse Geolocation API

Test the Geolocation and Reverse Geolocation APIs live directly on this page. You can test your IP-based location or convert specific latitude and longitude coordinates to address information.

Geolocation Test (IP-Based)

Click the button below to get your current geolocation based on your IP address without user permission.

Reverse Geolocation Test (Latitude and Longitude)

Enter latitude and longitude below to get the corresponding location.

1. Geolocation API

Endpoint

Description: The Geolocation API returns the geolocation information associated with the user's IP address. This includes the country, region, city, latitude, longitude, and timezone. Additional details such as user-agent, referrer, and client device type are also included to enrich the response.

Sample Request

GET https://ipz.squizee.in/

Sample Response

{
  "ip": "113.21.75.141",
  "requestMethod": "GET",
  "userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36",
  "referrer": "https://www.squizee.in/",
  "preferredLanguage": "en-US",
  "serverSoftware": "LiteSpeed",
  "serverProtocol": "HTTP/1.1",
  "serverName": "ipz.squizee.in",
  "clientDevice": "Windows PC",
  "browser": "Google Chrome",
  "os": "Windows",
  "clientLanguage": "en-US",
  "clientPlugins": "*/*",
  "remotePort": "3134",
  "serverPort": "443",
  "httpStatusCode": 200,
  "provider": "WISH NET - Broadband ISP",
  "country": "India",
  "region": "West Bengal",
  "city": "Kolkata",
  "zipCode": "700001",
  "latitude": 22.518,
  "longitude": 88.3832,
  "timezone": "Asia/Kolkata",
  "offset": "+05:30",
  "currentTimestamp": "2024-12-12 18:12:37",
  "device": "Windows PC"
}
                    

Response Fields:

3. Integration with Excel and Google Sheets

You can easily integrate the Geolocation and Reverse Geolocation APIs into your Excel or Google Sheets for seamless data retrieval.

Excel Integration (Using Power Query)

To use the Geolocation API in Excel, follow these steps:

Excel Integration (Using VBA)

Alternatively, you can use VBA (Visual Basic for Applications) to make an API request in Excel and retrieve the geolocation data:

Google Sheets Integration (Using Google Apps Script)

To use the Geolocation API in Google Sheets, follow these steps:

2. Reverse Geolocation API

Endpoint

Description: Retrieves address details based on the latitude and longitude values.

Sample Request

GET https://location.squizee.in/22.078218038874983,87.2878884615242

Sample Response

{
  "address": "Keshiary, Paschim Medinipur, West Bengal, India",
  "lat": "22.078218038874983",
  "lon": "87.2878884615242"
}
                    

Error Response (Invalid Coordinates)

{
  "error": "Invalid latitude or longitude values.",
  "lat": "not provided",
  "lon": "not provided"
}
                

Integration Examples

JavaScript Example (Using Fetch)

function fetchGeolocation() {
    fetch('https://ipz.squizee.in/')
        .then(response => response.json())
        .then(data => {
            console.log('Geolocation Data:', data);
        })
        .catch(error => {
            console.error('Error fetching geolocation:', error);
        });
}

// Call the function to fetch geolocation data
fetchGeolocation();
                

Python Example (Using Requests)

import requests

def get_geolocation():
    try:
        response = requests.get('https://ipz.squizee.in/')
        response.raise_for_status()  # Will raise an exception for HTTP errors
        data = response.json()
        print('Geolocation Data:', data)
    except requests.exceptions.RequestException as e:
        print(f'Error fetching geolocation: {e}')

# Call the function to fetch geolocation data
get_geolocation()
                

cURL Example

# To fetch geolocation data via cURL:
curl -X GET https://ipz.squizee.in/ -H "Content-Type: application/json"
                

PHP Example (Using cURL)

< ?php
// PHP example using cURL to fetch geolocation data
function getGeolocation() {
    $url = 'https://ipz.squizee.in/';
    $ch = curl_init($url);

    // Set cURL options
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($ch, CURLOPT_HTTPHEADER, array(
        'Content-Type: application/json'
    ));

    // Execute cURL request and get the response
    $response = curl_exec($ch);

    // Check for errors
    if(curl_errno($ch)) {
        echo 'Error: ' . curl_error($ch);
    } else {
        // Convert JSON response to an array
        $data = json_decode($response, true);
        echo 'Geolocation Data: ';
        echo 'IP: ' . $data['ip'] . ' ';
        echo 'Country: ' . $data['country'] . ' ';
        echo 'City: ' . $data['city'] . ' ';
        echo 'Latitude: ' . $data['latitude'] . ' ';
        echo 'Longitude: ' . $data['longitude'] . ' ';
    }

    // Close cURL session
    curl_close($ch);
}

// Call the function to fetch geolocation data
getGeolocation();
?>
            

4. Reverse Geolocation API Integration

In addition to the regular Geolocation API, you can integrate the **Reverse Geolocation API** to convert latitude and longitude into human-readable location data (such as address, city, country, etc.). Below are the steps for integrating the Reverse Geolocation API into Excel and Google Sheets.

Excel Integration (Using Power Query)

To use the **Reverse Geolocation API** in Excel, follow these steps:

Excel Integration (Using VBA)

Alternatively, you can use VBA (Visual Basic for Applications) to call the **Reverse Geolocation API** in Excel and retrieve location data:

Google Sheets Integration (Using Google Apps Script)

To use the **Reverse Geolocation API** in Google Sheets, follow these steps:

Contact Us

If you have any questions, please reach out to us at support@squizee.in.