Create a new request | Documentation | IP Geolocation Bulk API | WhoisXML API

Create a new request

POST https://ip-geolocation.whoisxmlapi.com/api/bgservice/request

CURL request sample

curl https://ip-geolocation.whoisxmlapi.com/api/bgservice/request -X POST -H "Content-Type: application/json"  -d '{"apiKey": "YOUR_API_KEY", "terms": ["[email protected]", "8.8.8.8", "yahoo.com"], "format": "json"}'

POST request body sample

{
    "apiKey": "YOUR_API_KEY",
    "terms": [
        "[email protected]",
        "8.8.8.8",
        "yahoo.com"
    ],
    "format": "json"
}

Input parameters

apiKey

Required. Get your personal API key on the My products page.

terms

Required. Array.

Contains array of IPs, emails, domain names for getting geolocaton.

format

Optional. String.

Used to specify the response format.

Allowed values: "xml", "json", "csv".

Default value: "json".

Sample output

{
    "response": {
        "id": 5
    }
}

Code: 200 OK.
{
    "response": {
        "errors": [
            "The format field should have one of the following values: json, xml."
        ]
    }
}

Code: 400 Bad Request.
{
    "response": {
        "error": "Authorisation or authentication failed"
    }
}

Code: 401 Unauthorized.
{
    "response": {
        "error": "Insufficient balance"
    }
}

Code: 402 Payment Required.
response

The response object.

Contains the integer 'id' field on success.

In case of an error it contains its description in the 'error' field. If there are multiple errors their descriptions are returned in the 'errors' array.

id

Integer.

Newly created request ID.

error

String.

Error description.

errors

Array.

Multiple error messages.