访问

获取入口节点

GET /access/entry-nodes

不同的入口节点有助于确定从您所在国家出发的更快路线。

在几乎所有情况下,您都应该使用 geo.iproyal.com,它将自动确定适合您所在位置的最佳服务器。

請求範例:

curl -X GET https://resi-api.iproyal.com/v1/access/entry-nodes \
     -H "Authorization: Bearer <your_api_token>"

响应示例:

[
    {
        "dns": "proxy.iproyal.com",
        "ips": ["91.239.130.34"],
        "ports": [
            {
                "name": "http|https",
                "port": 12321,
                "alternative_ports": [
                    11200,
                    ...
                ]
            },
            {
                "name": "socks5",
                "port": 32325,
                "alternative_ports": [
                    51200,
                    ...
                ]
            }
        ]
    },
    {
        "dns": "us.proxy.iproyal.com",
        "ips": ["23.146.144.102", "23.146.144.102"],
        "ports": [
            {
                "name": "http|https",
                "port": 12321,
                "alternative_ports": [
                    11246,
                    ...
                ]
            },
            {
                "name": "socks5",
                "port": 32325,
                "alternative_ports": [
                    51200,
                    ...
                ]
            }
        ]
    },
    ...
]

获取国家

GET /access/countries

返回可用于针对特定代理的国家、城市、州和互联网服务提供商(ISP)的列表。它还返回用于每个代理的前缀。有关如何构建代理字符串的更多信息,请参阅我们的“代理”小节。

代理

根据您作为用户进行的一些设置,它将返回不同的结果。

  • 身份验证——提供更大的选项选择。

  • 跳过静态ISP管理员可激活)——在已验证的身份基础上,包含一个参数,该参数将反映代理的可用性,跳过静态代理。

  • 启用ISP管理员可激活)——包含每个地区的互联网服务提供商。

  • 显示IP可用性管理员可激活)——添加一个参数,以显示该地区代理的可用性。

請求範例:

curl -X GET https://resi-api.iproyal.com/v1/access/countries \
     -H "Authorization: Bearer <your_api_token>"

响应示例:

{
    "prefix": "_country-",
    "countries": [
        {
            "code": "ae",
            "name": "United Arab Emirates",
            "cities": {
                "prefix": "_city-",
                "options": [
                    {
                        "code": "abudhabi",
                        "name": "Abu dhabi",
                        "isps": {
                            "prefix": "_isp-",
                            "options": [
                                {
                                    "code": "emiratesintegratedtelecommunicationscompanypjsc",
                                    "name": "Emirates Integrated Telecommunications Company PJSC",
                                    "ip_availability": "low",
                                    "ip_availability_skip_isp_static": "low"
                                },
                                {
                                    "code": "emiratestelecommunicationsgroupcompanyetisalatgrouppjsc",
                                    "name": "Emirates Telecommunications Group Company (Etisalat Group) PJSC",
                                    "ip_availability": "medium",
                                    "ip_availability_skip_isp_static": "medium"
                                }
                            ]
                        },
                        "ip_availability": "medium",
                        "ip_availability_skip_isp_static": "medium"
                    },
                    {
                        "code": "ajman",
                        "name": "'ajman",
                        "isps": {
                            "prefix": "_isp-",
                            "options": [
                                {
                                    "code": "emiratesintegratedtelecommunicationscompanypjsc",
                                    "name": "Emirates Integrated Telecommunications Company PJSC",
                                    "ip_availability": "low",
                                    "ip_availability_skip_isp_static": "low"
                                },
                                {
                                    "code": "emiratestelecommunicationsgroupcompanyetisalatgrouppjsc",
                                    "name": "Emirates Telecommunications Group Company (Etisalat Group) PJSC",
                                    "ip_availability": "low",
                                    "ip_availability_skip_isp_static": "low"
                                }
                            ]
                        },
                        "ip_availability": "medium",
                        "ip_availability_skip_isp_static": "medium"
                    },
                    ...
                ]
            }
        },
        ...
    ]
}

获取区域

#countries类似,它返回可用的地区,用于选择代理的地区。

GET /access/regions

請求範例:

curl -X GET https://resi-api.iproyal.com/v1/access/regions \
     -H "Authorization: Bearer <your_api_token>"

响应示例:

{
    "prefix": "_region-",
    "regions": [
        {
            "code": "africa",
            "name": "Africa"
        },
        {
            "code": "arabstates",
            "name": "Arab States"
        },
        {
            "code": "asiapacific",
            "name": "Asia & Pacific"
        },
        {
            "code": "europe",
            "name": "Europe"
        },
        {
            "code": "middleeast",
            "name": "Middle east"
        },
        {
            "code": "northamerica",
            "name": "North America"
        },
        {
            "code": "southlatinamerica",
            "name": "South/Latin America"
        }
    ]
}

获取国家集合

GET /access/country-sets

#countries类似,它返回可用国家集合,用于选择代理的地区。

請求範例:

curl -X GET https://resi-api.iproyal.com/v1/access/country-sets \
     -H "Authorization: Bearer <your_api_token>"

响应示例:

{
    "prefix": "_set-",
    "countrySets": [
        {
            "code": "courir",
            "name": "COURIR"
        },
        {
            "code": "mesh1",
            "name": "MESH 1"
        },
        {
            "code": "mesh2",
            "name": "MESH 2"
        },
        {
            "code": "nikeas",
            "name": "NIKE ASIA"
        },
        {
            "code": "nikeeu",
            "name": "NIKE EU"
        },
        {
            "code": "nikena",
            "name": "NIKE US"
        },
        {
            "code": "zalando",
            "name": "ZALANDO"
        }
    ]
}

生成代理列表

POST /access/generate-proxy-list

如果提供了subuser_hash,则不需要用户名和密码,反之亦然——如果提供了用户名和密码,则不需要subuser_hash。

您希望使用的位置需要加上在文档中描述的“前缀”。获取国家

請求範例:

名称类型描述可用选项

format

字符串

将返回代理字符串的格式

{hostname}:{port}:{username}:{password}
{hostname}:{port}@{username}:{password}
{username}:{password}:{hostname}:{port}

hostname

字符串

将要使用的主机名

port

字符串

端口作为协议字符串

http|https
socks5

rotation

字符串

将被使用的轮换类型

sticky
random

subuser_hash

字符串

将要使用的子服务器

location

字符串

将要使用的地区

proxy_count

整型

将返回的代理计数

username

字符串

将要使用的用户名

password

字符串

将要使用的密码

lifetime

字符串

对于粘性会话,这将告知该会话将持续多长时间

5s
10m
20h

正文参数:

curl -X POST https://resi-api.iproyal.com/v1/access/generate-proxy-list \
     -H "Content-Type: application/json" \
     -H "Authorization: Bearer <your_api_token>" \
     -d '{
           "format": "{hostname}:{port}:{username}:{password}",
           "hostname": "example.hostname.com",
           "port": "http|https",
           "rotation": "sticky",
           "location": "_country-sg",
           "proxy_count": 10,
           "subuser_hash": "example_subuser_hash"
         }'