提出请求
基本查询
要开始使用IPIDEA的动态数据中心,您可以通过代理端点向 https://ipinfo.ipidea.pro 发送请求。只需将 USERNAME和PASSWORD替换为您的 IPIDEA 身份验证凭据。每次查询都会自动轮换您的 IP 地址,为每个请求提供一个新 IP 地址。
IPIDEA的动态数据中心支持多种协议,包括 HTTP、HTTPS 和 SOCKS5。
查询示例:
在本例中,使用随机 IP 向 ipinfo.ipidea.pro 提出请求:
curl -x super.ipidea.pro:7777 -U "USERNAME-zone-static:PASSWORD" ipinfo.ipidea.pro// demo.cpp : Define the entry point of a console application
//
#include "stdafx.h"
#include "curl/curl.h"
#pragma comment(lib, "libcurl.lib")
//cURL callback function
static size_t write_buff_data(char *buffer, size_t size, size_t nitems, void *outstream)
{
//Copy the received data to a buffer
memcpy(outstream, buffer, nitems*size);
return nitems*size;
}
/*
Use an HTTP proxy
*/
int GetUrlHTTP(char *url, char *buff)
{
CURL *curl;
CURLcode res;
curl = curl_easy_init();
if (curl)
{
curl_easy_setopt(curl, CURLOPT_PROXY,"http://proxy server:port");//Set the HTTP proxy address
curl_easy_setopt(curl, CURLOPT_PROXYUSERPWD, "USERNAME-zone-static:PASSWORD");//username and password, separated by ":"
curl_easy_setopt(curl, CURLOPT_WRITEDATA, (void*)buff);//Set read/write buffers
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_buff_data);//Set callback function
curl_easy_setopt(curl, CURLOPT_URL, url);//Set URL address
curl_easy_setopt(curl, CURLOPT_LOW_SPEED_TIME, 10L);//Set a long integer to control the number of seconds to transfer the bytes defined by CURLOPT_LOW_SPEED_LIMIT
curl_easy_setopt(curl, CURLOPT_LOW_SPEED_LIMIT, 50L);//Set a long integer to control the number of bytes to transfer
curl_easy_setopt(curl, CURLOPT_MAX_RECV_SPEED_LARGE, 2000000L);//Maximum download speed
res = curl_easy_perform(curl);
curl_easy_cleanup(curl);
if (res == CURLE_OK){
return res;
}else {
printf("Error code:%d\n", res);
MessageBox(NULL, TEXT("Get IP error"), TEXT("Helper"), MB_ICONINFORMATION | MB_YESNO);
}
}
return res;
}
/*
Use a SOCKS5 proxy
*/
int GetUrlSocks5(char *url, char *buff)
{
CURL *curl;
CURLcode res;
curl = curl_easy_init();
if (curl)
{
curl_easy_setopt(curl, CURLOPT_PROXY, "socks5://proxy server:port");//Set the SOCKS5 proxy address
curl_easy_setopt(curl, CURLOPT_PROXYUSERPWD, "username:password");//username and password, separated by ":"
curl_easy_setopt(curl, CURLOPT_WRITEDATA, (void*)buff);//Set read/write buffers
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_buff_data);//Set callback function
curl_easy_setopt(curl, CURLOPT_URL, url);//Set URL address
curl_easy_setopt(curl, CURLOPT_LOW_SPEED_TIME, 10L);//Set a long integer to control the number of seconds to transfer the bytes defined by CURLOPT_LOW_SPEED_LIMIT
curl_easy_setopt(curl, CURLOPT_LOW_SPEED_LIMIT, 50L);//Set a long integer to control the number of bytes to transfer
curl_easy_setopt(curl, CURLOPT_MAX_RECV_SPEED_LARGE, 2000000L);/*Maximum download speed*/
res = curl_easy_perform(curl);
curl_easy_cleanup(curl);
if (res == CURLE_OK) {
return res;
}
else {
printf("Error code:%d\n", res);
MessageBox(NULL, TEXT("Get IP error"), TEXT("Helper"), MB_ICONINFORMATION | MB_YESNO);
}
}
return res;
}
/*
Don't use a proxy
*/
int GetUrl(char *url, char *buff)
{
CURL *curl;
CURLcode res;
//The cURL library used, initialize the cURL library
curl = curl_easy_init();
if (curl)
{
curl_easy_setopt(curl, CURLOPT_WRITEDATA, (void*)buff);//Set read/write buffers
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_buff_data);//Set callback function
curl_easy_setopt(curl, CURLOPT_URL, url);//Set URL address
curl_easy_setopt(curl, CURLOPT_LOW_SPEED_TIME, 10L);//Set a long integer to control the number of seconds to transfer the bytes defined by CURLOPT_LOW_SPEED_LIMIT
curl_easy_setopt(curl, CURLOPT_LOW_SPEED_LIMIT, 50L);//Set a long integer to control the number of bytes to transfer
curl_easy_setopt(curl, CURLOPT_MAX_RECV_SPEED_LARGE, 2000000L);/*Maximum download speed*/
res = curl_easy_perform(curl);
curl_easy_cleanup(curl);
if (res == CURLE_OK)
{
return res;
}
else {
printf("Error code:%d\n", res);
MessageBox(NULL, TEXT("Get IP error"), TEXT("Helper"), MB_ICONINFORMATION | MB_YESNO);
}
}
return res;
}
int main()
{
char *buff=(char*)malloc(1024*1024);
memset(buff, 0, 1024 * 1024);
//Not use an HTTP proxy
GetUrl("http://ipinfo.ipidea.pro", buff);
printf("Not use proxy:%s\n", buff);
//Use an HTTP proxy
memset(buff, 0, 1024 * 1024);
GetUrlHTTP("http://ipinfo.ipidea.pro", buff);
printf("HTTP result:%s\n", buff);
//Use a SOCKS5 proxy
memset(buff, 0,1024 * 1024);
GetUrlSocks5("http://ipinfo.ipidea.pro", buff);
printf("SOCKS5 result:%s\n", buff);
free(buff);
Sleep(10 * 1000);//Wait 10 seconds and exit
Wait 10 seconds and exit
return 0;
}针对区域和城市的特定请求
IPIDEA 允许用户通过在用户名中添加参数来指定来自特定国家或城市的代理。此方法还支持会话控制。以下是一些示例凭据:
示例:
要使用来自美国的代理,并对会话或城市级别定位进行额外控制:
USERNAME-zone-static-region-us-city-CITY-session-123keh4ra-sessTime-5:PASSWORD:super.ipidea.pro:7777参数细分:
让我们分解一下完整的IPIDEA代理用户名的结构:
结构:
USERNAME-zone-static-region-us-city-newyork-session-123keh4ra-sessTime-5:PASSWORD:super.ipidea.pro:7777USERNAME: 您的IPIDEA帐户用户名,用于身份验证。
zone-static: 表示要使用的住宅代理池。
region-us: 2 个字母的国家代码,用于将代理限制到特定区域,例如美国。.
city-newyork: 以特定城市(在本例中为纽约)为目标的代理。
session-123keh4ra: 确保同一个 IP 在多个请求中保持不变(默认有效期为 5 分钟)。
sessTime-5: 将会话持续时间延长至 5 分钟(可选,最长时间为 120 分钟)。
PASSWORD: 您的 IPIDEA 代理帐户密码。
查询参数
username
代理帐户用户名
zone
IP 池名称
region
国家/地区,随机地区无此参数
st
您想要指定的状态。
city
您要指定的城市。可以不带“state”参数使用。
session
粘性 IP 和切换 IP 所需。在固定 IP 或切换时查找特定 IP 时使用它。
sessTime
与会话一起使用来设置 IP 持续时间。
password
代理账户密码
需要帮助?
如果您需要进一步说明或位置定位方面的帮助,请随时通过以下方式与我们联系:
电子邮件:[email protected]
在线聊天:在我们的网站上提供24/7实时聊天。
最后更新于