Instructions for use

This chapter will help you quickly understand and utilize our Thordata public API functionality, and the following steps will walk you through how to proceed with API usage.

Step 1. Get the account sign and apiKey parameters.

  1. Get your sign parameter value from Dashboard >> Settings >> Account Details.

The sign parameter is unique to your Thordata account and cannot be changed.

  1. Get your apiKey parameter value from Dashboard >> Settings >> Account Details.

The apiKey parameter is the parameter you need to validate when executing API requests, and can be modified manually at the dashboard.

Step 2. Code Example

The following is a complete code example of the ISP Proxies Query Expired Time API that can be run directly from the Python 3 terminal environment.

import requests


sign = "Please fill in your sign"
apiKey = "Please fill in your apiKey"

url = "https://api.thordata.com/api/gateway/queryTimeIsp"
headers = {"sign": sign, "apiKey": apiKey, "Content-Type":"application/x-www-form-urlencoded"}

request_body = {
    "ips":"123.123.123.123"
}

response = requests.post(url, headers=headers, data=request_body)
print(response.text)

If you want to know more about how the above code is constructed, you can continue to read the following detailed step-by-step instructions.

Define variables

Sign and apiKey are parameter information that you need to replace.

sign = "Please fill in your sign"
apiKey = "Please fill in your apiKey"

Construct headers

Setting the API URL and request header information.

url = "https://api.thordata.com/api/gateway/queryTimeIsp"
headers = {"sign": sign, "apiKey": apiKey, "Content-Type":"application/x-www-form-urlencoded"}

Construct body

Replacement according to the parameters provided by the API interface (some API interfaces do not have the body parameter, you can directly delete this code when using).

request_body = {
    "ips":"123.123.123.123"
}

Send a request and print the API response content

response = requests.post(url, headers=headers, data=request_body)
print(response.text)

Step 3. Return Result

{
    "code": 200,
    "data": [
        {
            "ip": "123.123.123.123",
            "expire_time": 1735798456
        }
    ],
    "msg": "ok"
}

Last updated