{
 "schema_version": 1,
 "generated": "2026-10-26",
 "id": "goodnight000-api-anything--teach-operation-from-page-request",
 "repo": "goodnight000/api-anything",
 "repo_url": "https://github.com/goodnight000/api-anything",
 "repo_slug": "goodnight000-api-anything",
 "title": "Teach a new site operation from its page request",
 "page_title": "How to teach a new site operation from its page request with API Anything",
 "summary": "Record a site's page request for two example inputs and save it as a callable operation.",
 "who": "A developer who needs one specific data view from a site that has no public API, such as the latest stories on a domain in Hacker News.",
 "problem": "Writing a request by hand means reading network traffic and rebuilding headers and tokens for every site.",
 "outcome": "A named operation that takes a new input, such as a domain, and returns its fields as JSON.",
 "steps": [
  "`git clone https://github.com/goodnight000/api-anything.git && cd api-anything`",
  "`npm ci && npm install -g \"$(npm pack --silent)\"`",
  "`api-anything add hn-demo links --trigger 'https://news.ycombinator.com/from?site={domain}' --example domain=github.com --example2 domain=github.io --match path=/from --html '{\"items\":\"tr.athing\",\"fields\":{\"title\":\".titleline > a\",\"url\":\".titleline > a@href\"}}'` (inferred, check the README)",
  "`api-anything call hn-demo links domain=arxiv.org`"
 ],
 "agent_prompt": "Using the api-anything repo at github.com/goodnight000/api-anything, add an operation for <site> from the page URL <trigger URL with {placeholder}> using two example inputs, then call it with a new input. Expected output is an ok:true JSON result with data for the new input. Verify that the result uses a value that was not one of the two examples.",
 "agents": [
  "any"
 ],
 "difficulty": "Advanced",
 "time": "45 minutes",
 "basis": "readme",
 "caveat": "Creating an operation needs a Chromium browser, and the README says repair can fail and that CAPTCHA challenges must be cleared by hand.",
 "category": "Software and DevOps",
 "tags": [
  "Software and DevOps"
 ],
 "lang": "typescript",
 "requirements": [
  "Node 22.13 or newer",
  "git, to clone the repository",
  "Google Chrome, or another Chromium browser set with API_ANYTHING_BROWSER, for creating operations",
  "A coding agent such as Claude Code or Codex, if you want the agent to call operations over MCP",
  "The GitHub CLI, only if you plan to publish a spec"
 ],
 "risk": "dual-use",
 "seen_in_the_wild": false,
 "mentioned_publicly": false,
 "risks": [
  {
   "tag": "reverse-engineering",
   "notice": "The tool records a site's own page requests and rebuilds them as callable operations, so check the site's terms before doing this."
  }
 ],
 "best": false,
 "score": 0.9,
 "evidence": [],
 "url": "https://dedupedai.com/use-cases/goodnight000-api-anything/teach-operation-from-page-request/",
 "md": "https://dedupedai.com/use-cases/goodnight000-api-anything/teach-operation-from-page-request/index.md",
 "disclaimer": "Deduped lists open-source repositories that belong to other people. We do not own, maintain, audit, or vouch for any of them, and a repo appearing here is not an endorsement or a safety check. The use cases, steps, and prompts are written by AI and may be incomplete, outdated, or just wrong. Where a use case is marked \"Seen in the wild\", we link to public posts where someone described something similar, but we have not verified those posts and the use case itself is still our AI's own write-up. Use all of this at your own risk. Only run code, commands, or agents on systems and accounts you are authorized to use, and read the code and every command before you run it, especially anything that touches credentials, files, or the network. Nothing here is professional, security, legal, or financial advice. All trademarks and project names belong to their respective owners, and their use here does not imply affiliation. Content is provided as is, without warranties of any kind. Found a mistake, a safety problem, or something you want removed? Email hello@dedupedai.com and we will look at it promptly.",
 "api": "https://dedupedai.com/api/v1/usecases/goodnight000-api-anything--teach-operation-from-page-request.json",
 "api_version": "v1"
}
