Site api

From SkillfulAgents/SuperAgent · View interactive version

Site api is an AI agent skill from the GitHub repository SkillfulAgents/SuperAgent. Find a website's own JSON endpoints by recording its traffic in the browser, then write a script that calls them directly — so a task that repeats (a scheduled report, a widget, a price or availability check) makes one HTTP request per run instead of driving the browser. Use when asked to "find the

How to use this skill

Skill file

Turn a site into a script

Driving the browser is right for the first visit and wrong for the hundredth. Most modern sites build their pages from JSON endpoints of their own; once those are known, a script can call them in a fraction of a second, on a schedule, without Chrome.

1. Record     browser_capture_traffic start → use the site → stop
2. Identify   pick the real endpoints out of the recording
3. Extract    request shape, parameters, response schema, what auth it needs
4. Write      one function per flow, in a script under the artifact or workspace
5. Verify     call every endpoint for real before relying on it

1. Record

2. Identify

The summary is a starting point; the file has everything. Query it with jq:

H=/workspace/captures/<file>.har
# every data response: method, status, URL
jq -r '.log.entries[] | select(.response.content.mimeType | test("json|graphql|xml|csv"))
  | "\(.request.method) \(.response.status) \(.request.url)"' "$H"
# one endpoint in full: request headers, body, response body
jq '.log.entries[] | select(.request.url | test("api/search"))
  | {method: .request.method, url: .request.url, headers: .request.headers,
     body: .request.postData.text, response: .response.content.text}' "$H"

Ignore telemetry and third parties (/collect, /track, /beacon, analytics, error reporting, ads). The real API is usually first-party, JSON, and fires right when you did something on the page.

3. Extract

4. Write

5. Verify

Call every function against the live site and compare the shape with the recording.

| Symptom | Likely cause | What to do |

|---|---|---|

| 401/403 | The endpoint needs the session or a header you dropped | Add back headers one at a time; if it needs the session, keep that step in the browser |

| 403/419 on writes | A per-session or per-form CSRF token | Keep that flow browser-driven |

| Works, then breaks | Signed or expiring parameters (sig, expires, short-lived ids) | Fetch the value from the page or endpoint that issues it first, or keep that step in the browser |

| Different shape than recorded | A/B tests, location, logged-in vs out | Record again; treat the union as optional fields |

| 429 | Rate limit | Slow down; one request per scheduled run is the goal |

Caveats

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.