• ipflare
Main
  • Dashboard
  • API Keys
  • Plans & Billing
Platform
  • Documentation
    • Geolocation
    • Bulk Lookup
    • Next.js Tutorial
    • TypeScript Library
  • Playground
  • Support
Main
Platform

Bulk Lookup of IP Locations

The bulk lookup endpoint allows you to retrieve location information for multiple IP addresses in a single request. This is ideal for applications that need to process large numbers of IPs efficiently.

Heads up!
You need an API key to use this endpoint. Obtain your API key from the API Keys page and set it in the X-API-Key header of your requests.

HTTP Request

https://api.ipflare.io/bulk-lookup

Headers

HeaderDescription
X-API-KeyThe API key required to authenticate requests. You can obtain your API key from the API Keys page.

Body

FieldDescription
ipsA comma-separated list of IP addresses for which you want to retrieve location information.
Maximum of 500 IPs per request.

URL Query Parameters (Optional)

ParameterDescription
fieldsA comma-separated list of fields to include in the response. Available fields: asn, isp.
1const res = await fetch("https://api.ipflare.io/bulk-lookup", {
2 method: "POST",
3 headers: {
4 "X-API-Key": 'YOUR_API_KEY',
5 "Content-Type": "application/json",
6 },
7 // Max 500 IP's per request - supports both IPv4 and IPv6
8 body: JSON.stringify({
9 ips: [
10 "104.174.125.138", // IPv4
11 "2001:fb1:c0:2dfd:8965:bc32:5b49:7ea9", // IPv6
12 "8.8.8.8", // IPv4 public DNS
13 "::1", // IPv6 localhost
14 ],
15 }),
16 });
17
18const geoData = await res.json();

Response Fields

FieldDescription
resultsArray of IP Geolocations or Errors in any order.

Success Response Fields

FieldDescription
ipIP address
status'success'
dataIP Geolocation data

Error Response Fields

FieldDescription
error_messageError message
ipIP address
status'error'
Optional fields
You can append ?fields=asn or ?fields=isp to the URL to retrieve additional fields. To get both the ASN and ISP, you would use https://api.ipflare.io/bulk-lookup?fields=asn,isp.

View example response

Error Codes

FieldDescription
INVALID_IP_ADDRESSThe provided IP address is invalid.
RESERVED_IP_ADDRESSThe provided IP address is reserved and cannot be used.
GEOLOCATION_NOT_FOUNDGeolocation information for the provided IP address could not be found.
QUOTA_EXCEEDEDThe request quota has been exceeded.
INTERNAL_SERVER_ERRORAn internal server error occurred.
NO_API_KEY_PROVIDEDNo API key was provided in the request.
UNAUTHORIZEDThe provided API key is not authorized.

View example error response