Network Calculators API

Network Calculators API

Utilities

APIs for IPv4 networks and subnets; base conversions for binary, octal, decimal, and hexadecimal, and DNS record lookup tools.

Visit API

📚 Documentation & Examples

Everything you need to integrate with Network Calculators API

🚀 Quick Start Examples

Network Calculators API Javascript Examplejavascript
// Network Calculators API API Example
const response = await fetch('https://networkcalc.com/api/docs', {
    method: 'GET',
    headers: {
        'Content-Type': 'application/json'
    }
});

const data = await response.json();
console.log(data);

Public API Docs for NetworkCalc.com

NetworkCalc.com provides a public API that can be used to perform calculations related to network addresses such as IP addresses, subnet masks, and CIDR notation. In this blog post, we'll go through the available API endpoints and their usage examples in JavaScript.

API Endpoints

Address Info

This endpoint provides information about a given IP address.

Endpoint: https://api.networkcalc.com/address/info

Example request:

const address = '8.8.8.8';
const url = `https://api.networkcalc.com/address/info?address=${address}`;
fetch(url)
  .then(response => response.json())
  .then(data => console.log(data));

Subnet Info

This endpoint provides information about a given subnet mask.

Endpoint: https://api.networkcalc.com/subnet/info

Example request:

const subnetMask = '255.255.255.0';
const url = `https://api.networkcalc.com/subnet/info?subnetMask=${subnetMask}`;
fetch(url)
  .then(response => response.json())
  .then(data => console.log(data));

CIDR Info

This endpoint provides information about a given CIDR notation.

Endpoint: https://api.networkcalc.com/cidr/info

Example request:

const cidr = '192.168.0.0/24';
const url = `https://api.networkcalc.com/cidr/info?cidr=${cidr}`;
fetch(url)
  .then(response => response.json())
  .then(data => console.log(data));

Subnetting

This endpoint performs subnetting on a given network.

Endpoint: https://api.networkcalc.com/subnetting

Example request:

const networkAddress = '192.168.0.0';
const prefixLength = '24';
const url = `https://api.networkcalc.com/subnetting?networkAddress=${networkAddress}&prefixLength=${prefixLength}`;
fetch(url)
  .then(response => response.json())
  .then(data => console.log(data));

Conclusion

NetworkCalc.com provides a simple and easy-to-use API for performing network calculations. By using the API endpoints and example codes we presented here, you can quickly get started with your own network calculations. Try these examples out and explore what else the NetworkCalc.com API has to offer!

📊 30-Day Uptime History

Daily uptime tracking showing online vs offline minutes

Jun 15Jun 17Jun 19Jun 21Jun 23Jun 25Jun 27Jun 29Jul 1Jul 3Jul 5Jul 7Jul 9Jul 11Jul 1404008001440Minutes
Online
Offline

Related APIs in Utilities