IP API Fast is a lightweight API deployed on Vercel. It retrieves detailed information about IP addresses, such as geographical data, ISP details, and device information, by processing HTTP request headers and performing WHOIS lookups.
The API is live at:
https://ipapifast.vercel.app/
- IP Metadata: Extracts IP, browser, OS, device, and geographical details.
- WHOIS Lookup: Fetches ISP name and description using WHOIS.
- Device Info: Provides user-agent details like browser and OS.
- Geo Data: Uses headers injected by Vercel for continent, country, city, etc.
Provides detailed metadata about the client making the request.
curl https://ipapifast.vercel.app/{
"ip": "103.27.10.68",
"user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64)",
"accept-language": "en-US",
"continent": "Asia",
"country": "IN",
"region": "Delhi",
"city": "New Delhi",
"latitude": "28.6139",
"longitude": "77.2090",
"timezone": "Asia/Kolkata",
"asn": "12345",
"organization": "Example Org",
"security": "low",
"isp": "MyISP",
"ispdescr": "MyISP Description",
"browser": "Chrome",
"os": "Windows 10",
"device": "Desktop",
"zip": "110001"
}The API uses the x-forwarded-for header to get the client IP:
let clientIp = userIP5['x-forwarded-for']
? userIP5['x-forwarded-for'].split(',')[0]
: req.socket.remoteAddress;- Fallback: Uses
req.socket.remoteAddressif thex-forwarded-forheader is unavailable.
The whois-json package fetches ISP details for the client IP:
const whoisData = await whois(clientIp);- Extracts the
netname(ISP) anddescr(ISP description).
The API combines metadata from HTTP headers and WHOIS lookup:
const responseJSON = {
ip: clientIp,
continent: userIP5['x-vercel-ip-continent'] || 'Unknown',
isp: whoisData.netname || 'ISP not found',
browser: userIP5['sec-ch-ua']?.split('"')[5] || 'Unknown',
os: `${userIP5['user-agent'].split('(')[1]?.split(')')[0]}`
};- Provides fallback values like
'Unknown'for missing data.
The API is deployed on Vercel, which automatically injects headers like x-vercel-ip-*. These headers provide geographical and security information about the client.
- Headers Used:
x-vercel-ip-countryx-vercel-ip-regionx-vercel-ip-cityx-vercel-ip-continentx-vercel-ip-timezonex-vercel-ip-asn