મફત IP એડ્રેસ API
તમારી સ્ક્રિપ્ટ, ઍપ અને વેબસાઇટમાં MonIP નો ઉપયોગ કરો. મફત, નોંધણી વગર અને API કી વગર.
એન્ડપોઇન્ટ
- 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=gu
- દેશ અને શહેરનાં નામ બીજી ભાષામાં મેળવવા 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 સુધી લુકઅપ. વધુ જોઈએ તો પરિણામો કૅશ કરો – IP સ્થાન ભાગ્યે જ બદલાય છે.
CORS ચાલુ છે, તેથી તમે બ્રાઉઝરમાં JavaScript માંથી સીધો API કૉલ કરી શકો છો.
સ્થાન ડેટા: IP Geolocation by DB-IP (CC BY 4.0). જો તમે પબ્લિક વેબસાઇટ પર API વાપરો, તો કૃપા કરીને MonIP.com ની લિંક આપો.
તમારી વેબસાઇટ માટે તૈયાર બૉક્સ જોઈએ છે? મફત IP વિજેટનો ઉપયોગ કરો. →