Reliable and affordable IP Geolocation API

Get country, state, city, latitude, longitude, region, timezone, postal, iso & zip code


No credit card required


    {
      
      "ip": "3.237.66.86",
      "city": "Ashburn",
      "region": "Virginia",
      "postal": "20149",
      "country": "United States",
      "iso_code": "US",
      "timezone": "America/New_York",
      "longitude": "-77.4728",
      "latitude": "39.0481",
      "asn_organization": "AMAZON-AES",
      "asn_number": "14618",
      "asn_type": "unknown"
      
    }
          

Hey! whats the weather in Ashburn?

Returns Geolocation data for a given IPv4 Address or Domain. You can supply an IP address to lookup. The Response include all important data to pinpoint your users location. Includes Company network name and System Number.



How Customers use our IP Geolcoation API


  • Location based offers
  • Localize IPs
  • Personalized Content
  • Autofill Form Elements
  • Display Location Data
  • Center maps with our data

Access all data with just one line of code using our API.

Or use our language bindings.


    curl https://api.monapi.io/v1/ip/3.237.66.86
          

  import requests

  url = 'https://api.monapi.io/v1/ip/3.237.66.86'

  headers = {
      'accept': "application/json",
      'authorization': "your_api_key"
      }

  response = requests.request("GET", url, headers=headers)

  print(response.text)
  print(response.status_code)
        

  curl --url 'https://api.monapi.io/v1/ip/3.237.66.86' \
       --header 'Authorization: Token your_api_key' \
       --header 'Accept: application/json'
        
        
  <?php
  
  // IP to check
  $ip = '3.237.66.86';

  $authToken = 'your_api_key';

  // Init cURL
  $curl = curl_init();

  // Set URL & some options
  curl_setopt_array($curl, array(
      CURLOPT_RETURNTRANSFER => 1,
      CURLOPT_URL => 'https://api.monapi.io/v1/ip/' . $ip
  ));

  // Set the authorization header
  if ($authToken) {
      curl_setopt($curl, CURLOPT_HTTPHEADER, array(
          'Authorization: Token ' . $authToken
      ));
  }

  // Send the request
  $response = curl_exec($curl);

  // Check for cURL & HTTP errors or return response content
  if (curl_errno($curl)) {
    echo 'Error: "' . curl_error($curl) . '" - Code: ' . curl_errno($curl) . "\n";
  } else {
    switch ($httpCode = curl_getinfo($curl, CURLINFO_HTTP_CODE)) {
      case 200:  # OK
        echo 'OK' . "\n";
        $responseObject = json_decode($response);
        var_dump($responseObject);
        break;
      case 404:
        echo 'Resource not found' . "\n";
        $responseObject = json_decode($response);
        var_dump($responseObject);
        break;
      default:
        echo 'Unexpected HTTP-Code: ' . $httpCode . "\n";
    }
  }
  // Close request to clear up some resources
  curl_close($curl);
  
  
        
var https = require('https');

// The ip to check
var IP = '3.237.66.86'

// Authorization token
var authToken = 'Token your_api_key';

var options = {
  host: 'api.monapi.io',
  port: 443,
  path: '/api/v1/ip/' + ip,
  headers: {
  }
};

if (authToken) {
   options.headers['Authorization'] = 'Token ' + authToken;
}

var request = https.get(options, function(res) {
   var body = "";
   res.on('data', function(data) {
      body += data;
   });
   res.on('end', function() {
     // Check response by status
     switch (res.statusCode) {
       case 200:
         console.log('HTTP Status OK, 200');
         console.log('Response DATA', body);
         break;
       case 404:
         console.log('Resource not found, 404');
         console.log('Response DATA', body);
         break;
       default:
         console.log('Unknown HTTP Status Code', res.statusCode);
         break;
     }
   })
   res.on('error', function(e) {
      console.log("Got HTTP Response error: " + e.message);
   });
});

request.on('error', (e) => {
  console.error('Request error:', e);
});

request.end();

Get your free API Key

You can check out the code examples without API Key, but you are limited to just a few API Requests.
You can learn more about the API in the Documentation or sign up to get your free API Key!

Our free Account gives you up to 500 API requests a day!

IP Address, Email & Domain Intelligence