-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
网宿本身支持api 或者ak sk方式
单个ip请求太容易就导致请求频繁,建议加上批量,一次查询多个ip
#!/bin/bash
# Please remember to change the param (-H "X-Time-Zone") in this demo to the TimeZone you want in response
username='example_username'
apiKey='example_apiKey'
date=`env LANG="en_US.UTF-8" date -u "+%a, %d %b %Y %H:%M:%S GMT"`
password=`echo -en "$date" | openssl dgst -sha1 -hmac $apiKey -binary | openssl enc -base64`
curl -i --url "https://open.chinanetcenter.com/api/tools/ip-info" \
-X "POST" \
-H "X-Time-Zone:GMT+08:00" \
-u "$username:$password" \
-H "Date: $date" \
-H "Accept: application/json" \
-d '{
"ip": ["1.1.1.1", "2.2.2.2"]
}'非api 查询不会出现查询次数过多问题。且每次可查询20条,api查询未验证每次能查询多少条
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels