SDK 下载

多语言官方 SDK,快速集成到您的项目

JavaScript / TypeScript SDK

安装

npm install @apibyte/sdk
# 或
yarn add @apibyte/sdk

使用示例

import { ApiByte } from '@apibyte/sdk';

const client = new ApiByte({ apiKey: 'sk-your-key' });

const result = await client.ip.lookup('8.8.8.8');
console.log(result.data);

Python SDK

安装

pip install apibyte

使用示例

from apibyte import ApiByte

client = ApiByte(api_key="sk-your-key")

result = client.ip.lookup("8.8.8.8")
print(result.data)

PHP SDK

安装

composer require apibyte/sdk

使用示例

use ApiByte\Client;

$client = new Client('sk-your-key');
$result = $client->ip->lookup('8.8.8.8');
echo $result->data;

Java SDK

安装 (Maven)

<dependency>
  <groupId>cn.apibyte</groupId>
  <artifactId>sdk</artifactId>
  <version>1.0.0</version>
</dependency>

使用示例

ApiByteClient client = new ApiByteClient("sk-your-key");
IpResult result = client.ip().lookup("8.8.8.8");
System.out.println(result.getData());