Run code against apinoa
executeRun TypeScript that calls apinoa APIs to fetch, fan out, filter, rank, count, and aggregate marketplace or social data in code, returning only compact results 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.instagram: profile, post, posts, comments, group, groups
apinoa.linkedin: profile, post, posts, comments, group, job, jobs
apinoa.reddit: profile, profiles, post, posts, comments, group, groups
apinoa.shopify: search, imageSearch, catalog, product, reviews
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.walmart: search, browse, categories, product, reviews
apinoa.x: profile, post, posts, group
apinoa.youtube: profile, profiles, post, posts, comments, groups
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). |