# @apinoa/sdk 中文文档

规范地址：https://npmcn.com/package/%40apinoa/sdk/

版本：0\.1\.7
npm 元数据更新时间：2026-11-04T12:47:40.425Z
中文译文更新时间：2026-11-07T08:11:21.497Z
软件包许可：MIT

本文由上游 README 翻译，可能存在偏差，请结合原文核对 API、命令与配置。版权与许可归原作者所有。

原始 npm 页面：https://www.npmjs.com/package/%40apinoa/sdk
原文对照：https://npmcn.com/package/%40apinoa/sdk/?lang=original
项目主页：https://apinoa.com/docs
源码仓库：https://github.com/apinoahq/apinoa-typescript

## 关键信息（来自 npm 元数据）

- 包体积（解压后）：4 MB，3840 个文件
- 模块格式：ESM + CJS
- TypeScript 类型：包内自带
- Node.js 要求：\>=20
- 运行依赖：0 个
- 首次发布：2026-10-25T20:43:17.879Z
- 最新版本发布：2026-11-04T12:47:40.112Z
- 近 30 天下载量：1993（2026-10-06 至 2026-11-04，npm 官方下载统计）
- 已发布版本数：9（近 12 个月 9 个）

## 中文简介

Apinoa API的官方TypeScript/JavaScript SDK:市场产品,社会帖子,搜索结果和AI答案,外加图像翻译,通过一个API.

## 安装

```sh
npm install @apinoa/sdk
```

也可以使用：`pnpm add @apinoa/sdk`、`yarn add @apinoa/sdk`、`bun add @apinoa/sdk`

## README

# @apinoa/ sdk (英语)

正式类型脚本和 JavaScript SDK [阿皮诺阿](https://apinoa.com/):亚马逊的产品数据, Walmart, Shopify, TikTok Shop and AliExpress; 来自TikTok, YouTube, Instagram的文章、简介和评论, 线索、X、Reddit和LinkedIn;搜索结果来自Google、Bing、Naver和另外13个搜索引擎;AI 来自ChatGPT,双子座,Google AI Overviews,Google AI Mode和Naver的答案;和图像翻译,通过 一个API.

```sh
npm install @apinoa/sdk
```

需要20个或以后的节点(或任何运行时间) `fetch`: Bun, Deno, Cloudflare工人).

## 使用量

在下方创建密钥 **盘盘 > API 密钥** 时间 [apinoa.com (英语)](https://apinoa.com/),则:

```ts
import { ApinoaClient } from "@apinoa/sdk";

const apinoa = new ApinoaClient({ apiKey: process.env.APINOA_API_KEY });

const { data } = await apinoa.amazon.search({ query: "wool socks", priceMax: 30 });
for (const item of data.items) console.log(item.title, item.price?.amount);
```

`apiKey` 默认为 `APINOA_API_KEY` 环境变量。 在您的服务器上保留密钥: 它花费 你的平衡。 。 .

每个电话都是 `apinoa.<platform>.<operation>(params)`,拼写了 URL 的方式 : `/v1/tiktokshop/product` 实值 `apinoa.tiktokshop.product(...)`。每个答案是: `{ success, data, requestId }`。 。 。 .

### 市场

每个市场都用一个商业计划来回答:a `Product` 从亚马逊读起来就像从Shoppify读出来的.

```ts
const product = await apinoa.walmart.product({ id: "18256507800" });
const reviews = await apinoa.shopify.reviews({ id: "allbirds.com/products/mens-tree-runners" });
const tree = await apinoa.amazon.categories({});
```

### 社会平台

每个平台都用一个社会计划来回答`Account`, (中文(简体) ), `Post`, (中文(简体) ), `Comment`, (中文(简体) ), `Group`),仅用一个 平台在 `ext`。 。 。 .

```ts
const creator = await apinoa.tiktok.profile({ username: "khaby.lame" });
const page = await apinoa.reddit.posts({ community: "typescript" });
const next = await apinoa.reddit.posts({ cursor: page.data.cursor }); // the next page: the cursor alone
```

### 搜索引擎

每个搜索引擎都用一个结果页的计划来回答:Google, Bing, Naver, Baidu, Yandex, Yahoo and the 休息,返回同样的 `items`。 。 。 .

```ts
const { data } = await apinoa.google.search({ q: "trail running shoes", country: "US" });
for (const item of data.items) if (item.type === "organic") console.log(item.position, item.title, item.url);
const naver = await apinoa.naver.search({ q: "러닝화 추천" });
```

### 大赦国际的答复

什么ChatGPT,双子座,Google AI Overviews,Google AI Mode和Naver对一个快报的回答,及其引用, 来源和它命名的品牌,一个 `Answer` 类型.

```ts
const { data } = await apinoa.chatgpt.answer({ prompt: "Best running shoes for beginners?", country: "US" });
console.log(data.text);
for (const s of data.sources) if (s.cited) console.log(s.url);
const aio = await apinoa.googleAio.answer({ prompt: "best running shoes for beginners" });
```

### 图像翻译

```ts
import { readFile, writeFile } from "node:fs/promises";

const image = await apinoa.imageTranslate.translate(await readFile("product.jpg"), {
  source_language: "zh-CN",
  target_language: "ko",
});
await writeFile("translated.jpg", Buffer.from(await image.arrayBuffer()));
```

与 `render: false` 尸体是JSON(被清理的图像和每个文本区域):用 `JSON.parse(await image.text())`。 。 。 .

## 错误

失败的调用会丢出一个子类 `ApinoaError` 以其地位命名(`BadRequestError`, (中文(简体) ), `PaymentRequiredError`, (中文(简体) ), `NotFoundError`, (中文(简体) ), `TooManyRequestsError`(中文(简体) ). `err.body.error.code` 是马厩 代码到分支; 每个代码在 [apinoa.com/docs/errors (中文(简体) )](https://apinoa.com/docs/errors)A级 无法调用 .

```ts
import { Apinoa, ApinoaError } from "@apinoa/sdk";

try {
  await apinoa.amazon.product({ id: "B000000000" });
} catch (err) {
  if (err instanceof Apinoa.NotFoundError) console.log("no such product");
  else if (err instanceof Apinoa.PaymentRequiredError) console.log("top up your balance");
  else throw err;
}
```

## 检索和超时

`429`, (中文(简体) ), `408` 财务报告和审定财务报表 `5xx` 回答要重复两次, 以指数反射, 尊重 `Retry-After`。 。 。 . 换一个 `maxRetries`,每个客户或每个呼叫。 默认超时为 300 秒, 因为图像 装入时的翻译需要几分钟; 设定 `timeoutInSeconds` 如果您愿意,请降低数据调用.

```ts
const apinoa = new ApinoaClient({ maxRetries: 4, timeoutInSeconds: 60 });
await apinoa.tiktok.posts({ username: "nasa" }, { maxRetries: 0, abortSignal: AbortSignal.timeout(10_000) });
```

## 实例

[`examples/`](https://npmcn.com/package/%40apinoa/sdk/examples) 持有四个小程序来复制和适应: 一个价格跟踪器,一个等级跟踪器, 社会倾听和人工智能回答监视器。 每个文件都是用 `npx tsx`。 。 。 .

## 参考文献

每一种方法和参数: [页:1](https://npmcn.com/package/%40apinoa/sdk/reference.md)API本身: [apinoa.com/docs (中文(简体) )](https://apinoa.com/docs)。此 SDK 文档的 OpenAPI 来源于 : [apinoa.com/openapi.json 页面存档备份,存于互联网档案馆](https://apinoa.com/openapi.json)。 。 。 .

## 许可证

麻省理工学院

## 常见问题

### @apinoa/sdk 是什么？

Apinoa API的官方TypeScript/JavaScript SDK:市场产品,社会帖子,搜索结果和AI答案,外加图像翻译,通过一个API\.

### 如何安装 @apinoa/sdk？

在项目目录运行 npm install @apinoa/sdk，或使用 pnpm add / yarn add / bun add。

### @apinoa/sdk 支持 TypeScript 吗？

支持。包内自带 TypeScript 类型声明（package\.json 声明了 types 入口），安装后即可获得类型提示，无需再安装 @types 包。

### @apinoa/sdk 支持 ESM 还是 CommonJS？

同时提供 ES Module 与 CommonJS 入口，import 和 require\(\) 都可以使用，打包工具会自动选择合适的版本。

### @apinoa/sdk 需要什么版本的 Node\.js？

package\.json 的 engines 字段要求 Node\.js \>=20。版本不符时 npm 默认只给出警告，开启 engine-strict 后会拒绝安装。

### @apinoa/sdk 可以商用吗？

@apinoa/sdk 使用 MIT 许可。宽松许可：允许商业使用、修改和再分发，通常只需在分发时保留原版权与许可声明。以上为概括，不构成法律意见，请以许可原文为准。

### @apinoa/sdk 的下载量有多少？

根据 npm 官方下载统计，@apinoa/sdk 在 2026/10/06 – 2026/11/04 这 30 天内被下载 1,993 次，日均约 66 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入，适合横向比较热度，不能直接等同于使用人数。

### @apinoa/sdk 还在维护吗？

最新版本 0\.1\.7 发布于 2026/11/04（3 天前）；至今共发布 9 个版本，其中过去 12 个月发布了 9 个；首次发布于 2026/10/26。发布频率只是参考信号：功能稳定的工具可能很少需要更新，建议结合源码仓库的 issue 和提交记录判断。

