Gratis IP-adres-API
Gebruik MonIP in jou skrifte, toeps en webwerwe. Gratis, sonder registrasie en sonder 'n API-sleutel.
Eindpunte
- GET https://monip.com/ip
- Jou openbare IP-adres as gewone teks – ideaal vir skrifte.
- GET https://monip.com/json
- Jou IP-adres met land, stad, koördinate, verskaffer en ASN as JSON.
- GET https://monip.com/api/lookup?q=8.8.8.8
- Besonderhede van enige IPv4- of IPv6-adres of domeinnaam as JSON.
- GET https://monip.com/api/lookup?q=example.com&lang=af
- Voeg lang=… by om land- en stadsname in 'n ander taal te kry, byvoorbeeld lang=de.
Voorbeeldantwoord
$ 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": "Verenigde State van Amerika",
"region": "California",
"city": "Mountain View",
"latitude": 37.422,
"longitude": -122.085,
"asn": "AS15169",
"isp": "Google LLC",
"network": null,
"tor": false
}
Voorbeelde
# 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);
Perke en billike gebruik
Tot 60 opsoeke per minuut van een IP-adres af. As jy meer nodig het, kas die resultate – IP-liggings verander selde.
CORS is aangeskakel, so jy kan die API direk vanuit JavaScript in 'n blaaier roep.
Liggingsdata: IP Geolocation by DB-IP (CC BY 4.0). As jy die API op 'n openbare webwerf gebruik, skakel asseblief na MonIP.com.
Verkies jy 'n gereedgemaakte blokkie vir jou webwerf? Gebruik die gratis IP-widget. →