创建新请求 |文档 | IP 地理定位批量API | WhoisXML API

创建新请求

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

CURL 请求示例

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 请求正文示例

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

输入参数

apiKey

必填。在“我的产品”页面获取您的个人 API KEY。

条款

必填。Array。

包含用于获取地理定位的 IP、电子邮件、域名数组。

format

选填。String。

用于指定响应格式。

允许值:“xml”、“json”、“csv”。

默认值:“json”。

示例输出

{
    "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

响应对象。

运行成功时包含整数“id”字段。

如果出现错误,它会在“错误”字段中包含其描述。如果有多个错误,它们的描述将返回到“错误”数组中。

ID

整数。

新创建的请求 ID。

error

String

错误描述。

errors

Array

多条错误信息。