internetbs API 使用

internetbs 域名注册平台 API 接口稳定

调用 API 接口需要使用 API key 及账号密码。API 接口申请 key 时需要添加 IP 白名单,只允许从添加的白名单 IP 请求 API。

常见操作

获取域名数量

API 默认返回的数据格式为 TEXT ,建议指定数据返回格式为 JSON ,通过 eval(response.content) 将返回的字节类型数据转换为字典类型。

>>> params = {'ApiKey': 'key', 'Password': 'pswd', 'ResponseFormat': 'JSON'}

>>> response = requests.get('https://api.internet.bs/Domain/Count', params=params, )

>>> response.content
b'{"transactid":"3b3df8bfdfcc215ea7e6575a97adcea3","status":"SUCCESS","app":9,"com":6,"de":1,"in":1,"live":1,"tv":2,"vip":1,"world":1,"totaldomains":22}'

>>> eval(response.content)
{'transactid': '3b3df8bfdfcc215ea7e6575a97adcea3', 'status': 'SUCCESS', 'app': 9, 'com': 6, 'de': 1, 'in': 1, 'live': 1, 'tv': 2, 'vip': 1, 'world': 1, 'totaldomains': 22}

获取所有域名

>>> params = {'ApiKey': 'key', 'Password': 'pswd', 'ResponseFormat': 'JSON'}

>>> response = requests.get('https://api.internet.bs/Domain/List', params=params, )