iP Address Query

iP Address QueryHTTPS(1000 free requests)

Get the location of iP and network operator

Applications used:7

Product services support payments in USD, HKD, and USDT

* The API interface may be blocked due to various network reasons and attacks. Please make redundancy and exception handling during development

* If the status code returned by the HTTP request is not 200, perform an exception. For example, the status code 202 May be caused by invalid Token, insufficient balance, or incorrect format

* All interfaces are compatible with both IPv4 and IPv6

iP query interface documentation

Interface address

HTTP protocol:
http://api.youripapi.com/ipdata/

HTTPS protocol:
https://api.youripapi.com/ipdata/

Request method

get

Example 1 (Running on Linux terminal)

Parameter Description:
1. iP string : iP address - eg. 117.25.13.123 (optional. The default value is the iP address of the requester)
2. datatype string : txt|jsonp|xml (optional. The default format is jsonp)
3. callback string : callback function - The current parameters are only available for jsonp format data (optional. The default value is empty)
4. token string : service will be provided after purchase (required)

curl "https://api.youripapi.com/ipdata/?ip=8.8.8.8&datatype=jsonp&callback=find" -H "token:cc87f3c77747bccbaaee35006da1ebb65e0bad57"

Example 2 (Recommended Solution:javascript import)

Parameter Description:
1. iP string : iP address - eg. 117.25.13.123 (optional. The default value is the iP address of the requester)
2. datatype string : txt|jsonp|xml (optional. The default format is jsonp)
3. callback string : callback function - The current parameters are only available for jsonp format data (optional. The default value is empty)
4. sign string : signature verification - Signature method:md5("ip=" + ip + "&token=" + token) (required)
5. oid string : service will be provided after purchase (required)
6. mid string : service will be provided after purchase (required)

https://api.youripapi.com/ipdata/?ip=8.8.8.8&callback=find&oid={oid}&mid={mid}&sign={sign}

Example 3 (For your token security, do not use token in front-end code, please refer to Example 2 for javascript import)

Parameter Description:
1. iP string : iP address - eg. 117.25.13.123 (optional. The default value is the iP address of the requester)
2. datatype string : txt|jsonp|xml (optional. The default format is jsonp)
3. callback string : callback function - The current parameters are only available for jsonp format data (optional. The default value is empty)
4. token string : service will be provided after purchase (required)

JSONP Request Example (IPv4)

https://api.youripapi.com/ipdata/?ip=58.16.180.3&datatype=jsonp&token=cc87f3c77747bccbaaee35006da1ebb65e0bad57

JSONP Return Example (IPv4)

Note: If the ret value is ok, data is returned. If the data is err, msg error message is returned.

{
"ret": "ok",          // Status
"ip": "58.16.180.3",  // IPv4
"data": [
    "中国",             // Country
    "贵州",             // Region(province/state)
    "安顺",             // City
    "西秀",             // County
    "联通",             // Network operator
    "561000",           // Zipcode
    "0851",             // Area code
    "城域网"            // Network type
]
}

JSONP Request Example (IPv6)

http://api.youripapi.com/ipdata/?ip=240e:398:1:90a0:585e:a0f6:97d3:bd5&datatype=jsonp&token=cc87f3c77747bccbaaee35006da1ebb65e0bad57

JSONP Return example (IPv6)

Note: If the ret value is ok, data is returned. If the data is err, msg error message is returned

{
"ret": "ok",        // Status
"ip": "240e:398:1:90a0:585e:a0f6:97d3:bd5",     // IPv6
"data": [
    "中国",             // Country
    "四川",             // Region(province/state)
    "成都",             // City
    "锦江",             // County
    "电信",             // Network operator
    "610000",           // Zipcode
    "028",              // Area code
    "城域网"            // Network type
]
},,,Zipcode,Area code,Type

XML return example

Note: If the ret value is ok, data is returned. If the data is err, msg error message is returned

<xmlinfo>
<ret>ok</ret>
<ip>58.16.180.3</ip>
<data>
<country>中国</country>
<region>贵州</region>
<city>安顺</city>
<district>西秀</district>
<isp>联通</isp>
<zip>561000</zip>
<zone>0851</zone>
<tag>城域网</tag>
</data>
</xmlinfo>

Return examples in text format

58.16.180.3 中国 贵州 安顺 西秀 联通 561000 0851

Example Query the token usage

URL

https://api.youripapi.com/status/

Request method

get

Parameter

1. token `string` : ip Query token

Example

https://api.youripapi.com/status/?token=cc87f3c77747bccbaaee35006da1ebb65e0bad57

Response

{
"ret":"ok",
"data":{
    "reqs":10,          // current hour requests(used)
    "hour":3000,        // current hour requests(scheme by hour)
    "package":19767     // current hour requests(scheme by requests)
}
}