Get API Key

Welcome to the API key generation guide. This section will walk you through the process of generating an API key for our service. Please follow the instructions carefully to ensure a smooth experience.

How to Generate Your API Key:

After successfully registering, follow these steps to generate your API key:

  1. Sign up at OpenAPI Box by completing the registration process.
  2. Once registered, log in and go to the API Services section of your dashboard.
  3. Search for Geo IP API in the available services.
  4. Select the API that corresponds to your service.
  5. Look for the Generate API Key option and click it.
  6. A confirmation modal will appear. Confirm your action to proceed.
  7. Once confirmed, you will see the API key generated for your account.
  8. Click the Show API Key button to reveal your API key.
  9. Click the Copy button next to the key to copy it to your clipboard.

Geo IP API

With our IP Info API, you can access accurate and real-time information about IP addresses, including geographical location, ISP details, and more. This service provides the essential Geo IP information needed to enhance user experience and track user locations globally.

Get IP Info

Retrieve detailed information about an IP address, including its location, organization, and other relevant data. This API helps in identifying and tracking the IP addresses of users visiting your platform or making transactions.

Endpoints

POST /GET https://openapibox.com/api/geoipapi/YOUR-API-KEY/getInfo

Parameters
Field Name Description Required Example Values
ip IP address for which you want to retrieve information Yes 8.8.8.8
Response

The API will return detailed information about the provided IP address, including location, ISP, and more. The data format will be JSON, similar to:

Demo Code Examples
                                 
<?php

/ Replace 'YOUR-API-KEY' With Your actual API Key
$endpoint = 'https://openapibox.com/api/geoipapi/YOUR-API-KEY/getInfo';

$ip = 'YOUR-IP-ADRESS';

$params = [
    'ip' => $ip
];

$curl = curl_init();

curl_setopt_array($curl, [
    CURLOPT_URL => $endpoint,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_POST => true,
    CURLOPT_POSTFIELDS => http_build_query($params),
]);

$response = curl_exec($curl);

if($response === false) {
    echo 'cURL error: ' . curl_error($curl);
} else {
    echo htmlentities($response);
}

curl_close($curl);
?>

<?php

use GuzzleHttp\Client;

// Create a new Guzzle client
$client = new Client();

/ Replace 'YOUR-API-KEY' With Your actual API Key
$endpoint = 'https://openapibox.com/api/geoipapi/YOUR-API-KEY/getInfo';

// Set the IP parameter
$ip = 'YOUR-IP-ADRESS'; 

// Set the parameters to be sent in the POST request
$params = [
    'ip' => $ip
];

// Make the POST request using Guzzle
try {
    $response = $client->post($endpoint, [
        'form_params' => $params  // Send parameters as form data
    ]);
    echo htmlentities($response->getBody());
} catch (\GuzzleHttp\Exception\RequestException $e) {
    echo 'Guzzle error: ' . $e->getMessage();
}

?>

const axios = require('axios');
const querystring = require('querystring');

// Set the IP and API Key
const ip = 'YOUR-IP-ADRESS';

const endpoint = 'https://openapibox.com/api/geoipapi/YOUR-API-KEY/getInfo';  // Replace with your actual endpoint

// Set the data to be sent in the POST request
const data = {
    ip: ip
};

// Make the POST request using axios
axios.post(endpoint, querystring.stringify(data))
    .then(response => {
        console.log(response.data);  // Handle successful response
    })
    .catch(error => {
        console.error('Error:', error);  // Handle error
    });

import requests

# Set the IP and API Key

ip = 'YOUR-IP-ADRESS'  # Replace with your actual IP

endpoint = 'https://openapibox.com/api/geoipapi/YOUR-API-KEY/getInfo'

# Set the data to be sent in the POST request
payload = {
    'ip': ip
}

# Make the POST request using requests
try:
    response = requests.post(endpoint, data=payload)
    print(response.text)  # Handle successful response
except requests.exceptions.RequestException as e:
    print('Error:', e)  # Handle error


package main

import (
	"bytes"
	"fmt"
	"io/ioutil"
	"log"
	"net/http"
	"net/url"
)

func main() {
	// Set the IP and API Key
	ip := "YOUR-IP-ADRESS" // Replace with your actual IP

	endpoint := "https://openapibox.com/api/geoipapi/YOUR-API-KEY/getInfo"

	// Set the data to be sent in the POST request
	data := url.Values{}
	data.Set("ip", ip)

	// Create a POST request
	req, err := http.NewRequest("POST", endpoint, bytes.NewBufferString(data.Encode()))
	if err != nil {
		log.Fatal(err)
	}

	// Set the Content-Type header to application/x-www-form-urlencoded
	req.Header.Set("Content-Type", "application/x-www-form-urlencoded")

	// Send the request using the HTTP client
	client := &http.Client{}
	resp, err := client.Do(req)
	if err != nil {
		log.Fatal(err)
	}
	defer resp.Body.Close()

	// Read and print the response body
	body, err := ioutil.ReadAll(resp.Body)
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println(string(body))
}

Example Responses


{
  "code": 1000,
  "continent": {
    "name": "North America",
    "code": "NA",
    "geoname_id": 6255149
  },
  "country": {
    "name": "United States",
    "iso_code": "US",
    "geoname_id": 6252001,
    "is_in_eu": false
  },
  "registered_country": {
    "name": "United States",
    "iso_code": "US",
    "geoname_id": 6252001,
    "is_in_eu": false
  },
  "represented_country": {
    "name": "Canada",
    "iso_code": "CA",
    "geoname_id": 6251999,
    "type": "Independent"
  },
  "city": {
    "name": "New York",
    "geoname_id": 5128581
  },
  "location": {
    "latitude": 37.751,
    "longitude": -97.822,
    "accuracy_radius": 1000,
    "time_zone": "America/Chicago",
    "metro_code": "501"
  },
  "most_specific_subdivision": {
    "name": "New York",
    "iso_code": "NY",
    "geoname_id": 5128581
  },
  "postal": {
    "code": "10001"
  },
  "traits": {
    "ip_address": "8.8.8.8",
    "network": "8.8.8.0/23",
    "is_anonymous": false,
    "is_anonymous_vpn": false,
    "is_hosting_provider": false,
    "is_legitimate_proxy": false,
    "is_tor_exit_node": false
  }
}



{
  "code": 1111,
  "message": "IP Parameter is Required"
}

{
  "code": 1002,
  "message": "Invalid API Key"
}

{
  "code": 1112,
  "message": "Invalid IP Address"
}

Response Details

Field Name Example Values
code 1000
continent Name: North America
Code: NA
Geoname ID: 6255149
country
Name: United States
ISO Code: US
Geoname ID: 6252001
Is in EU: false
registered_country
Name: United States
ISO Code: US
Geoname ID: 6252001
Is in EU: false
represented_country
Name: Canada
ISO Code: CA
Geoname ID: 6251999
Type: Independent
city
Name: New York
Geoname ID: 5128581
location
Latitude: 37.751
Longitude: -97.822
Accuracy Radius: 1000 meters
Time Zone: America/Chicago
Metro Code: 501
postal
Code: 10001
traits
IP Address: 8.8.8.8
Network: 8.8.8.0/23
Is Anonymous: false
Is Anonymous VPN: false
Is Hosting Provider: false
Is Legitimate Proxy: false
Is TOR Exit Node: false