නොමිලේ IP ලිපින API

ඔබේ ස්ක්‍රිප්ට්, යෙදුම් සහ වෙබ් අඩවිවල MonIP භාවිත කරන්න. නොමිලේ, ලියාපදිංචියකින් තොරව සහ API යතුරකින් තොරව.

Endpoints

GET https://monip.com/ip
ඔබේ පොදු IP ලිපිනය සරල පෙළ ලෙස – ස්ක්‍රිප්ට් සඳහා ඉතා සුදුසුයි.
GET https://monip.com/json
රට, නගරය, ඛණ්ඩාංක, සේවා සපයන්නා සහ ASN සමඟ ඔබේ IP ලිපිනය JSON ලෙස.
GET https://monip.com/api/lookup?q=8.8.8.8
ඕනෑම IPv4 හෝ IPv6 ලිපිනයක හෝ වසම් නාමයක විස්තර JSON ලෙස.
GET https://monip.com/api/lookup?q=example.com&lang=si
රටවල සහ නගරවල නම් වෙනත් භාෂාවකින් ලබා ගැනීමට lang=… එක් කරන්න, උදාහරණයක් ලෙස lang=de.

උදාහරණ ප්‍රතිචාරය

$ curl "https://monip.com/api/lookup?q=8.8.8.8"
{
    "ip": "8.8.8.8",
    "version": 4,
    "type": "public",
    "hostname": "dns.google",
    "country_code": "US",
    "country": "එක්සත් ජනපදය",
    "region": "California",
    "city": "Mountain View",
    "latitude": 37.422,
    "longitude": -122.085,
    "asn": "AS15169",
    "isp": "Google LLC",
    "network": null,
    "tor": false
}

උදාහරණ

# Bash
curl monip.com
curl -s monip.com/json | jq -r .country

# PowerShell
(Invoke-RestMethod https://monip.com/json).ip

# Python
import requests
print(requests.get("https://monip.com/api/lookup", params={"q": "8.8.8.8"}).json()["isp"])

// JavaScript
const me = await (await fetch("https://monip.com/json")).json();
console.log(me.ip, me.city, me.country);

සීමා සහ සාධාරණ භාවිතය

එක් IP ලිපිනයකින් මිනිත්තුවකට සෙවීම් 60 ක් දක්වා. ඔබට වැඩි ගණනක් අවශ්‍ය නම්, ප්‍රතිඵල cache කරන්න – IP ස්ථාන කලාතුරකින් වෙනස් වේ.

CORS සක්‍රිය කර ඇත, එබැවින් ඔබට බ්‍රව්සරයේ JavaScript වලින් සෘජුවම API අමතන්න පුළුවන්.

ස්ථාන දත්ත: IP Geolocation by DB-IP (CC BY 4.0). ඔබ පොදු වෙබ් අඩවියක API භාවිත කරන්නේ නම්, කරුණාකර MonIP.com වෙත සබැඳියක් දෙන්න.

ඔබේ වෙබ් අඩවියට සූදානම් කොටුවක් කැමතිද? නොමිලේ IP විජට් එක භාවිත කරන්න. →