Run code against apinoa
executeRun TypeScript against the apinoa API to filter, aggregate, and rank results in code, returning only concise data instead of raw API responses.
Instructions
Run TypeScript that calls the apinoa API, and get back only what it prints or returns. Use it for every data task, from one call to thousands: fan out over accounts or posts, follow pages, then filter, count, rank and average in the code, so raw API answers never fill the conversation.
The code is the body of an async function: use await, and return a small result (aggregate, slice, pick the fields you need). In scope:
apinoa..(params): one API call, returns the answer's data; throws ApinoaError (code, status) on a refusal. search_docs lists the parameters and the fields returned.
pages(op, params, { maxPages }): every item of a paged operation, following cursors (default 5 pages).
many(items, fn, { concurrency }): fn over every item, 8 at a time by default; a failed item comes back undefined.
store.save(name, value) / store.load(name) / store.list() / store.saveFile(name, base64): data kept on this machine between runs.
usage: { calls, units, budget } of this run. The code is type-checked before it runs: an operation, parameter or field that does not exist fails there, before anything is billed. Each call costs units (1 unit = $0.001, per search_docs); the run stops once budget_units are spent. Answers are cached for 10 minutes, so re-running after a fix costs nothing for calls already made. Only the API is reachable from the code.
Example: const page = await apinoa.tiktok.posts({ hashtag: "glassskin", limit: 50 }); const authors = [...new Set(page.items.map((p) => p.author.handle))].slice(0, 10); const recent = await many(authors, (u) => apinoa.tiktok.posts({ username: u, limit: 30 })); return authors.map((u, i) => { const views = (recent[i]?.items ?? []).map((p) => p.metrics?.views ?? 0).sort((a, b) => a - b); return { author: u, median: views[Math.floor(views.length / 2)] ?? null }; });
Operations (call search_docs with words or a platform for parameters, costs and the fields returned):
apinoa.aliexpress: search, browse, categories, imageSearch, product, shipping
apinoa.amazon: search, imageSearch, browse, categories, product
apinoa.app-store: search, app, reviews
apinoa.baidu: search, suggestions
apinoa.baidu-wenxin: answer
apinoa.bing: search, suggestions
apinoa.chatgpt: answer
apinoa.company: technologies
apinoa.copilot: answer
apinoa.daum: search, suggestions
apinoa.doubao: answer
apinoa.duckduckgo: search, suggestions
apinoa.facebook: profile, profiles, ads
apinoa.gemini: answer
apinoa.google: search, suggestions, places, place
apinoa.google-ai-mode: answer
apinoa.google-aio: answer
apinoa.google-play: search, app, reviews
apinoa.google-shopping: search, product, reviews
apinoa.google-trends: explore, trending
apinoa.instagram: profile, post, posts, comments, group, groups
apinoa.linkedin: profile, post, posts, comments, group, job, jobs
apinoa.meta-ai: answer
apinoa.naver: search, suggestions, places, place, reviews
apinoa.naver-ai-brief: answer
apinoa.naver-ai-tab: answer
apinoa.qwen: answer
apinoa.reader: page
apinoa.reddit: profile, profiles, post, posts, comments, group, groups
apinoa.seznam: search, suggestions
apinoa.shopify: search, imageSearch, catalog, product, reviews
apinoa.sogou: search, suggestions
apinoa.threads: profile, post, posts, comments
apinoa.tiktok: profile, profiles, post, posts, comments, group, groups, media
apinoa.tiktokshop: search, browse, categories, catalog, product, reviews
apinoa.tripadvisor: places, place, reviews
apinoa.unlocker: request
apinoa.walmart: search, browse, categories, product, reviews
apinoa.x: profile, post, posts, group
apinoa.yahoo: search, suggestions
apinoa.yahoo-japan: search, suggestions
apinoa.yandex: search, suggestions, places, place, reviews
apinoa.youtube: profile, profiles, post, posts, comments, groups
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"code": "<code>"
},
"name": "execute"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | TypeScript: the body of an async function. Return the result. | |
| budget_units | No | Most units this run may spend (default 500, at most 20000). | |
| timeout_seconds | No | Stop the run after this long (default 300). |