IPQS

Submitting Data To IPQS APIs

About Submitting Data for Analysis

Most IPQS APIs support multiple ways to submit data and authenticate your request. You can GET using URL encoded parameters or POST requests using JSON or multi-part form bodies.

Standard API Endpoint Request Format

Real-time (or synchronous) API calls that return data immediately support JSON and, for supported endpoints, XML responses. The response format is specified in the URL call string. The examples in this documentation use JSON unless otherwise noted.

https://www.ipqualityscore.com/api/json/{API_NAME}/{API_KEY}/{LOOKUP_VALUE}

For instructions on requesting and processing XML responses, see Using IPQS APIs in XML Format.

Defining API Endpoints

The next argument in the path defines the target API endpoint, such as the Proxy & VPN Detection API or the Email Verification API.

Common API Endpoints

Examples

To call the Proxy & VPN Detection API, replace {API_NAME} with ip, as listed above:

https://www.ipqualityscore.com/api/json/ip/{API_KEY}/{LOOKUP_VALUE}

Similarly you would use email or phone for the Email Verification API and Phone Number Validation API, respectively:

https://www.ipqualityscore.com/api/json/email/{API_KEY}/{LOOKUP_VALUE}

https://www.ipqualityscore.com/api/json/phone/{API_KEY}/{LOOKUP_VALUE}

Authorization - Passing Your API Key

You will need to submit an API Key with your requests to authenticate with the API. You can create, edit, temporarily disable, and delete API Keys directly in the IPQS Dashboard.

You can pass API Keys in the path of the URL call string for GET and POST requests. In the example below, replace {API_KEY} with the API Key you created:

https://www.ipqualityscore.com/api/json/ip/{API_KEY}/{LOOKUP_VALUE}

You can also pass your API Key in the body of POST requests or the headers of GET and POST requests.

GET Requests

Pass the API Key in the path of the URL call string:

https://www.ipqualityscore.com/api/json/ip/{API_KEY}/{LOOKUP_VALUE}

You can also pass the API Key in the request headers, which is described in more detail below.

POST Requests

Pass the API Key in the body of the POST request as the value of key.

Multi-part Form Body Example

curl --request POST \
  --url https://www.ipqualityscore.com/api/json/ip/ \
  --header 'content-type: multipart/form-data' \
  --form ip=192.0.2.0 \
  --form key={API_KEY}

JSON Body Example

curl --request POST \
--url https://www.ipqualityscore.com/api/json/ip/ \
--header 'content-type: application/json' \
--data '{
"key": "{API_KEY}",
"ip": "192.0.2.0"
}'

Headers

You can also pass the API Key in the request headers using either a multi-part form or JSON payload.

GET Request Example

curl --request GET \
  --url 'https://www.ipqualityscore.com/api/json/ip?ip=192.0.2.0' \
  --header 'ipqs-key: {API_KEY}'

POST Request Example

curl --request POST \
  --url https://www.ipqualityscore.com/api/json/ip/ \
  --header 'content-type: application/json' \
  --header 'ipqs-key: {API_KEY}' \
  --data '{
  "ip": "192.0.2.0"
}'

Passing Parameters

GET Requests

Passing parameters to the API as a GET request requires attaching parameters to the URL call string.

Note

Call strings must be fully URL encoded when submitted as parameters. This is especially important when passing data such as physical addresses and email addresses as additional parameters.

IP Address Example

https://www.ipqualityscore.com/api/json/ip/{API_KEY}/192.0.2.0

Email Address Example

Note how the email address does not need to be URL encoded because the email address is submitted in the path of the call string.

https://www.ipqualityscore.com/api/json/email/{API_KEY}/email@example.com

IP Address Example with Additional Parameters

Some APIs allow you to submit optional additional parameters to customize your API request. This example shows a request to the Proxy & VPN Detection API that includes the optional additional parameters of billing_address and billing_email, which are used in address validation.

Note how the " " spaces in the billing address are URL encoded to %20 and the "@" symbol in the email address is URL encoded to %40 . This is because they must be URL encoded when passed as parameters.

https://www.ipqualityscore.com/api/json/ip/{API_KEY}/192.0.2.0?billing_address=123%20west%20main%20st.&billing_email=email%40example.com

Header Example

curl --request GET \
  --url 'https://www.ipqualityscore.com/api/json/ip?ip=192.0.2.0' \
  --header 'ipqs-key: {API_KEY}'

POST Requests

Multi-part Form Body Example

curl --request POST \
  --url https://www.ipqualityscore.com/api/json/ip/ \
  --header 'content-type: multipart/form-data' \
  --form ip=192.0.2.0 \
  --form key={API_KEY} \
  --form 'billing_address=123 main st' \
  --form billing_city=anytown

JSON Body Example

curl --request POST \
  --url https://www.ipqualityscore.com/api/json/allowlist/create/ \
  --header 'content-type: text/plain' \
  --data '{
  "type": "proxy",
  "value_type": "ip",
  "value": "192.0.2.0",
  "reason": "example",
  "key":"{API_KEY}"
}'

Using IPQS APIs in XML Format

IPQS API documentation uses JSON for its request and response examples. If your integration requires XML responses, replace /api/json/ with /api/xml/ in the request URL for APIs that support XML. The rest of the endpoint path, authentication method, and request parameters remain the same.

Note

XML is a response format, not a request body format. Continue to submit GET parameters or POST data using the formats supported by the API endpoint (such as JSON or multipart form data). The Content-Type header describes the request body, not the desired response format. The response format is selected in the URL, not by the Accept header.

XML API Endpoints

The following table lists endpoints that support XML responses. All paths are relative to https://www.ipqualityscore.com. Replace {API_KEY} and any other placeholders with the appropriate values. Refer to the documentation for each API for its required parameters, supported HTTP methods, and response field definitions.

API XML Endpoint
Proxy & VPN Detection API /api/xml/ip/{API_KEY}/{IP_ADDRESS}
Email Verification API /api/xml/email/{API_KEY}/{EMAIL_ADDRESS}
Phone Number Validation API /api/xml/phone/{API_KEY}/{PHONE_NUMBER}
Malicious URL Scanner API /api/xml/url/{API_KEY}/{URL}
Dark Web Leak API /api/xml/leaked/{TYPE}/{API_KEY}/{DATA}
Malware File Scanner API /api/xml/malware/{TYPE}/{API_KEY}
Transaction Scoring API /api/xml/transaction/{API_KEY}/
Request List API /api/xml/requests/{API_KEY}/list
Fraud Reporting API /api/xml/report/{API_KEY}
Postback API /api/xml/postback/{API_KEY}
Credit Usage API /api/xml/account/{API_KEY}
Login History API /api/xml/loginhistory/{API_KEY}
Bulk Validation CSV API - Upload /api/xml/csv/{API_KEY}/{TYPE}/upload
Bulk Validation CSV API - List /api/xml/csv/{API_KEY}/list
Bulk Validation CSV API - Status /api/xml/csv/{API_KEY}/status/{CSV_ID}
Allowlist API /api/xml/allowlist/{ACTION}/{API_KEY}
Blocklist API /api/xml/blocklist/{ACTION}/{API_KEY}

GET Requests

API Key in the URL

This example requests an XML response from the Proxy & VPN Detection API with the optional strictness parameter:

curl --request GET \
  --url 'https://www.ipqualityscore.com/api/xml/ip/{API_KEY}/192.0.2.0?strictness=1'

API Key in the Request Parameters

For endpoints that support passing the API key as a GET parameter, use key and pass the lookup value as a named parameter:

curl --request GET \
  --url 'https://www.ipqualityscore.com/api/xml/ip?key={API_KEY}&ip=192.0.2.0'

API Key in the Request Headers

For endpoints that support header authentication, pass the API key using the ipqs-key header:

curl --request GET \
  --url 'https://www.ipqualityscore.com/api/xml/ip?ip=192.0.2.0' \
  --header 'ipqs-key: {API_KEY}'

URL encode lookup values and additional parameters as required by the endpoint. For example, the following request submits a URL to the Malicious URL Scanner API:

curl --request GET \
  --url 'https://www.ipqualityscore.com/api/xml/url/{API_KEY}/https%3A%2F%2Fexample.com'

POST Requests

For APIs that support POST requests, continue to use the supported request body format while specifying xml in the URL.

JSON Body Example

curl --request POST \
  --url 'https://www.ipqualityscore.com/api/xml/ip/' \
  --header 'content-type: application/json' \
  --header 'ipqs-key: {API_KEY}' \
  --data '{
    "ip": "192.0.2.0",
    "strictness": 1
  }'

Multi-part Form Body Example

curl --request POST \
  --url 'https://www.ipqualityscore.com/api/xml/ip/' \
  --form 'key={API_KEY}' \
  --form 'ip=192.0.2.0' \
  --form 'strictness=1'

Example XML Responses

Use an XML parser instead of a JSON parser when processing XML responses. Response fields are represented by XML elements. Refer to the response parameters documented for the API to determine the meaning and expected data type of each field.

Success Response

The following abbreviated Proxy & VPN Detection API response illustrates the result root element and individual response fields:

<?xml version="1.0" encoding="UTF-8"?>
<result>
  <proxy>false</proxy>
  <fraud_score>25</fraud_score>
  <country_code>US</country_code>
  <request_id>0w8WYS</request_id>
  <message>Success</message>
  <success>true</success>
</result>

Ready to eliminate fraud?

Start fighting fraud now with 1,000 Free Lookups!

We're happy to answer any questions or concerns.

Chat with our fraud detection experts any day of the week.

Call us at: (800) 713-2618