derive-client
Was er macht
Dieser Skill zeichnet auf, was eine Website sendet und empfängt, während du sie benutzt. Danach schreibt er ein kleines Skript oder Werkzeug, das dieselben Anfragen direkt stellt. Er richtet sich an Personen, die oft dieselbe Aufgabe auf einer Website wiederholen.
Wann du ihn nutzt
- ✓Wenn du die Daten einer Website nutzen willst, ohne jedes Mal einen Browser zu öffnen.
- ✓Wenn du ein CLI für eine Website bauen sollst, die keine offizielle API hat.
- ✓Wenn du sehen willst, welche internen Endpunkte eine Website nutzt.
Link zum Skill
https://github.com/vercel-labs/agent-browser/blob/main/skill-data/derive-client/SKILL.mdKopiere ihn und füge ihn in deine KI ein (Claude, ChatGPT oder Cursor) mit der Bitte, den Anweisungen zu folgen.
So nutzt du ihn
Am einfachsten: Kopiere die Nachricht und füge sie in deine KI ein. Sie liest den Skill und folgt den Anweisungen.
Fertige Nachricht zum Einfügen
Für Claude Code, Codex oder Cursor: Führe den Befehl in deinem Projektordner aus, dann wird der Skill installiert.
Lade die SKILL.md herunter und lege sie in den Skills-Ordner deines Agenten.
Beispielanfrage an deine KI
“Schau mir einmal zu, wie ich auf dieser Seite nach Flügen suche. Danach baue ein Skript, das dieselbe Suche für mich erledigt.”
5 neue Skills pro Woche. 1 Minute Lesezeit.
So funktioniert es
Der Browser speichert während der Nutzung eine HAR-Datei mit den Netzwerkanfragen. Die KI untersucht diese Anfragen und schreibt einen Client, der die Endpunkte direkt aufruft.
Technischer Inhalt (originale SKILL.md)
Originaltext des Autors, auf Englisch, direkt von GitHub.
Derive an API client from a recorded session
Driving a browser is the right tool for the first visit and the wrong tool for the hundredth. This skill records a site's network traffic once while you use it, then turns the captured requests into a standalone client (script, CLI, or library) that talks to the site's internal API directly.
The recording alone contains everything needed: agent-browser embeds text response bodies (JSON/HTML/JS) in the HAR by default, so endpoint shapes can be studied offline after the browser is closed.
Workflow
1. Record Start HAR capture, drive the flows you want in the client
2. Identify Find the real API endpoints among the noise
3. Extract Pull request shapes, response schemas, and auth material
4. Generate Write the client, one function per flow
5. Verify Call every endpoint for real before declaring done
1. Record
agent-browser network har start # embeds text response bodies by default
# ... drive the site: search, open a detail page, paginate, etc. ...
agent-browser network har stop /tmp/site.har
- Exercise every flow the client should support, and run each one at least twice with different inputs (two search terms, two detail pages). Diffing the recorded URLs reveals which parts are parameters.
- If the site needs login, log in before starting the HAR so credentials don't land in the recording unnecessarily. The session cookies are exported separately in step 3.
--content allembeds binary bodies too (base64);--content nonedisables embedding. Per-body cap is 2 MB.
While the session is still open, agent-browser network requests and network request <id> give the same data interactively — but only the HAR survives navigation and browser close, so prefer it for anything multi-page.
2. Identify endpoints
Query the HAR with jq:
# All JSON API calls: method, URL, status
jq -r '.log.entries[]
| select(.response.content.mimeType | test("json"))
| "\(.request.method) \(.response.status) \(.request.url)"' /tmp/site.har
Ignore analytics and infrastructure noise: telemetry endpoints (/collect, /track, /beacon, /log), third-party domains (google-analytics, segment, sentry, datadog, intercom, hotjar), and static assets. The real API is usually first-party, JSON, and correlates with the actions you performed.
3. Extract shapes and auth
# Full detail for one endpoint: request headers, POST body, response body
jq '.log.entries[] | select(.request.url | test("api/search"))
| {request: {method: .request.method, headers: .request.headers,
postData: .request.postData.text},
response: .response.content.text}' /tmp/site.har
- Response schema: read
.response.content.text— this is the real payload, use it to derive types. - Auth: compare request headers across endpoints. Look for
authorization,cookie,x-csrf-token,x-api-key, and site-specificx-*headers. Replay only the ones that matter — test by omission in step 5. - Cookies: export the live session with
agent-browser cookies get --json > cookies.jsonfor the client to load at runtime. Never hardcode cookie values into generated source.
4. Generate the client
- One function per recorded flow (
search(query),getItem(id)), typed from the observed response bodies. - Auth material (cookies, bearer tokens) loads from a file or environment variable, with a clear error telling the user to re-run the browser login when it expires.
- Reproduce the headers the API actually requires — some sites 403 without a matching
user-agent,referer, orx-requested-with. - Keep pagination, sort, and filter parameters that appeared in the recorded query strings as function options.
5. Verify
Call every generated function against the live API and compare the response shape with the recording. Common failures:
| Symptom | Cause | Fix |
|---|---|---|
| 401/403 | Expired or missing session | Re-login via agent-browser, re-export cookies |
| 403/419 on writes | CSRF token is per-session or per-form | Fetch the token endpoint first, or keep that flow browser-driven |
| Works then breaks | Signed/expiring request params | Fall back to the browser for that step; derive the rest |
| Different shape than HAR | A/B tests or geo-dependent responses | Re-record and treat the union as optional fields |
Caveats
- Internal APIs are unversioned and change without notice — keep the HAR so
Häufige Fragen
Soll ich mich vor der Aufzeichnung anmelden?
Ja. Der Skill empfiehlt, sich vor dem Start der Aufzeichnung anzumelden, damit keine Zugangsdaten in der Datei landen.
Wird der erzeugte Client getestet?
Ja. Laut Skill muss jeder Endpunkt echt aufgerufen werden, bevor die Arbeit als fertig gilt.
Brauche ich den Browser nach der Aufzeichnung?
Nein. Laut Skill braucht der Client nach der ersten Aufzeichnung keinen Browser mehr.
Details
Originalbeschreibung des Autors
Reverse-engineer a website's internal API by recording browser traffic into a HAR file, then generate a standalone client or CLI that calls the endpoints directly, with no browser needed after the first recording. Use when asked to "derive a client", "build a CLI for <site>", "reverse engineer this site's API", "record network requests", "turn this site into an API", or when the same site will be automated repeatedly and direct HTTP calls would beat driving the browser every time.
Beliebtheit
- GitHub-Sterne
- 45k
- Platz im Ranking
- #6357
- Lizenz
- Apache-2.0
- Aktualisiert
- 1.11.2026
Kommentare
- …
Weitere Skills aus diesem Repository
technical-writer
45kBringt deinem Agenten bei, Entwicklerdokumentation zu schreiben, etwa Anleitungen, API-Referenzen und Fehlerseiten, mit klarem Aufbau und korrekten Beispielen.
agentcore
45kLässt deinen Agenten Browser-Automatisierung auf AWS Bedrock AgentCore laufen, mit deiner AWS-Anmeldung und denselben Befehlen wie bei lokalem Chrome.
core
45kBringt deinem Agenten bei, einen Webbrowser zu steuern: Seiten öffnen, klicken, Formulare ausfüllen und Inhalte lesen.
dogfood
45kBringt deinem Agenten bei, eine Web-App zu testen, und schreibt zu jedem Problem einen Fehlerbericht mit Screenshots und Reproduktionsschritten.
Ähnliche Skills
tavily
394kHilft deinem Agenten, mit Tavily im Web zu suchen und den Text bestimmter Webseiten zu holen, mit Optionen für Tiefe, Domains und Daten.
blogwatcher
394kLässt deinen Agenten Blogs und RSS- oder Atom-Feeds verfolgen, auf neue Artikel prüfen und die gelesenen Artikel markieren.
data-scraper-agent
280kHilft deinem Agenten, Daten aus beliebigen öffentlichen Quellen automatisch zu sammeln. Kann zeitgesteuert laufen, Informationen anreichern und Ergebnisse speichern.