@apinoa/sdk

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

Official TypeScript/JavaScript SDK for the apinoa API: marketplace products, social posts, search results and AI answers, plus image translation, through one API.

原始使用文档
文档目录11 节
  1. Usage
  2. Marketplaces
  3. Social platforms
  4. Search engines
  5. AI answers
  6. Image translation
  7. Errors
  8. Retries and timeouts
  9. Examples
  10. Reference
  11. License

@apinoa/sdk

The official TypeScript and JavaScript SDK for apinoa: product data from Amazon, Walmart, Shopify, TikTok Shop and AliExpress; posts, profiles and comments from TikTok, YouTube, Instagram, Threads, X, Reddit and LinkedIn; search results from Google, Bing, Naver and 13 more search engines; AI answers from ChatGPT, Gemini, Google AI Overviews, Google AI Mode and Naver; and image translation, through one API.

npm install @apinoa/sdk

Requires Node.js 20 or later (or any runtime with fetch: Bun, Deno, Cloudflare Workers).

Usage

Create a key under Dashboard > API keys at apinoa.com, then:

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 defaults to the APINOA_API_KEY environment variable. Keep the key on your server: it spends your balance.

Every call is apinoa.<platform>.<operation>(params), spelled the way the URL is: /v1/tiktokshop/product is apinoa.tiktokshop.product(...). Every answer is { success, data, requestId }.

Marketplaces

Every marketplace answers in one commerce schema: a Product from Amazon reads like one from Shopify.

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({});

Social platforms

Every platform answers in one social schema (Account, Post, Comment, Group), with what only one platform has under 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

Search engines

Every search engine answers in one results-page schema: Google, Bing, Naver, Baidu, Yandex, Yahoo and the rest return the same 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: "러닝화 추천" });

AI answers

What ChatGPT, Gemini, Google AI Overviews, Google AI Mode and Naver answer to a prompt, with its citations, sources and the brands it names, in one Answer type.

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

Image translation

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()));

With render: false the body is JSON (the cleaned image and every text region): read it with JSON.parse(await image.text()).

Errors

A failed call throws a subclass of ApinoaError named after its status (BadRequestError, PaymentRequiredError, NotFoundError, TooManyRequestsError, …). err.body.error.code is the stable code to branch on; every code is listed at apinoa.com/docs/errors. A failed call is not billed.

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

Retries and timeouts

429, 408 and 5xx answers are retried twice with exponential backoff, honouring Retry-After. Change it with maxRetries, per client or per call. The default timeout is 300 seconds, because image translation under load can take minutes; set timeoutInSeconds lower for the data calls if you prefer.

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

Examples

examples/ holds four small programs to copy and adapt: a price tracker, a rank tracker, social listening and an AI-answer monitor. Each is one file that runs with npx tsx.

Reference

Every method and parameter: reference.md. The API itself: apinoa.com/docs. The OpenAPI document this SDK is generated from: apinoa.com/openapi.json.

License

MIT

版本与发布记录

@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/2712 天前

关于 @apinoa/sdk 的常见问题

@apinoa/sdk 是什么?

Official TypeScript/JavaScript SDK for the apinoa API: marketplace products, social posts, search results and AI answers, plus image translation, through one 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 和提交记录判断。