IP API
IP API
6 API
Example
import requests

url = "URL"
response = requests.get(url).json()
print(response)
$url = "URL";
$response = file_get_contents($url);
$data = json_decode($response, true);
print_r($data);
const fetch = require('node-fetch');

const url = "URL";
fetch(url)
  .then(response => response.json())
  .then(data => console.log(data))
  .catch(error => console.log(error));
const url = "URL";
fetch(url)
  .then(response => response.json())
  .then(data => console.log(data))
  .catch(error => console.log(error));
import React, { useEffect } from 'react';

function App() {
  useEffect(() => {
    const url = "URL";
    fetch(url)
      .then(response => response.json())
      .then(data => console.log(data))
      .catch(error => console.log(error));
  }, []);

  return (
    <div>
      {/* Another component here */}
    </div>
  );
}

export default App;
<template>
  <div>
    <!-- Another component here -->
  </div>
</template>

<script>
import axios from 'axios';

export default {
  mounted() {
    const url = "URL";
    axios.get(url)
      .then(response => {
        console.log(response.data);
      })
      .catch(error => {
        console.log(error);
      });
  }
}
</script>
require 'net/http'
require 'json'

url = "URL"
uri = URI(url)
response = Net::HTTP.get(uri)
data = JSON.parse(response)
puts data
package main

import (
	"encoding/json"
	"fmt"
	"io/ioutil"
	"net/http"
)

func main() {
	url := "URL"
	response, err := http.Get(url)
	if err != nil {
		fmt.Println("Error:", err)
		return
	}
	defer response.Body.Close()

	body, err := ioutil.ReadAll(response.Body)
	if err != nil {
		fmt.Println("Error:", err)
		return
	}

	var data interface{}
	err = json.Unmarshal(body, &data)
	if err != nil {
		fmt.Println("Error:", err)
		return
	}

	fmt.Println(data)
}
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;

public class Main {
    public static void main(String[] args) {
        String url = "URL";
        try {
            URL apiUrl = new URL(url);
            HttpURLConnection connection = (HttpURLConnection) apiUrl.openConnection();
            connection.setRequestMethod("GET");

            int responseCode = connection.getResponseCode();
            if (responseCode == HttpURLConnection.HTTP_OK) {
                BufferedReader reader = new BufferedReader(new InputStreamReader(connection.getInputStream()));
                StringBuilder response = new StringBuilder();
                String line;
                while ((line = reader.readLine()) != null) {
                    response.append(line);
                }
                reader.close();

                String jsonResponse = response.toString();
                System.out.println(jsonResponse);
            } else {
                System.out.println("Error: " + responseCode);
            }
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
#include <iostream>
#include <curl/curl.h>
#include <jsoncpp/json/json.h>

size_t WriteCallback(void* contents, size_t size, size_t nmemb, std::string* response) {
    size_t totalSize = size * nmemb;
    response->append(static_cast<char*>(contents), totalSize);
    return totalSize;
}

int main() {
    std::string url = "URL";

    CURL* curl = curl_easy_init();
    if (curl) {
        std::string response;

        curl_easy_setopt(curl, CURLOPT_URL, url.c_str());
        curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, WriteCallback);
        curl_easy_setopt(curl, CURLOPT_WRITEDATA, &response);

        CURLcode res = curl_easy_perform(curl);
        if (res == CURLE_OK) {
            Json::Value data;
            Json::CharReaderBuilder reader;
            std::istringstream jsonStream(response);
            std::string parseErrors;

            if (Json::parseFromStream(reader, jsonStream, &data, &parseErrors)) {
                std::cout << data << std::endl;
            } else {
                std::cout << "Failed to parse JSON: " << parseErrors << std::endl;
            }
        } else {
            std::cout << "Error: " << curl_easy_strerror(res) << std::endl;
        }

        curl_easy_cleanup(curl);
    }

    return 0;
}
IP Geolocation Lookup

Identify the physical location of the IP address used by a user or device in a computer network.

https://forestapi.vercel.app/api/ip/geolocation-lookup/<ip_address>

Output :

{
  "status": True,
  "ip_address": "IP Address",
  "geolocation": [
    //Geolocation Lookup results
  ]
}
Reverse IP Lookup

Identify all websites sharing the same IP address.

https://forestapi.vercel.app/api/ip/reverse-lookup/<ip_address>

Output :

{
  "status": True,
  "ip_address": "IP Address",
  "hostname": "Hostname"
}
TCP Port Scan (Transmission Control Protocol)

Identify open or closed ports on a device or network

https://forestapi.vercel.app/api/ip/tcp-port-scan/<ip_address>

Output :

{
  "status": True,
  "ip_address": "IP Address",
  "open_ports": [
    //List of Open TCP Ports
  ]
}
UDP Port Scan (User Datagram Protocol)

Identify open or closed ports on a device or network using the UDP protocol.

https://forestapi.vercel.app/api/ip/udp-port-scan/<ip_address>

Output :

{
  "status": True,
  "ip_address": "IP Address",
  "open_ports": [
    //List of Open UDP Ports
  ]
}
Subnet Lookup

Identify specific subnet details, such as network address, subnet limit, number of possible hosts, and other related information.

https://forestapi.vercel.app/api/ip/subnet-lookup/<ip_address>

Output :

{
  "status": True,
  "ip_address": "IP Address",
  "subnet": "Subnet"
}
ASN Lookup

Identify the ASN associated with a specific IP address and obtain information associated with that ASN.

https://forestapi.vercel.app/api/ip/asn-lookup/<ip_address>

Output :

{
  "status": True,
  "ip_address": "IP Address",
  "asn": {
    "number": "ASN Number",
    "name": "ASN Name",
    "description": "ASN Description",
    "cidr": [
      //List of ASN CIDR
    ],
    "country_code": "ASN Country Code",
    "registry": "ASN Registry",
    "entities": [
      //List of ASN Entities
    ],
    "date": "ASN Date"
  }
}