api-learner

api-learner is a skill for Claude Code, Codex from davidtoby/agent-skills. It costs 22 tokens per session (862 once invoked), scanned B, original, MIT.

A workflow for discovering how a website communicates with its servers, then documenting those requests for direct command-line use. It replaces repeated browser actions with curl calls, which send web requests from a terminal.

In plain words
What is it for?
Use it to capture browser network traffic, generate API notes, and repeat tasks such as searching or adding items to a cart with fresh cookies.
Why use it?
It helps when heavy, JavaScript-based websites time out in a browser or when the same browser task must be repeated. It does not cover first-time discovery, CAPTCHA flows, payments, or tasks that require seeing the page.

Skill for Claude CodeCodex

Which agent this was written for is unclear — built for openclaw. Also seen: built for openclaw.

Good fit Use it to capture browser network traffic, generate API notes, and repeat tasks such as searching or adding items to a cart with fresh cookies.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/davidtoby/agent-skills/api-learner
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add davidtoby/agent-skills --skill api-learner
Clone the repo
git clone --depth 1 https://github.com/davidtoby/agent-skills

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for api-learner

README.md
[![agentmods](https://agentmods.dev/badge/skills/davidtoby/agent-skills/api-learner/github.svg)](https://agentmods.dev/skills/davidtoby/agent-skills/api-learner)
Your own site
<a href="https://agentmods.dev/skills/davidtoby/agent-skills/api-learner"><img src="https://agentmods.dev/badge/skills/davidtoby/agent-skills/api-learner/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for api-learner

Your own site · 80×15
<a href="https://agentmods.dev/skills/davidtoby/agent-skills/api-learner"><img src="https://agentmods.dev/badge/skills/davidtoby/agent-skills/api-learner.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 22 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 862 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 2 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00022 $0.00862
Opus 5.5 $0.00009 $0.00345
Sonnet 5.5 $0.00004 $0.00172
Haiku 4.5 $0.00002 $0.00086

Measured 1mo ago against content hash 4a6050a35598, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade B, and why

api-learner scanned grade B with 2 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Asks for rootmediumPrivilege escalation

A mod that escalates privileges can change anything on the machine, not only the project.

sudo -u OpenClaw /opt/OpenClaw/scripts/capture-api.js --port 9222 --duration 300

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

description: "Workflow for learning site APIs via traffic capture and replacing browser automation with direct curl calls."
skills/.archive/umbrella-curation-2026-04-29/openclaw-imports/api-learner/SKILL.md · 86 lines

How it starts

The opening of the file, as written. The whole thing — 86 lines — stays where its author put it; the contents beside it link to each section on GitHub.

API Learner — Browser-to-API Migration

Instead of fighting browser timeouts on heavy sites, you can use learned API patterns to make direct curl calls. This is faster, more reliable, and avoids CDP timeout issues.

When to Suggest API Capture

Suggest this to the operator when:

  • A site repeatedly causes browser timeouts (heavy SPAs, JS-heavy storefronts)
  • You're doing the same browser task repeatedly (search → add to cart → repeat)
  • The browser tool fails with "timed out after 20000ms" on a site you use often

Do NOT use API skills for:

  • First visits to a new site (need to discover the workflow first)
  • CAPTCHA or bot-detection flows
  • Checkout / payment flows (the operator handles these manually)
  • Sites where you need to see visual layout (e.g., comparing product images)

How API Learning Works

  1. The operator starts a capture on the relevant VNC browser port
  2. Normal browsing happens — manually or via the browser tool
  3. Capture script records all XHR/Fetch API calls passively
  4. Generator analyzes the traffic and produces a SKILL.md with endpoint docs
  5. You use curl with fresh cookies instead of the browser tool

Using a Generated API Skill

Once an API skill exists (e.g., api-example), follow this pattern:

Step 1: Extract fresh cookies

COOKIES=$(/opt/OpenClaw/scripts/extract-cookies.js --domain <domain> --port <cdp-port>)

The VNC browser must be open and logged into the site. Cookies come from the live browser session.

Step 2: Make API calls

Use curl with the cookie header:

curl -s 'https://www.example.com/api/search?q=spinach' \
  -H "Cookie: $COOKIES" | python3 -m json.tool

Step 3: Handle failures

  • 401/403: Cookies expired. Re-extract and retry.
  • Changed responses: API may have been updated. Tell the operator to re-capture.
  • Unexpected errors: Fall back to the browser tool. Report to the operator.

Starting a New Capture (For the Operator)

To capture traffic from a site:

# Capture from Mise's browser (port 9222) for 5 minutes
sudo -u OpenClaw /opt/OpenClaw/scripts/capture-api.js --port 9222 --duration 300

# Capture from Headhunter's browser (port 9223) for 5 minutes
sudo -u OpenClaw /opt/OpenClaw/scripts/capture-api.js --port 9223 --duration 300

Read the full file on GitHub · 86 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago First seen · 86 lines · 22 tokens per session scan B 4a6050a35598

Subscribe to this mod's changes

api-learner is a skill published in the GitHub repository davidtoby/agent-skills (11 stars, last pushed 2mo ago), licensed MIT. It adds 22 tokens to every session and 862 once invoked, about $0.0001 per session on Opus 5.5. A static security scan graded it B with 2 findings (asks for root, makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

channel-manager

Configure IM platform channels (Feishu, WeCom, Weixin, Discord, Telegram, DingTalk, QQ) for openclacky. Uses browser automation for navigation; guides the user to paste credentials and perform UI steps. Trigger on: "channel setup", "setup feishu", "setup wecom", "setup weixin", "setup wechat", "setup discord", "setup…

clacky-ai/openclacky · 187 tokens

web-skills-protocol

Auto-discover and use Web Skills Protocol (WSP) skills when interacting with websites. Use this skill whenever the user asks you to interact with, use, or perform actions on a website or web service — such as searching a site, placing an order, deploying an app, or calling a web API. Before scraping HTML or guessing…

0xtresser/Web-Skills-Protocol · 141 tokens

dingtalk_channel_connect

Use a headed browser to automatically complete DingTalk channel integration for QwenPaw. Applicable when the user mentions DingTalk, developer console, Client ID, Client Secret, bot, Stream mode, binding or configuring a channel. Supports pausing when a login page is detected and resuming after the user logs in.

agentscope-ai/QwenPaw · 69 tokens

browser_cdp

Browser connection controls for finding local debugging ports, attaching to an already running Chrome browser, or sharing one browser between tools.

agentscope-ai/QwenPaw · 85 tokens

morph-ppt

Use this skill when the user wants a .pptx with smooth cross-slide animation — PowerPoint Morph transitions, Keynote-style continuous motion, shapes that grow / move / rotate as the slide advances. Trigger on: 'morph', 'morph transition', 'smooth transition', 'continuous animation across slides', 'Keynote-style…

iOfficeAI/OfficeCLI · 169 tokens

officecli-academic-paper

Use this skill to build academic-style .docx output: journal / conference / thesis chapters carrying formal citation style (APA, Chicago, IEEE, MLA), numbered equations, figure & table cross-references, footnotes/endnotes, bibliography, or multi-column journal layout. Trigger on: 'research paper', 'journal paper'…

iOfficeAI/OfficeCLI · 141 tokens