@apinoa/sdk

中文文档
0.1.7发布于 2026/11/04MITTypeScriptESM + CJS零依赖构建来源已验证近 30 天下载 1993

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

中文使用文档
文档目录11 节
  1. 使用量
  2. 市场
  3. 社会平台
  4. 搜索引擎
  5. 大赦国际的答复
  6. 图像翻译
  7. 错误
  8. 检索和超时
  9. 实例
  10. 参考文献
  11. 许可证

@apinoa/ sdk (英语)

正式类型脚本和 JavaScript SDK 阿皮诺阿:亚马逊的产品数据, 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.

npm install @apinoa/sdk

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

使用量

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

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读出来的.

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。 。 。 .

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。 。 。 .

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 类型.

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" });

图像翻译

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 (中文(简体) )A级 无法调用 .

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 如果您愿意,请降低数据调用.

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

实例

examples/ 持有四个小程序来复制和适应: 一个价格跟踪器,一个等级跟踪器, 社会倾听和人工智能回答监视器。 每个文件都是用 npx tsx。 。 。 .

参考文献

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

许可证

麻省理工学院

版本与发布记录

@apinoa/sdk 共发布 9 个版本,首次发布于 2026/10/26;过去 12 个月发布了 9 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
0.1.7latest2026/11/043 天前
0.1.62026/11/043 天前
0.1.52026/10/308 天前
0.1.42026/10/308 天前
0.1.32026/10/308 天前
0.1.22026/10/2711 天前

关于 @apinoa/sdk 的常见问题

@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 和提交记录判断。